# veth(4) - man - phpMan

[VETH(4)](https://www.chedong.com/phpMan.php/man/VETH/4/markdown)                               Linux Programmer's Manual                              [VETH(4)](https://www.chedong.com/phpMan.php/man/VETH/4/markdown)



## NAME
       veth - Virtual Ethernet Device

## DESCRIPTION
       The **veth** devices are virtual Ethernet devices.  They can act as tunnels between network name‐
       spaces to create a bridge to a physical network device in another namespace, but can also  be
       used as standalone network devices.

       **veth**  devices  are  always  created in interconnected pairs.  A pair can be created using the
       command:

           # ip link add <p1-name> type veth peer name <p2-name>

       In the above, _p1-name_ and _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 **veth** pair  in
       one  network namespace and the other end in another network namespace, thus allowing communi‐
       cation between network namespaces.  To do this, one can provide the **netns** parameter when cre‐
       ating the interfaces:

           # ip link add <p1-name> netns <p1-ns> type veth peer <p2-name> netns <p2-ns>

       or, for an existing **veth** pair, move one side to the other namespace:

           # ip link set <p2-name> netns <p2-ns>

       [**ethtool**(8)](https://www.chedong.com/phpMan.php/man/ethtool/8/markdown) can be used to find the peer of a **veth** network 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** **'^16:'**   # Look up interface
           16: ve_B@ve_A: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc ...

## SEE ALSO
       [**clone**(2)](https://www.chedong.com/phpMan.php/man/clone/2/markdown), **network**___**[namespaces**(7)](https://www.chedong.com/phpMan.php/man/namespaces/7/markdown), [**ip**(8)](https://www.chedong.com/phpMan.php/man/ip/8/markdown), [**ip-link**(8)](https://www.chedong.com/phpMan.php/man/ip-link/8/markdown), [**ip-netns**(8)](https://www.chedong.com/phpMan.php/man/ip-netns/8/markdown)

## COLOPHON
       This page is part of release 5.10 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 <https://www.kernel.org/doc/man-pages/>.



Linux                                        2020-11-01                                      [VETH(4)](https://www.chedong.com/phpMan.php/man/VETH/4/markdown)
