A ping to 0.0.0.0
responds from 127.0.0.1
. However, if I shutdown the localhost loopback and keep another interface up with another ip, then ping 0.0.0.0
gives an error
$ping 0.0.0.0 connect: Invalid argument
Isn't 0.0.0.0
supposed to listen to all interfaces? So basically, how exactly does a 0.0.0.0
binding work from network perspective? how does ping 0.0.0.0
work only for loop-back and not for other interface?
- Update I have read it elsewhere and got similar answer here (you cannot ping 0.0.0.0).
[anshup@s2 ~]$ ping 0.0.0.0 PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.010 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.009 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.009 ms
^C
--- 0.0.0.0 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2551ms
rtt min/avg/max/mdev =
0.009/0.009/0.010/0.002 ms
So what exactly is happening here if we cannot ping 0.0.0.0
, and (re-iterating the question) why does 0.0.0.0
response back only from loop-back and not any other interface on the host?