Score:3

I have enabled IpV6 only. Why I can still ping 127.0.0.1

cn flag

I would like to test few scenarios on IpV6 stack. For that reason I have disabled IpV4 stack for each network adapter in network adapter settings (Windows 10).

Now, when I run ping 127.0.0.1 - I still do get answer from ICMP. My question is - why this happens and how can I avoid this?

UPD: I might have found one reason for this. Running netsh interface ip show addresses shows special interface... Loopback Pseudo-Interface 1. Guess this is the reason. Now I wonder is it installed by default in IPV6 only and can it be removed.

paladin avatar
id flag
IPv6 is to a degree backwards compatible to IPv4. This might be the reason. The entire IPv4 address range is mapped into IPv6 as special address range.
cn flag
Thanks, will look through IpV6 standard to verify that, didn't know that
paladin avatar
id flag
It's `::FFFF:0.0.0.0` to `::FFFF:255.255.255.255` (IPv4 notation in IPv6) or `::FFFF:0:0` to `::FFFF:FFFF:FFFF` (default IPv6 notation)
cn flag
Those are internal ranges. But I am still not sure which part of protocol or OS does resolve 127.0.0.1 to local machine when IpV4 is disabled...
paladin avatar
id flag
This depends on the OS. Windows is usually trying to be backwards compatible. A more general definition may be found here [RFC4038](https://www.rfc-editor.org/rfc/rfc4038), see chapter 4.
djdomi avatar
za flag
linux usually first looks into /etc/hosts like windows have this file too. Enabling ipv6 does not mean that ipv4 is disabled. does `ping ::1` wotks for you?
cn flag
Yes, ping ::1 works for me, ``ping localhost`` resolves to ::1, and ``ping [real ip v6]`` works while ``ping [host's ip v4]`` doesn't... But ping 127.0.0.1 still works. I'm OK with that, just not sure whethe I have disabled IpV4 completely...
in flag
As far s I remember the loopback adapter which handles 127.0.0.1 is not visible in the network list so you have not reconfigured it, so it still has IPVv4 enabled. And not the loopback adapter can not be removed because Windows requires localhost connection, otherwise the whole system would not be able to work properly.
Score:0
in flag

What you have done is to disable IPv4 binding on interfaces that you can see. You have not really disabled IPv4 in the system, and doing so might (for a while) not be a good idea and not supported.

As you noticed, you have a loopback interface, which is where 127.0.0.1 and ::1 is assigned. If you really want to you could try to uninstall IPv4 protocol. But be prepared for a broken system.

Some mention ::ffff:127.0.0.1 it is true that IPv4 can be represented by this IPv6 address, it is just a representation in IPv6 of IPv4, the actual protocol used here (if policy is correct) is still IPv4.

In regards to localhost that is the named representation of the IPs, which is not really relevant. Which is used depends on routing policy.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.