3 ms·
I don't know about the OP, but in Ubuntu Precise "ping 0" pings to 127.0.0.1. I can't explain why.
by reidrac 13y ago
I don't know about the OP, but in Ubuntu Precise "ping 0" pings to 127.0.0.1.
I can't explain why.
- ordinary 13y agoFrom what I can tell, the use of '0' or '0.0.0.0' as a destination address is not official. It should only be used as a source address. From RFC 5735 - Special USe IPv4 Addresses: 0.0.0.0/8 - Addresses in this block refer to source hosts on "this" network. Address 0.0.0.0/32 may be used as a source address for this host on this network; other addresses within 0.0.0.0/8 may be used to refer to specified hosts on this network. Support for it looks to be flaky. 'ping 0' and 'ping 0.0.0.0' work for me on various Linuxes ("64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.026 ms"), but not on Windows 7 ("sendto: Cannot assign requested address") or Windows Server 2003 ("Destination specified is invalid").
- reidrac 13y agoIPv6 behaviour seems to be the same: "ping6 ::" pings to ::1: (localhost). This is intriguing, really :) EDIT: oh, you already pointed to the RFC :)