Localhost - meaning of fe80::1%lo0

9.4k Views Asked by At

What does "fe80::1%lo0" mean "fe80::1%lo0 localhost" the private/etc/hosts file on Mac osx

2

There are 2 best solutions below

2
On

We are considering the record "fe80::1%lo0 localhost" in the file /etc/hosts/ in OS X.

It means for the hostname "localhost" use IPv6 link-local address "fe80::1" in zone "lo0". Link-local means that this address is not routable and will be discarded by any router in the local network (at least they should).

As we are talking about OS X, the typical config of OS X "lo0" iface is:

lo0: 
    inet6 ::1 prefixlen 128
    inet 127.0.0.1 netmask 0xff000000
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1

From here we can see that the main goal of this link-local address is to support loopback network communication in a link-local address space. But there are few apps which use it.

2
On

Addresses in the fe80::/10 range are link-local addresses. The addresses are only significant to the link on which they reside, so a device with multiple interfaces may have the same address, and certainly will have the same link-local network, on all its interfaces.

That's where the % sign comes into play. That is the interface id on the device that will distinguish the interface on which the address resides. Different operating systems will have different values after the % sign.