What is a link-local address used for, and why does every IPv6 interface have one?
Show the answer
Say this first
A link-local address (fe80::/10) works only on its own link and is never routed. Every IPv6 interface
creates one as soon as IPv6 is enabled, because the protocol depends on it: NDP messages, router
advertisements, the host's default gateway, and routing protocol neighbors and next hops all use
link-local addresses. It lets a device talk on the link before it has, or even without, a global address.
Go deeper
What uses link-local
- NDP: RS, RA, NS, NA and redirects are sourced from link-local addresses.
- Default gateway: a host's default route points at the router's link-local address, learned from the RA.
- Routing protocols: OSPFv3, EIGRP for IPv6 and RIPng form neighbors over link-local and install link-local next hops. BGP can too, though it usually peers on global addresses.
- DHCPv6: clients send from their link-local address.
Why next hops are link-local
The link-local stays the same when the global prefix is renumbered, so the routing table does not churn.
The zone ID
Every interface has an fe80:: address, so the destination alone does not say which link to use. Hosts need
a zone: fe80::1%eth0 on Linux, fe80::1%12 on Windows. Routers need an exit interface for the same reason.
On Cisco
interface GigabitEthernet0/0/0
ipv6 enable ! link-local only, built with EUI-64
ipv6 address fe80::1 link-local ! or set an easy one by handSetting fe80::1 on every router interface is common. It is unique per link, which is all it needs to be.
They will ask next
Can two routers on the same link both use fe80::1?
No. DAD catches the duplicate and the second one is marked duplicate. On different links it is fine, and that is exactly how many networks use it.
Do you need a global address on a router-to-router link?
Not for routing, the IGP works over link-local alone. Most people still add one (a /127) so that traceroute shows a reachable address and the link can be pinged and monitored from afar.
Traps
- Forgetting the zone ID when pinging a link-local address from a host with several interfaces.
- Thinking link-local addresses need DHCP or SLAAC. The host builds them itself.