Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all network links in all namespaces in Linux [closed]

As I know, in a Linux shell environment, I could list the networks links in any specific namespace with ip, like:

ip netns exec <namespace> ip link show

My question is:

If I have multiple net namespaces, how to list all the links in all the namespaces with a simple command? Or I have to write a script to do so?

like image 817
Qiu Yangfan Avatar asked Sep 10 '15 02:09

Qiu Yangfan


1 Answers

You can simply do:

ip link show; ip -all netns exec ip link show

Internally this just does what your script would do - it steps through all namespaces and runs the command.

like image 83
Sidepipe Avatar answered Oct 31 '22 16:10

Sidepipe