From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Vadim Kochan <vadim4j@gmail.com>, netdev@vger.kernel.org
Subject: Re: iproute2: Run over all netns
Date: Mon, 05 Jan 2015 17:40:51 +0100 [thread overview]
Message-ID: <54AABE93.2010602@6wind.com> (raw)
In-Reply-To: <20150105122333.GA6646@angus-think.wlc.globallogic.com>
Le 05/01/2015 13:23, Vadim Kochan a écrit :
> Hi All,
>
> I have some piece of code which allow 'ip cmd'
> on each netns, I found it useful for getting some info
> from all the netns in one shot, BUT I faced with one issue
> which mostly related to the user interface design. The problem
> is that it would be good to print netns name only when
> user uses "show" command, but not for updating/adding (IMHO),
> but its hard to find the good way to implement this.
>
> To run each netns the 'ip -net all CMD ...' construction can be used.
>
> I see the following options for this:
>
> #1 Add additional option ( -N ? ) for show netns label on each executing of CMD:
>
> # ip -net all -N link
>
> [test_net]
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>
> [home0]
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>
> [lan0]
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>
> [wan0]
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
> link/ether 16:f7:cb:b6:7a:8e brd ff:ff:ff:ff:ff:ff
>
> [vnet0]
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>
>
> and w/o:
>
> # ip -net all link
>
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: br0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default
> link/ether 16:f7:cb:b6:7a:8e brd ff:ff:ff:ff:ff:ff
>
> 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default
> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>
> the last one is not so useful right ?
>
> #2 Prints netns name by default if "-net all" was specified
> (add option to prevent this ?), so it will be printed even on the
> add/del/change commands ...
I vote for this one (I don't think the option to prevent it is needed, it's
better to be explicit).
>
> # ip -net all link add ...
>
> [home0]
> [lan0]
> [wan0]
> [vnet0]
>
> but does it really useless to see that it will shows all the netns
> on which cmd has been ran ?
I tend to say yes (another process may add/remove a netns in the same time).
Regards,
Nicolas
prev parent reply other threads:[~2015-01-05 16:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-05 12:23 iproute2: Run over all netns Vadim Kochan
2015-01-05 16:40 ` Nicolas Dichtel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54AABE93.2010602@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=netdev@vger.kernel.org \
--cc=vadim4j@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.