This is all done by the IPv6 stack itself and the IPv6 autoconfig mechanism.
This is the link-local address:
Quote:
Originally Posted by wh33t
Code:
inet6 fe80::a411:74ff:fe98:7eb9 prefixlen 64 scopeid 0x20<link>
|
All IPv6 addresses starting with "fe80::" are link-local addresses, and these are assigned automatically when IPv6 is enabled. Note the "scopeid 0x20<link>" part at the end.
All interfaces participating in an IPv6 network
must have a link-local address, as it's used by a number of core IPv6 services, like Neighbor Discovery and routing. It's auto-generated, either from the interface's MAC address, or if privacy extensions are enabled, by an algorithm ensuring the address will be unique.
Then there's the automatically generated
global routable address:
Quote:
Originally Posted by wh33t
Code:
inet6 2604:3d08:1a7f:d170:a411:74ff:fe98:7eb9 prefixlen 64 scopeid 0x0<global>
|
Starting with 2604, this falls within the 2000::/3 scope (2000-3fff), and as such it's a public, routable address.
Note how the last 16 digits (the "host" part) are identical to those of the link-local address. This tells you that the IPv6 autoconfig mechanism is active and has detected a router on the network. IPv6 routers advertise their presence on the network using the Router Advertisement mechanism of the Neighbor Discovery protocol (part of ICMPv6), allowing clients to determine the IPv6 prefix of the local network. Using this information, the autoconfig mechanism has generated the host part of the address and assigned it to the interface.
Then there's the second, global address:
Quote:
Originally Posted by wh33t
Code:
inet6 2604:3d08:1a7f:d170::ade1 prefixlen 128 scopeid 0x0<global>
|
As you can see, the address belongs to the same network (2604:3d08:1a7f:d170::/64) as the IPv6 address just discussed, and the source of this address is probably a DHCPv6 service running on the router. The "/128" prefix is the giveaway here; the address supplied by DHCPv6 lacks a scope identifier, so the host is supposed to obtain this via the Router Advertisement messages sent by the router.
As for how and why this happens: Unlike with IPv4, where your ISP assigns a single, global IPv4 address to your router which masks your entire LAN behind it using private IPv4 addresses, with IPv6 you're actually supposed to use routable addresses everywhere. Since the addresses technically belong to your ISP, they need to tell your router which addresses to use on its LAN interface as well as the WAN side.
This is done using a mechanism called "Prefix Delegation" (PD): When the router asks for an IPv6 address for its WAN interface via DHCPv6, it also receives a PD parameter telling it which IPv6 prefix the ISP will now be routing to the WAN interface. A router with IPv6 support will then automatically configure its LAN interface as well, start sending out Router Solicitation (RA) messages periodically, and possibly also configure and start a DHCPv6 service to assign addresses within this prefix to hosts on the LAN.
It seems your router and/or your computer uses both autoconfiguration/RA and DHCPv6. As a result, you end up with at least two globally routable addresses. This is normal and is unlikely to cause any issues.
Finally, there's the third, global IPv6 address:
Quote:
Originally Posted by wh33t
Code:
inet6 2604:3d08:1a7f:d170:6a82:8160:8551:75f3 prefixlen 64 scopeid 0x0<global>
|
This is yet another globally routable IPv6 address in the same network/prefix (2604:3d08:1a7f:d170::/64), but with a radically different (and seemingly random) host part. You'd expect to see this on a computer where either Privacy Extensions are enabled or a DHCPv6 client is running, as both mechanisms will typically replace the assigned address periodically. In both cases, the "old" address will remain as long as there are active processes using it.