From Wikipedia:
The most commonly used IP address on the loopback device is 127.0.0.1 for IPv4, although any address in the range 127.0.0.0 to 127.255.255.255 is mapped to it.
This is not true, at least on FreeBSD:
$ ping 127.1.1.1
PING 127.1.1.1 (127.1.1.1): 56 data bytes
ping: sendto: Can't assign requested address
Is this correct behaviour?
FreeBSD (also OS X, and I believe NetBSD & OpenBSD) will respond to requests sent to configured addresses on the loopback interface, just as they would for addresses on any other interface -- If you want an answer you need to assign the address first:
On the logic behind this implementation, see RFC 3330:
(emphasis mine)
Linux and Windows are being "helpful" here, however from my chair answering a request that was sent to an address not assigned to this host is not correct behavior...
I see the same behavior you describe on FreeBSD 8.1. Mac OS X, which shares some DNA with FreeBSD, also only seems to map 127.0.0.1.
Windows 7 and Linux (debian with 2.6.26 kernel) both appear to map the full address range as you describe in the Wikipedia quote (and as prescribed in the RFC).
To quote from RFC 3330:
Depending how strictly you interpret the word "should," some might make the case that the FreeBSD/MacOS behavior is wrong. But given the ubiquitous use of 127.0.0.1 as the loopback address, I doubt it's likely to matter.
Its bucking the trend. Don't have a FreeBSD box handy to confirm whether its FreeBSD or your configuration.
The RFC says 127.0.0.1/24 - so it should be responding.
Question is fully answered about a three time by now, so I wanted just add some cents.
Note that for quite a some time default ipfw config drops this kind packets:
so with enabled firewall instead of
you might get
PS. Of cause there can be server built without
INET
(IPv4 support) and you won't have even127.0.0.1
=)