Can’t ping some IP addresses in the same subnet

Recently I have tried to setup Linux machine as dev box, and remote from Mac via SSH. But one strange issue is that I was not able to connect the dev box at all, no matter CentOS 7, CentOS 6.8 and Ubuntu 16.04.

Let me clarify. There are three machines A, B, C connected to wifi. All of them can access external network without any issue. A is Mac, B is the dev box, and C is another test machine. The ping between B and C, A and C works perfectly. But A cannot ping B and B cannot ping A at all. It seems they’re isolated.

$ ping 192.168.1.59
PING 192.168.1.59 (192.168.1.59): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3

To diagnostic, first I run “tcpdump icmp” on machine B, and ping from A results nothing, which means the ping request cannot reach to destination. Then check the arp table:

$ arp -a
nbg-418n (192.168.1.1) at cc:5d:4e:48:3d:9e on en0 ifscope [ethernet]
fewang-dev.hsd1.wa.comcast.net (192.168.1.59) at (incomplete) on en0 ifscope [ethernet]

That’s weird as it shows as incomplete, which means we cannot translate the IP address to related physical address.

I don’t know why that could happen, but fixing this can be adding static route with IP address and physical address (MAC address).

$ sudo arp -a -d
$ sudo arp -s 192.168.1.59 00:21:6a:a6:b7:fa

$ ping 192.168.1.59
PING 192.168.1.59 (192.168.1.59): 56 data bytes
64 bytes from 192.168.1.59: icmp_seq=0 ttl=64 time=19.469 ms
64 bytes from 192.168.1.59: icmp_seq=1 ttl=64 time=11.742 ms
64 bytes from 192.168.1.59: icmp_seq=2 ttl=64 time=15.606 ms

Leave a Reply