]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man4/veth.4
Start of man-pages-5.02: updating .Announce and .lsm files
[thirdparty/man-pages.git] / man4 / veth.4
CommitLineData
1459db4a
TP
1.\" Copyright (c) 2012 Tomáš Pospíšek (tpo_deb@sourcepole.ch),
2.\" Fri, 03 Nov 2012 22:35:33 +0100
9354c155 3.\" and Copyright (c) 2012 Eric W. Biederman <ebiederm@xmission.com>
1459db4a 4.\"
cd79b0c4 5.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
1459db4a
TP
6.\" This is free documentation; you can redistribute it and/or
7.\" modify it under the terms of the GNU General Public License as
8.\" published by the Free Software Foundation; either version 2 of
9.\" the License, or (at your option) any later version.
10.\"
11.\" The GNU General Public License's references to "object code"
12.\" and "executables" are to be interpreted as the output of any
13.\" document formatting or typesetting system, including
14.\" intermediate and printed output.
15.\"
16.\" This manual is distributed in the hope that it will be useful,
17.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
18.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.\" GNU General Public License for more details.
20.\"
21.\" You should have received a copy of the GNU General Public
22.\" License along with this manual; if not, write to the Free
23.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
24.\" USA.
cd79b0c4 25.\" %%%LICENSE_END
1459db4a
TP
26.\"
27.\"
8538a62b 28.TH veth 4 2018-02-02 "Linux" "Linux Programmer's Manual"
1459db4a
TP
29.SH NAME
30veth \- Virtual Ethernet Device
31.SH DESCRIPTION
32The
33.B veth
34devices are virtual Ethernet devices.
1459db4a 35They can act as tunnels between network namespaces to create
eab9cf18
MK
36a bridge to a physical network device in another namespace,
37but can also be used as standalone network devices.
1459db4a 38.PP
1459db4a 39.B veth
9354c155
MK
40devices are always created in interconnected pairs.
41A pair can be created using the command:
42.PP
43.in +4n
44.EX
45# ip link add <p1-name> type veth peer name <p2-name>
46.EE
47.in
48.PP
49In the above,
50.I p1-name
51and
52.I p2-name
53are the names assigned to the two connected end points.
1459db4a 54.PP
eab9cf18 55Packets transmitted on one device in the pair are immediately received on
9354c155 56the other device.
c6688cd1 57When either devices is down the link state of the pair is down.
1459db4a 58.PP
9354c155
MK
59.B veth
60device pairs are useful for combining the network
61facilities of the kernel together in interesting ways.
62A particularly interesting use case is to place one end of a
63.B veth
64pair in one network namespace and the other end in another network namespace,
65thus allowing communication between network namespaces.
5d1efadb
MK
66To do this, one first creates the
67.B veth
68device as above and then moves one side of the pair to the other namespace:
69.PP
70.in +4n
71.EX
72# ip link set <p2-name> netns <p2-namespace>
73.EE
74.in
9354c155
MK
75.PP
76.BR ethtool (8)
ee24ae59 77can be used to find the peer of a
9354c155 78.B veth
ee24ae59
MK
79network interface, using commands something like:
80.PP
81.in +4n
82.EX
334299e2
MK
83# \fBip link add ve_A type veth peer name ve_B\fP # Create veth pair
84# \fBethtool -S ve_A\fP # Discover interface index of peer
ee24ae59
MK
85NIC statistics:
86 peer_ifindex: 16
334299e2 87# \fBip link | grep '^16:'\fP # Look up interface
ee24ae59
MK
8816: ve_B@ve_A: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc ...
89.EE
90.in
91.PP
1459db4a
TP
92.SH "SEE ALSO"
93.BR clone (2),
c4851a98 94.BR network_namespaces (7),
394eea35 95.BR ip (8),
eab9cf18
MK
96.BR ip-link (8),
97.BR ip-netns (8)