veth(4)
β¨ veth β Virtual Ethernet Device β¨
okay bestie, gather round, because this one is genuinely iconic π it's the veth page from the kernel interfaces manual, and it's giving main character energy in every container you've ever touched.
π NAME π
veth β Virtual Ethernet Device
πΈ DESCRIPTION πΈ
So. veth devices are virtual Ethernet devices. That's the whole vibe. They can act as tunnels between network namespaces β like, you can use one to create a bridge to a physical network device that's chillin' in another namespace β but ngl they also work perfectly fine as standalone network devices all on their own. versatile queen π
Here's the thing though, and this is important: veth devices are always created in interconnected pairs. no solo acts, ever. it's a duo situation, they come as a set π«Ά
You make a pair like this:
# ip link add <p1-name> type veth peer name <p2-name>
In that command, p1-name and p2-name are the names you're assigning to the two connected end points. cute, right?
Now the actual behavior: packets transmitted on one device in the pair are immediately received on the other device. instant. no latency drama. BUT β and this is the catch β when either device is down, the link state of the pair is down. both of them. they're linked like that, it's a whole thing π
π¦ why you'd even want this
veth device pairs are useful for combining the network facilities of the kernel together in interesting ways. that's the official phrasing and honestly? slay.
A particularly interesting use case β and this is the one everybody's obsessed with β is to place one end of a veth pair in one network namespace and the other end in another network namespace. that way you get communication between network namespaces. it's giving tunnel but make it namespace-y β¨
To do that, you can just hand over the netns parameter when you're creating the interfaces:
# ip link add <p1-name> netns <p1-ns> type veth peer <p2-name> netns <p2-ns>
or, if you've already got an existing veth pair and you're like "hmm actually let me move one side", you move one side to the other namespace:
# ip link set <p2-name> netns <p2-ns>
periodt. π
π finding your other half
okay so you've got a veth interface and you're like "who is your peer bestie" β that's where ethtool(8) comes in. you can use it to find the peer of a veth network interface, with 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 that? peer_ifindex: 16 told you where to look, and then ip link | grep '^16:' showed you it's ve_B@ve_A, which is literally the other half of your pair. mystery solved, friendship confirmed π₯Ήπ
π SEE ALSO π
and that's the whole page bestie, you ate it πβ¨
this came from Linux man-pages 6.20, dated 2026-02-08, and the manual name is veth in section 4 (kernel interfaces, for the record). go forth and pair your devices, ily ππ
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: GPL-2.0-or-later
- Copyright 2012, Eric W. Biederman <ebiederm@xmission.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms