netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: stephen@networkplumber.org
Cc: netdev@vger.kernel.org, dsahern@gmail.com,
	Nicolas Dichtel <nicolas.dichtel@6wind.com>
Subject: [PATCH iproute2 2/2] ip-netns.8: document target-nsid and nsid options of list-id
Date: Wed, 16 Oct 2019 17:00:52 +0200	[thread overview]
Message-ID: <20191016150052.30695-2-nicolas.dichtel@6wind.com> (raw)
In-Reply-To: <20191016150052.30695-1-nicolas.dichtel@6wind.com>

This is a follow up of the commit eaefb07804a1 ("ipnetns: enable to dump
nsid conversion table").

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 man/man8/ip-netns.8 | 48 +++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 46 insertions(+), 2 deletions(-)

diff --git a/man/man8/ip-netns.8 b/man/man8/ip-netns.8
index 961bcf03f609..c75917dac8b1 100644
--- a/man/man8/ip-netns.8
+++ b/man/man8/ip-netns.8
@@ -51,6 +51,7 @@ ip-netns \- process network namespace management
 
 .ti -8
 .BR "ip netns list-id"
+.RI "[ target-nsid " POSITIVE-INT " ] [ nsid " POSITIVE-INT " ]"
 
 .SH DESCRIPTION
 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
 and prints a line for each event it sees.
 
 .TP
-.B ip netns list-id - list network namespace ids (nsid)
+.B ip netns list-id [target-nsid POSITIVE-INT] [nsid POSITIVE-INT] - list network namespace ids (nsid)
 .sp
 Network namespace ids are used to identify a peer network namespace. This
-command displays nsid of the current network namespace and provides the
+command displays nsids of the current network namespace and provides the
 corresponding iproute2 netns name (from /var/run/netns) if any.
 
+The
+.B target-nsid
+option enables to display nsids of the specified network namespace instead of the current network
+namespace. This
+.B target-nsid
+is a nsid from the current network namespace.
+
+The
+.B nsid
+option enables to display only this nsid. It is a nsid from the current network namespace. In
+combination with the
+.B target-nsid
+option, it enables to convert a specific nsid from the current network namespace to a nsid of the
+.B target-nsid
+network namespace.
+
 .SH EXAMPLES
 .PP
 ip netns list
@@ -218,6 +235,31 @@ ip netns exec vpn ip link set lo up
 .RS
 Bring up the loopback interface in the vpn network namespace.
 .RE
+.PP
+ip netns add foo
+.br
+ip netns add bar
+.br
+ip netns set foo 12
+.br
+ip netns set bar 13
+.br
+ip -n foo netns set foo 22
+.br
+ip -n foo netns set bar 23
+.br
+ip -n bar netns set foo 32
+.br
+ip -n bar netns set bar 33
+.br
+ip netns list-id target-nsid 12
+.RS
+Shows the list of nsids from the network namespace foo.
+.RE
+ip netns list-id target-nsid 12 nsid 13
+.RS
+Get nsid of bar from the network namespace foo (result is 23).
+.RE
 
 .SH SEE ALSO
 .br
@@ -225,3 +267,5 @@ Bring up the loopback interface in the vpn network namespace.
 
 .SH AUTHOR
 Original Manpage by Eric W. Biederman
+.br
+Manpage revised by Nicolas Dichtel <nicolas.dichtel@6wind.com>
-- 
2.23.0


  reply	other threads:[~2019-10-16 15:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 15:00 [PATCH iproute2 1/2] ip-netns.8: document the 'auto' keyword of 'ip netns set' Nicolas Dichtel
2019-10-16 15:00 ` Nicolas Dichtel [this message]
2019-10-16 20:25 ` Stephen Hemminger

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=20191016150052.30695-2-nicolas.dichtel@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).