]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man4/veth.4
Various pages: [GPL-1.0-or-later] Use SPDX-License-Identifier
[thirdparty/man-pages.git] / man4 / veth.4
index 20294c097df9743879e9879e0c16c06ce8f05e85..7b9064720f3fc07ec3a4f88ad2a736e1cc36d7bb 100644 (file)
@@ -25,7 +25,7 @@
 .\" %%%LICENSE_END
 .\"
 .\"
-.TH VETH 4 2018-02-02 "Linux" "Linux Programmer's Manual"
+.TH VETH 4 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 veth \- Virtual Ethernet Device
 .SH DESCRIPTION
@@ -54,7 +54,7 @@ are the names assigned to the two connected end points.
 .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.
+When either device is down, the link state of the pair is down.
 .PP
 .B veth
 device pairs are useful for combining the network
@@ -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
@@ -81,17 +91,16 @@ network interface, using commands something like:
 .in +4n
 .EX
 # \fBip link add ve_A type veth peer name ve_B\fP   # Create veth pair
-# \fBethtool -S ve_A\fP         # Discover interface index of peer
+# \fBethtool \-S ve_A\fP         # Discover interface index of peer
 NIC statistics:
      peer_ifindex: 16
-# \fBip link | grep '^16:'\fP   # Look up interface
-16: ve_B@ve_A: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc ...
+# \fBip link | grep \(aq\(ha16:\(aq\fP   # Look up interface
+16: ve_B@ve_A: <BROADCAST,MULTICAST,M\-DOWN> mtu 1500 qdisc ...
 .EE
 .in
-.PP
 .SH "SEE ALSO"
 .BR clone (2),
 .BR network_namespaces (7),
 .BR ip (8),
-.BR ip-link (8),
-.BR ip-netns (8)
+.BR ip\-link (8),
+.BR ip\-netns (8)