On a linux machine with a normal loopback interface:

$ ifconfig lo
lo        Link encap:Local Loopback  
          inet addr:  Mask:
          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 I get a response back:

$ ping -c1
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.045 ms

--- 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?


Windows has this behaviour too. I guess this is different interpretations of rfc 3330 - This block is assigned for use as the Internet host loopback address. A datagram sent by a higher level protocol to an address anywhere within this block should loop back inside the host. This is ordinarily implemented using only for loopback, but no addresses within this block should ever appear on any network anywhere [RFC1700, page 5].

It looks like Linux interprets this as meaning that any (even an unconfigured address) in the range should be looped back and thence you get a response from ping.

  • I can see that routing means that should alway go to the loopback interface, but what I found strange is that Linux responds to ICMP echo requests for all of these addresses rather than just the one the interface is configured for. – Matthew Buckett Feb 15 '12 at 10:02
  • 2
    RFC 3330 was obsoleted by RFC 5735, which changes the necessity of this behavior from "should" to "does". Which means the Linux and Windows implementations are correct and everyone else is wrong. Or perhaps they defined the standard. Who knows? – Michael Hampton Apr 3 '13 at 7:51

The behavior is documented in RFC 1700. is also a loopback address and also assigned to the local machine. (What else would it be assigned to?)

IP-address ::= { <Network-number>, <Host-number> }
{127, <any>}
Internal host loopback address. Should never appear outside a host.

There is no requirement to make all addresses in this range work, but it's particularly handy when dealing with protocols that don't permit you to specify a port but only an IP address. Having multiple local IP addresses allows you to run multiple instances of those servers for local use.


This is indeed specific to Linux (and maybe other OS).

But when you read either the RFC 1700 or the lo netmask setting, the loopback network should be considered an A class.

For your information:

  • BSD boxes (as Mac OS X), are limited to (that is only, as per RFC 3300 - september 2002).

  • Windows box respond to (that is from to

So, this time it seems that Windows was right (until 2002) ;)

  • is, despite what you have written above. – MadHatter Feb 15 '12 at 10:01
  • My Max OS X box still has a netmask of /8 I think: inet netmask 0xff000000 – Matthew Buckett Feb 15 '12 at 10:05
  • As per Linux with its, still you cannot ping – Ouki Feb 15 '12 at 10:14

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.