Section (4) veth
veth — Virtual Ethernet Device
veth devices are virtual
Ethernet devices. 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
veth devices are always
created in interconnected pairs. A pair can be created using
# ip link add <p1-name> type veth peer name <p2-name>
In the above,
p2-name are the names
assigned to the two connected end points.
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.
veth 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
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
veth device as above and then moves one
side of the pair to the other namespace:
# ip link set <p2-name> netns <p2-namespace>
ethtool(8) can be used to find
the peer of a
interface, using commands something like:
# ip link add ve_A type veth peer name ve_B # Create veth pair # ethtool -S ve_A # Discover interface index of peer NIC statistics: peer_ifindex: 16 # ip link | grep _zsingle_quotesz_^16:_zsingle_quotesz_ # Look up interface 16: [email protected]_A: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc ...
This page is part of release 5.04 of the Linux
man-pages project. A
description of the project, information about reporting bugs,
and the latest version of this page, can be found at
Copyright (c) 2012 Tomáš Pospíšek (tpo_debsourcepole.ch),
Fri, 03 Nov 2012 22:35:33 +0100
and Copyright (c) 2012 Eric W. Biederman <ebiedermxmission.com>
This is free documentation; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The GNU General Public License_zsingle_quotesz_s references to object code
and executables are to be interpreted as the output of any
document formatting or typesetting system, including
intermediate and printed output.
This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public
License along with this manual; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,