@@ -51,6 +51,7 @@ ip-netns \- process network namespace management
51
51
52
52
.ti -8
53
53
.BR " ip netns list-id"
54
+ .RI " [ target-nsid " POSITIVE-INT " ] [ nsid " POSITIVE-INT " ]"
54
55
55
56
.SH DESCRIPTION
56
57
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
196
197
and prints a line for each event it sees.
197
198
198
199
.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)
200
201
.sp
201
202
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
203
204
corresponding iproute2 netns name (from /var/run/netns) if any.
204
205
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
+
205
222
.SH EXAMPLES
206
223
.PP
207
224
ip netns list
@@ -218,10 +235,37 @@ ip netns exec vpn ip link set lo up
218
235
.RS
219
236
Bring up the loopback interface in the vpn network namespace.
220
237
.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
221
263
222
264
.SH SEE ALSO
223
265
.br
224
266
.BR ip (8)
225
267
226
268
.SH AUTHOR
227
269
Original Manpage by Eric W. Biederman
270
+ .br
271
+ Manpage revised by Nicolas Dichtel <nicolas.dichtel@6wind.com>
0 commit comments