136 lines
3.2 KiB
HTML
136 lines
3.2 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of VETH</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>VETH</H1>
|
|
Section: Linux Programmer's Manual (4)<BR>Updated: 2018-02-02<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
veth - Virtual Ethernet Device
|
|
<A NAME="lbAC"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
The
|
|
<B>veth</B>
|
|
|
|
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 devices.
|
|
<P>
|
|
|
|
<B>veth</B>
|
|
|
|
devices are always created in interconnected pairs.
|
|
A pair can be created using the command:
|
|
<P>
|
|
|
|
|
|
|
|
# ip link add <p1-name> type veth peer name <p2-name>
|
|
|
|
|
|
<P>
|
|
|
|
In the above,
|
|
<I>p1-name</I>
|
|
|
|
and
|
|
<I>p2-name</I>
|
|
|
|
are the names assigned to the two connected end points.
|
|
<P>
|
|
|
|
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.
|
|
<P>
|
|
|
|
<B>veth</B>
|
|
|
|
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</B>
|
|
|
|
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
|
|
<B>veth</B>
|
|
|
|
device as above and then moves one side of the pair to the other namespace:
|
|
<P>
|
|
|
|
|
|
|
|
# ip link set <p2-name> netns <p2-namespace>
|
|
|
|
|
|
<P>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+ethtool">ethtool</A></B>(8)
|
|
|
|
can be used to find the peer of a
|
|
<B>veth</B>
|
|
|
|
network interface, using commands something like:
|
|
<P>
|
|
|
|
|
|
|
|
# <B>ip link add ve_A type veth peer name ve_B</B> # Create veth pair
|
|
# <B>ethtool -S ve_A</B> # Discover interface index of peer
|
|
NIC statistics:
|
|
<BR> peer_ifindex: 16
|
|
# <B>ip link | grep '^16:'</B> # Look up interface
|
|
16: <A HREF="mailto:ve_B@ve_A">ve_B@ve_A</A>: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc ...
|
|
|
|
|
|
<P>
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?2+clone">clone</A></B>(2),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?7+network_namespaces">network_namespaces</A></B>(7),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+ip">ip</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+ip-link">ip-link</A></B>(8),
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?8+ip-netns">ip-netns</A></B>(8)
|
|
|
|
<A NAME="lbAE"> </A>
|
|
<H2>COLOPHON</H2>
|
|
|
|
This page is part of release 5.05 of the Linux
|
|
<I>man-pages</I>
|
|
|
|
project.
|
|
A description of the project,
|
|
information about reporting bugs,
|
|
and the latest version of this page,
|
|
can be found at
|
|
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">DESCRIPTION</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">SEE ALSO</A><DD>
|
|
<DT id="4"><A HREF="#lbAE">COLOPHON</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:06:02 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|