A Ping Question
Contents
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
192.168.11.0/24, Host B has 2 interfaces: 192.168.125.0/24
and 192.168.126.0/24
.
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
|
|
If we ping from Host B to Host A, Host B looks up its routing table and find
no specific rools for destination 192.168.11.0/24
, so it will go via gateway
192.168.125.1
.
|
|
And if we ping from Host A to Host B of interface 192.168.125.0/24
, 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 192.168.126.92
and expect a
response from that destination. Unfortunately, Host B receives the packet but
can only response through 192.168.125.1
, which will never match for Host A.
So in this case, the answer is NO. But if Host A’s network interface is
in 192.168.126.0/24
, 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.
Author Wenfeng
LastMod 2017-07-04