46

I do know that 127.0.0.1 ~ 127.255.255.254 are the loopback IP addresses for most modern operating systems and we could use these IP addresses to refer to our own computer. But isn't 127.0.0.1 enough?!?! why a wide range? why from 127.0.0.1 to 127.255.255.254?

3
  • Only social intertia avoids us to use all 127.0.0.0/8 - 127.0.0.0/24 for anything.
    – peterh
    Aug 29, 2020 at 19:58
  • @peterh-ReinstateMonica Did you mean inertia? Nov 14, 2020 at 10:35
  • @ctrl-alt-delor Yes, sorry
    – peterh
    Nov 14, 2020 at 11:05

3 Answers 3

51

The 127/8 network can be used for a number of things.

1) Simulating a large number of different computers in a fast network (simply bring up more interfaces and bind services to them) without using virtual machines. This might be helpful if you wanted to have a number of different web servers running locally on port 80 for some reason.

2) Permitting more locally running services than the 64k TCP would permit (though it seems unlikely that you would hit that limit rationally)

3) Playing games with people who aren't familiar with this factoid; "Hey, you're a loser hacker, I bet you can't even hack me. Go ahead and try; I'm at 127.45.209.66"

Probably other things too.

3
  • 7
    I can attest to have found #1 useful in something I'm currently working on where I make other private servers appear to be on localhost via SSH tunneling.
    – jeteon
    Nov 21, 2015 at 21:40
  • But this is not the case in IPv6? Apr 14, 2018 at 11:12
  • IPv6 has link-local addressing. Not the same thing, but applicable. serverfault.com/a/754287/178 Dec 5, 2018 at 11:54
13

http://www.ietf.org/rfc/rfc1700.txt

Back in the day, IP addresses were considered as plentiful, with entire /8 and /16 blocks being given to whoever asked for them.

Mind you, even though 127/8 is reserved, the RFC states that only 127.0.0.1/32 is ordinarily used (http://www.ietf.org/rfc/rfc3330.txt).

5
  • so.. there is no use of other IP addresses in this range except 127/32????
    – kiana
    Jul 5, 2010 at 5:36
  • it's used for traceroute in MPLS but they could have choose another range of IP.
    – radius
    Jul 5, 2010 at 5:53
  • +1, Keep in mind they came up with IP at a time when the IPs were kept track of in a few hosts files (before DNS) and IPs were all assigned manually (before DHCP); there were only hundreds of machines on the net. Also keep in mind that it's IPv4; there were three revisions before the final and they kept some of the cruft for compatibility reasons.
    – Chris S
    Jul 6, 2010 at 2:14
  • 2
    RFC 5735 obsoletes RFC 3330
    – klaus se
    Apr 12, 2016 at 14:44
  • "This is ordinarily implemented using only 127.0.0.1/32 for loopback," does not mean "don't use the other addresses" May 15, 2020 at 16:19
2

Back when this standard was designed, it probably made sense to have as many bits in the loopback subnet as the largest classful subnet possible, which is 24 bits. Of course we don't care about classful subnets much anymore. This is why IPv6 merely allocates one address to this purpose.

1
  • 12
    It goes deeper than that; since 127/8 is a network address that starts with a 0-bit and has all 1-bits in the rest of the first octect, that is ALL an RFC-compliant network stack needs to look at to determine where to route traffic. The fact that this does not occur in any other address was used as an optimization, not because they thought it made sense to reserve 16 million loopback addresses (it didn't, and still doesn't).
    – adaptr
    Dec 21, 2011 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy