Recently, I focus on OpenStack things where an interesting network question comes out: If a host machine has multiple network interfaces, is it possible to ping all of them from another host?

To be clearer, we assume that Host A has a unique network interface, Host B has 2 interfaces: and Meanwhile, the 3 interfaces are connected by a router, as the graph illustrated.


If we look at the routing table of Host B, we’ll find something like

[root@eta-bmc2 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth3   U     0      0        0 eth0   U     0      0        0 eth2   U     0      0        0 eth1         UG    0      0        0 eth0

If we ping from Host B to Host A, Host B looks up its routing table and find no specific rools for destination, so it will go via gateway

[root@eta-bmc2 ~]# tracepath
 1: (                          1.437ms
 2:  testagent (                              3.174ms reached
     Resume: pmtu 65535 hops 2 back 63

And if we ping from Host A to Host B of interface, it goes well. However, if we ping to Host B‘s another interface, it will fail.

The reason is obvious, Host A send a packet to and expect a response from that destination. Unfortunately, Host B receives the packet but can only response through, which will never match for Host A.

So in this case, the answer is NO. But if Host A‘s network interface is in, it can ping the 2 interfaces of Host B, or if Host A also has multiple network interfaces, with proper routing table setting, it can ping both 2 interfaces of Host B as well.