I have such a topology made of network namespaces and veth pairs:

------                           ------                            ------
| a1 |                           | r1 |                            | r2 |
|    | a1-eth0-----------r1-eth0 |    |r1-eth1--------------r2-eth1|    |
-----(   (   ( 

For r1, net.ipv4.ip_forward is 1.

I can successfully ping r2 by a1 with the command:

ping -I a1-eth0 -c1

Also, I can successfully ping r2 by r1 using r1-eth1 interface with the command:

ping -I r1-eth1 -c1

But then, why can't I ping r2 by r1 using r1-eth0 interface? I get Destination Host Unreachable:

ping -I r1-eth0 -c1
PING ( from r1-eth0: 56(84) bytes of data.
From icmp_seq=1 Destination Host Unreachable

--- ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

The same way, I cannot ping one interface of router r1 by another interface of this very router:

# here I get Destination Host Unreachable again:
ping -I r1-eth0 -c1

# here I get Redirect Host(New nexthop:
ping -I r1-eth1 -c1

Here is the main route table of r1:

ip route
default via dev r1-eth1 dev r1-eth0  proto kernel  scope link  src dev r1-eth1  proto kernel  scope link  src

So to me it looks like the problem is that interfaces of the router r1 cannot communicate between each other. However, r1 forwards traffic between a1 and r2 normally.

Thank you for attention!


I needed to solve the problem discussed above to solve the problem Tc qdisc delay not seen in tcpdump recording. I have found the solution to that problem and I posted there by the link. So I do not need this question anymore and I close it. Thank you everybody for reading and participating!

  • Please edit the question and describe which network namespaces you have created, and how you are executing the ping inside a particular network namespace. (In the question as written, I don't see any network namespaces at all besides names for them. And in particular you shouldn't need ping -I ... if inside a network namespace). If you didn't create network namespaces, and did all of it from the main namespace, it won't work because the kernel considers it to be a routing error (though it can be made to work with a lot of effort). But creating the namespaces would be the proper fix.
    – dirkt
    Commented Jun 28, 2019 at 8:22

1 Answer 1


Why do you want to send packets via the wrong interface, i.e. using an interface that has no connection to the network you want to reach? This is like jumping on a subway train on the wrong platform. Interfaces don't communicate with each other, hosts do. Hosts communicate with other hosts over networks. Interface selection is done based on routing table entries. As far as I can tell, your ping commands should work if you remove the -I options altogether.

  • Well, it's a long story. I try to solve this problem: unix.stackexchange.com/questions/523600/…. On sender host I want to create dummy interface and send data intended for receiver host from the dummy interface via the main interface. This way I want to be able to see netem delay set up on the main interface in the tcpdump recording turned on the main interface.
    – JenyaKh
    Commented Jun 27, 2019 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .