Linux-man Archive on lore.kernel.org
 help / color / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: "Devin J. Pohly" <djpohly@gmail.com>
Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org,
	netdev@vger.kernel.org, stephen@networkplumber.org
Subject: Re: [PATCH] veth.4: Add a more direct example
Date: Tue, 19 May 2020 21:54:26 +0200
Message-ID: <f2833b9c-8619-c327-48dc-69fae97b20cc@gmail.com> (raw)
In-Reply-To: <20200518205828.13905-1-djpohly@gmail.com>

Hello Devin

On 5/18/20 10:58 PM, Devin J. Pohly wrote:
> iproute2 allows you to specify the netns for either side of a veth
> interface at creation time.  Add an example of this to veth(4) so it
> doesn't sound like you have to move the interfaces in a separate step.
> 
> Verified with commands:
>     # ip netns add alpha
>     # ip netns add bravo
>     # ip link add foo netns alpha type veth peer bar netns bravo
>     # ip -n alpha link show
>     # ip -n bravo link show

Nice patch, and nice commit message! Thanks. Applied.

Cheers,

Michael

> ---
>  man4/veth.4 | 16 +++++++++++++---
>  1 file changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/man4/veth.4 b/man4/veth.4
> index 20294c097..2d59882a0 100644
> --- a/man4/veth.4
> +++ b/man4/veth.4
> @@ -63,13 +63,23 @@ A particularly interesting use case is to place one end of a
>  .B veth
>  pair in one network namespace and the other end in another network namespace,
>  thus allowing communication between network namespaces.
> -To do this, one first creates the
> +To do this, one can provide the
> +.B netns
> +parameter when creating the interfaces:
> +.PP
> +.in +4n
> +.EX
> +# ip link add <p1-name> netns <p1-ns> type veth peer <p2-name> netns <p2-ns>
> +.EE
> +.in
> +.PP
> +or, for an existing
>  .B veth
> -device as above and then moves one side of the pair to the other namespace:
> +pair, move one side to the other namespace:
>  .PP
>  .in +4n
>  .EX
> -# ip link set <p2-name> netns <p2-namespace>
> +# ip link set <p2-name> netns <p2-ns>
>  .EE
>  .in
>  .PP
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 20:58 Devin J. Pohly
2020-05-19 19:54 ` Michael Kerrisk (man-pages) [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=f2833b9c-8619-c327-48dc-69fae97b20cc@gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=djpohly@gmail.com \
    --cc=linux-man@vger.kernel.org \
    --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

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git