Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I decided to play with veth : create a veth pair and send a ping from one end to another.

$ ip link add type veth
$ ip addr add dev veth4
$ ip addr add dev veth5
$ ip link dev veth4 set up
$ ip link dev veth5 set up

Let's check.

$ ip a

18: veth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 6a:dc:02:5b:f0:f3 brd ff:ff:ff:ff:ff:ff
    inet scope global veth4
       valid_lft forever preferred_lft forever
19: veth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 22:ec:d5:e8:7c:3e brd ff:ff:ff:ff:ff:ff
    inet scope global veth5
       valid_lft forever preferred_lft forever

Everything seems to be ok. Now try to ping.

$ ping -I veth4
PING ( from veth4: 56(84) bytes of data.
From icmp_seq=1 Destination Host Unreachable
From icmp_seq=2 Destination Host Unreachable
From icmp_seq=3 Destination Host Unreachable

$ sudo tshark -i veth5
Capturing on 'veth5'
l  1   0.000000 6a:dc:02:5b:f0:f3 -> Broadcast    ARP 42 Who has  Tell
1   2   1.003206 6a:dc:02:5b:f0:f3 -> Broadcast    ARP 42 Who has  Tell

So veth5 recevies arp requests but doesn't bother to answer. What's the matter?

share|improve this question

1 Answer 1

Veth pairs aren't used this way. A veth pair is literally a device pipe, one end of the pipes packets come out the other end.

The simplest synonym I can offer is imagining one half of the pair is a ethernet device, whilst the other end is a switch port the device is plugged into. You shouldn't treat the pair as being two separate devices, but one device which has two 'ends' to push/pull from.

share|improve this answer
Well, I can use it this way for example if put one end in different namespace, I wonder why I could not do it without namespaces. – nshy Mar 29 '14 at 5:39
The same reason you cant do ping -I eth0 <eth1IP> when both are on the same network? When you dont specify the device (and it works) it actually uses lo. – Matthew Ife Mar 29 '14 at 7:04
Mmm, still don't understand. Hypothetical eth0 and eth1 are not connected. But veth0 and veth1 are. And when I put say veth1 in namespace and from host ping -I veth0 veth1IP - it works. – nshy Mar 29 '14 at 12:08
veth0 and veth1 are not connected, rather they are two ends to the same device, so it makes little sense to assign two addresses to it. My point about eth0 and eth1 is that if a test case without using a veth pair doesn't work, why would you expect a veth pair to work? – Matthew Ife Mar 29 '14 at 12:44
I have exactly the same misunderstanding as the OP. Why does it work with namespaces but not without? What is the difference? I do think of the veth as a pipe (well, as a "cable"), which can be used to connect two devices (say a host and a switch), so each device owns an end of the pipe, and does reply to ARP requests! (And in this scenario, it is common to have a different IP address assigned to each end of the pipe). – Norswap Nov 12 '14 at 17:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.