Skip to content

Commit 6ed2915

Browse files
NicolasDichtelshemminger
authored andcommittedOct 16, 2019
ip-netns.8: document target-nsid and nsid options of list-id
This is a follow up of the commit eaefb07 ("ipnetns: enable to dump nsid conversion table"). Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
1 parent 63ab204 commit 6ed2915

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed
 

‎man/man8/ip-netns.8

+46-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ ip-netns \- process network namespace management
5151

5252
.ti -8
5353
.BR "ip netns list-id"
54+
.RI "[ target-nsid " POSITIVE-INT " ] [ nsid " POSITIVE-INT " ]"
5455

5556
.SH DESCRIPTION
5657
A network namespace is logically another copy of the network stack,
@@ -196,12 +197,28 @@ This command watches network namespace name addition and deletion events
196197
and prints a line for each event it sees.
197198

198199
.TP
199-
.B ip netns list-id - list network namespace ids (nsid)
200+
.B ip netns list-id [target-nsid POSITIVE-INT] [nsid POSITIVE-INT] - list network namespace ids (nsid)
200201
.sp
201202
Network namespace ids are used to identify a peer network namespace. This
202-
command displays nsid of the current network namespace and provides the
203+
command displays nsids of the current network namespace and provides the
203204
corresponding iproute2 netns name (from /var/run/netns) if any.
204205

206+
The
207+
.B target-nsid
208+
option enables to display nsids of the specified network namespace instead of the current network
209+
namespace. This
210+
.B target-nsid
211+
is a nsid from the current network namespace.
212+
213+
The
214+
.B nsid
215+
option enables to display only this nsid. It is a nsid from the current network namespace. In
216+
combination with the
217+
.B target-nsid
218+
option, it enables to convert a specific nsid from the current network namespace to a nsid of the
219+
.B target-nsid
220+
network namespace.
221+
205222
.SH EXAMPLES
206223
.PP
207224
ip netns list
@@ -218,10 +235,37 @@ ip netns exec vpn ip link set lo up
218235
.RS
219236
Bring up the loopback interface in the vpn network namespace.
220237
.RE
238+
.PP
239+
ip netns add foo
240+
.br
241+
ip netns add bar
242+
.br
243+
ip netns set foo 12
244+
.br
245+
ip netns set bar 13
246+
.br
247+
ip -n foo netns set foo 22
248+
.br
249+
ip -n foo netns set bar 23
250+
.br
251+
ip -n bar netns set foo 32
252+
.br
253+
ip -n bar netns set bar 33
254+
.br
255+
ip netns list-id target-nsid 12
256+
.RS
257+
Shows the list of nsids from the network namespace foo.
258+
.RE
259+
ip netns list-id target-nsid 12 nsid 13
260+
.RS
261+
Get nsid of bar from the network namespace foo (result is 23).
262+
.RE
221263

222264
.SH SEE ALSO
223265
.br
224266
.BR ip (8)
225267

226268
.SH AUTHOR
227269
Original Manpage by Eric W. Biederman
270+
.br
271+
Manpage revised by Nicolas Dichtel <nicolas.dichtel@6wind.com>

0 commit comments

Comments
 (0)
Please sign in to comment.