From 9354c155a09b7cd5987f01efd82b563716cd60b6 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Tue, 3 Oct 2017 20:47:37 +0200 Subject: [PATCH] veth.4: Integrate content from Eric Biederman Cowritten-by: Eric W. Biederman Signed-off-by: Michael Kerrisk --- man4/veth.4 | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/man4/veth.4 b/man4/veth.4 index 42820e1b6..e2ebd8431 100644 --- a/man4/veth.4 +++ b/man4/veth.4 @@ -1,5 +1,6 @@ .\" Copyright (c) 2012 Tomáš Pospíšek (tpo_deb@sourcepole.ch), .\" Fri, 03 Nov 2012 22:35:33 +0100 +.\" and Copyright (c) 2012 Eric W. Biederman .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as @@ -29,27 +30,43 @@ veth \- Virtual Ethernet Device The .B veth devices are virtual Ethernet devices. -.PP They can act as tunnels between network namespaces to create a bridge to a physical network device in another namespace, but can also be used as standalone network devices. .PP -Because of their original purpose for tunneling .B veth -devices are always created in pairs, that are +devices are always created in interconnected pairs. +A pair can be created using the command: +.PP +.in +4n +.EX +# ip link add type veth peer name +.EE +.in +.PP +In the above, +.I p1-name +and +.I p2-name +are the names assigned to the two connected end points. interconnected with each other. -When one +.PP +Packets transmitted on one device in the pair are immediately received on +the other device. +When either devices is down the link state of the pair is down. +.PP .B veth -end receives a packet it appears on its pair and vice versa. -.PP -.B Veth -devices can be manipulated with the -.BR ip (8) -tool. -See -.I "ip link help" -for more information. +device pairs are useful for combining the network +facilities of the kernel together in interesting ways. +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. .PP +.BR ethtool (8) +can be used to test if a networking device is a +.B veth +device, and to find the peer network interface. .SH "SEE ALSO" .BR clone (2), .BR ip (8),