Why do I have 2 IPv6 addresses?
If I go to System Preferences > Network > Advanced
it is shown that I have 2 different IPv6 addresses (both with a 64-bit prefix). Why is so?
If I type ifconfig | grep inet
on the terminal, it also shows me those 2 IPv6 addresses (among the other addresses). At the end of one of those 2 IPv6 addresses there's the word dynamic
and at the end of the other there's autoconf temporary
. Why wonder why should we need two IPv6 addresses and what is the different between dynamic
and autoconf temporary
.
Solution 1:
IPv6 used to be derived of the MAC address of your device. This is the Modified EUI-64 format. Such addresses are recognisable by looking at the middle of the last 64 bits. If they contain ..ff:fe..
then it is probably a EUI-64 based address.
Because the algorithm produces the same 64 bits every time some people were afraid that it would become easy to track mobile devices such as laptops and smart phones. Every network would have a different prefix, but the last 64 bits would always be the same.
That is why Privacy Extensions were invented. A device generates new 64 bits every once in a while and uses that in the IPv6 address. Because new addresses are generated regularly the addresses are marked as temporary
. A device can have multiple privacy extension addresses if the system is still using an old address when a new address is being generated. The system will keep the old address for as long as necessary. For new outgoing connections a system will usually use the most recently generated temporary address to maintain a maximum level of privacy.
Solution 2:
There appear to be four different types of IPv6 addresses:
- Main address, using your ISP prefix + derivation of your network-interface MAC-address.
- Temporary addresses, based on your main address but with randomization to prevent tracking. (a new one is generated every so often)
-
Link-local address, identified by starting with
fe80:
. (not usable globally, tied to routing) -
Unique local address, identified by starting with
fd00:
. (not usable globally, not tied to routing)
In my case, I just enabled IPv6 on my home network, and found I have one of each of these these four types of addresses for my Windows computer. (showing up when I run ipconfig
)
I wasn't confused by the Temporary address and the Link-Local address since they were marked as such, but I was confused at first by the second address that was labeled the same way as my main. I noticed it was shorter though and started with fd00
, and after Googling that, found that it's the Unique Local Address for my device.