12

IPv4 allocates a whole block of IPv4 loopback addresses, 127.0.0.0/8. IPv6, in contrast, only allocates a single loopback address, ::1.

This seems surprising that IPv6 would be so stingy in its allocation of loopback address(es), since overall it provides a huge increase in address space.

In IPv4 I've found it useful to be able to use multiple loopback addresses. E.g. for certain complex DNS set-ups, I can install two local DNS servers, one on 127.0.0.1:53, and another on 127.0.1.1:53. (It's a bit easier to refer to the different servers using different IP addresses, rather than using non-standard port numbers on a single IP address.) I can't use this strategy on IPv6 with only one loopback address.

What good rationales might there have been for only allocating a single loopback address for IPv6, unlike for IPv4?

Craig McQueen
  • 720
  • 6
  • 18
  • 5
    Maybe the idea was to use fe80:: for it, I do not know, but we are not alone: https://tools.ietf.org/html/draft-smith-v6ops-larger-ipv6-loopback-prefix-04 – marcolz Oct 19 '15 at 08:32
  • @marcolz: Thanks for that reference. Was it not approved, since it says it expired in August 2013? – Craig McQueen Oct 19 '15 at 22:26
  • 3
    Related: http://serverfault.com/questions/193377/ipv6-loopback-addresses-equivalent-to-127-x-x-x?rq=1 – Craig McQueen Oct 20 '15 at 00:58
  • 2
    indeed, it was not accepted. I cannot find the discussion about it, but apparently IANA did not find it necessary. Considering that that would mean existing devices supporting IPv6 would need to be updated to be able to advertise full IPv6 compatibility, I guess that changing this now is too big of a hurdle to take. – marcolz Oct 20 '15 at 06:20

3 Answers3

4

They are not needed. Simple like that.

You can always assign link local or private addresses as you need to a loopback adapter - in the rare case you really do that.

I would say that most people are not even aware you can use anything else than 127.0.0.1 an you are the first person I have met in around 20 years claiming to use more than that. Not joking.

Most multi server setups do not need it (HTTP host header is used instead - and yes, I know this is limited to http, but I would say most servers needing this are from web developers).

sigjuice
  • 197
  • 1
  • 5
TomTom
  • 50,857
  • 7
  • 52
  • 134
  • 4
    If you would like to test services on your loopback interface, it would be handy to have some addresses that are guaranteed not to conflict with any other addresses. – marcolz Oct 19 '15 at 08:26
  • Link local - limited to the LINK (ethernet). Virtual loop adapter (link does not go out to physical network) and you are set. IPV6 has a TON of addresses with limited use. IPV4 had none outside of localhost /8. – TomTom Oct 19 '15 at 08:28
  • 3
    Yes, you can use link local. But in theory that may conflict with other link local ranges on your machine, so you in theory you cannot auto-assign one to your servers. Although in practice you probably can, with knowledge of your interfaces, but it would be better if there was a reserved range for it imo. – marcolz Oct 19 '15 at 08:37
  • 1
    Yes. Then use private addresses. There are so many around you can make an internal subnet that is not used in your company EASILY. – TomTom Oct 19 '15 at 08:48
  • That is not the point of the question. – marcolz Oct 19 '15 at 08:49
  • @marcolz: But it is an answer to the question. In IPv4 the concept of private addresses was addded later AND they were in quite short supply. That made a large local space important. In IPV6 they may well have decided that given the plenthora or alternatives available, it is simply NOT NEEDED. Especially as most of those addresses are hardly ever used..The question was about WHY, and that is a valid thought and answer to that. Not sure where you learned english, but for me the question is clear. – TomTom Oct 19 '15 at 09:23
  • Read the DNS example in the question. Your HTTP statement fails there. But I guess it could be an explanation, meaning that the IETF did not see the point either. An oversight IMO. – marcolz Oct 19 '15 at 09:42
  • @marcolz Read my answer. All of it. I gave HTTP only as an EXAMPLE (as this is the MOST used case likely due to the number of people making websites). I explained before that there is an easy to use alternative. I understand also - now- that your education did not teach you to evaluate a sentence in an answer in context. This is a grave oversight. You should maybe train a little to read - and try to understand - texts completely. – TomTom Oct 19 '15 at 10:53
  • 3
    Where in the original question does something high level as "web hosting" enter the picture? Your statement is out of the scope of what I believe is the question. This is about OSI layer 3. Your belittling comments probably say as much about you as your statement about not having met anyone in 20 years that does use anything other than 127.0.0.1. How do you suppose we should value that statement? – marcolz Oct 19 '15 at 11:03
  • Ubuntu hosts for some reason like to also use 127.0.1.1 as well as 127.0.0.1. Other than that, I haven't seen other addresses used before ever. Like you've said it's unnecessary. – hookenz Oct 20 '15 at 04:13
  • 1
    Hello @Matt and Tom. I an another user of many 127 addresses. I need to run many test servers. They have to be independent, so no proxy to sort the problem. I put the names in `/etc/hosts` and they behave as if on different machines. I am worried what will happen when ipv4 is turned off. May be someone can register a block, and those of us that want it can configure our machines for it. – ctrl-alt-delor May 28 '18 at 15:49
  • @ctrl-alt-delor - if you want lots of local addresses just do something like create a bridge and give it an ip range then link it to loopback. voila! – hookenz May 29 '18 at 02:19
  • I don't agree that it's not needed. Indeed I think this is a major oversight in the IPv6 design. Of course you can add additional loopback adapters and assign multiple addresses to them, but that's not the same as having 127.0.0.0/8 configured and ready. Every device on earth is guaranteed to have 127.3.42.77 ready for a socket to bind to - you can just deliver your configuration with it and it works. I use this concept for multiple webservers behind a reverse proxy for 2 decades now. It solves so much issues you'd otherwise have when each service has to use different/not native ports. – xsrf Sep 16 '21 at 08:55
2

If you want more addresses available locally, you can just assign addresses from a ULA range of your choosing and assign them to the local machine (on the loopback interface, if you like). That'll give you all the addresses you want. You don't have to be granted a special block from which to assign addresses that your machine will respond to locally.

womble
  • 95,029
  • 29
  • 173
  • 228
0

The IPv6 addressing architecture has lots of space. The /16 space for interface-local multicast would be well suited for local services.

AFAIK the socket API is the limit here, because multicast and unicast addresses cannot be used interchangeably.

Craig McQueen
  • 720
  • 6
  • 18
mschuett
  • 3,066
  • 20
  • 21
  • That is not the point of the question. – marcolz Oct 19 '15 at 09:05
  • IMHO that is one rationale for a single loopback address: a vast number of multicast addresses for various scopes. – mschuett Oct 19 '15 at 09:11
  • I wasn't aware of interface-local multicast. But being multicast, then it's not really equivalent to `127.0.0.0/8` is it? Multicast gives quite different functionality in several ways. – Craig McQueen Oct 19 '15 at 23:38