Explain SLAAC step by step.
Show the answer
Say this first
Stateless address autoconfiguration (RFC 4862) lets a host build its own global address with no server. It creates a link-local address and runs DAD, sends a Router Solicitation, and gets a Router Advertisement with one or more /64 prefixes marked autonomous (A flag). It appends its own 64-bit interface ID, runs DAD again, and uses the router's link-local address from the RA as its default gateway. The router never knows which addresses the hosts picked.
Go deeper
The sequence
- Interface comes up. The host builds
fe80::plus an interface ID and runs DAD. - Host sends an RS from its link-local address to
ff02::2, instead of waiting for the next periodic RA. - Router answers with an RA. It contains:
- flags M and O (whether to use DHCPv6)
- router lifetime (non-zero means "use me as a default router")
- Prefix Information Options: prefix, L (on-link) flag, A (autonomous) flag, valid and preferred lifetimes
- optionally MTU and RDNSS (DNS servers)
- For each /64 prefix with A=1, the host appends an interface ID: EUI-64, a stable opaque ID (RFC 7217) or a random one, plus temporary addresses if privacy extensions are on.
- DAD for each new address.
- Default route via the RA's source link-local address.
Lifetimes
- Preferred lifetime: while it runs, the address is used for new connections. After it, the address is deprecated, still valid for existing sessions.
- Valid lifetime: after it the address is removed.
- IOS defaults: valid 2,592,000 s (30 days), preferred 604,800 s (7 days). RAs every 200 s, router lifetime 1800 s.
Router side on Cisco
ipv6 unicast-routing
interface GigabitEthernet0/0/0
ipv6 address 2001:db8:acad:10::1/64That is enough. With ipv6 unicast-routing on, the interface sends RAs for its /64 with A=1.
They will ask next
Where does a SLAAC-only host get DNS servers?
From the RDNSS option in the RA (RFC 8106), if the router sends it. Otherwise from stateless DHCPv6 (O flag), or from IPv4 DNS on a dual-stack network.
What happens if the prefix in the RA is a /56 with A=1?
Hosts ignore it for SLAAC, because the prefix plus a 64-bit interface ID must make 128 bits. No address is formed from it.
Traps
- Saying the router hands out the address. The host picks it.
- Forgetting that SLAAC needs
ipv6 unicast-routingon IOS, or the router never sends RAs.