On a linux machine with a normal loopback interface:
$ ifconfig lo
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:36621784 errors:0 dropped:0 overruns:0 frame:0
TX packets:36621784 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6752024976 (6.2 GiB) TX bytes:6752024976 (6.2 GiB)
when I ping any add address in the range 127.0.0.0/8 I get a response back:
$ ping -c1 127.7.23.4
PING 127.7.23.4 (127.7.23.4) 56(84) bytes of data.
64 bytes from 127.7.23.4: icmp_seq=1 ttl=64 time=0.045 ms
--- 127.7.23.4 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.045/0.045/0.045/0.000 ms
This behaviour is particular to Linux as I don't see it on my Mac OS X Lion machine. I don't have any IP aliases setup for the loopback interface which is what I would have expected todo to have this work.
Why is this happening and is it the expected behaviour?