When a laptop joins an IPv6 LAN without DHCPv6, how does SLAAC give it a global address and a default router?
answer
- link-local first, always
- prove uniqueness before use
- ask the routers instead of waiting
- prefix from the router, identifier from the host
- lifetimes keep it alive
basics
~20 sUnder SLAAC (RFC 4862) the laptop forms a link-local address, proves it unique with duplicate address detection, solicits a Router Advertisement, then combines the advertised prefix with its own interface identifier; the advertising router becomes its default router.
solid answer
~50 s**SLAAC** (RFC 4862) needs no server, only routers sending **Router Advertisements**. The laptop first builds a **link-local address**, `fe80::` plus a 64-bit interface identifier, and runs **duplicate address detection**: a Neighbor Solicitation from the unspecified address `::` to the tentative address's solicited-node group; with the defaults, a second of silence means it is unique. It then sends a **Router Solicitation** (ICMPv6 type 133) to all-routers `ff02::2` instead of waiting for the next periodic advertisement. The **Router Advertisement** (type 134) arrives from the router's link-local address; a non-zero Router Lifetime makes that router a default router, and a **Prefix Information option** such as `2001:db8:42:1::/64` with the A flag set lets the laptop append its identifier, check that address with DAD too, and use it until its preferred and valid lifetimes run out — lifetimes that later advertisements refresh.
go deeper
Recall the order: link-local address, duplicate address detection, Router Solicitation, Router Advertisement, then a global address built from the advertised prefix.
Explain each message's source, destination and purpose, why DAD uses the unspecified source and the solicited-node group, and what Router Lifetime and the A flag decide.
Show you can reason from lifetimes and RA contents when hosts lose addresses or gateways: deprecated versus invalid, the two-hour rule, and why RAs are needed even with DHCPv6.
Weigh SLAAC's stateless scale against losing a per-host address record for audit and access control, and decide where DHCPv6 or address logging must fill that gap.
## What SLAAC is **Stateless Address Autoconfiguration (SLAAC)**, RFC 4862, lets an IPv6 host configure its own addresses from what routers advertise. "Stateless" means no server keeps a record of which host holds which address: the router announces a prefix, and each host supplies the remaining bits itself. It is built on the Neighbor Discovery messages of RFC 4861, which travel as ICMPv6: - **Router Solicitation (RS)**, type 133, from host to routers. - **Router Advertisement (RA)**, type 134, from router to hosts. - **Neighbor Solicitation / Advertisement (NS / NA)**, types 135 and 136, used here for duplicate address detection. ## Step by step: a laptop on 2001:db8:42:1::/64 1. **Interface identifier.** The laptop picks a 64-bit interface identifier (IID). Current guidance (RFC 8064) is a stable hashed value per RFC 7217 rather than one derived from the MAC address; on Ethernet it is 64 bits either way. 2. **Link-local address.** It prepends `fe80::/64`, giving something like `fe80::5c3a:91ff:e2b0:7d14`. The address is **tentative**: the laptop may not use it as a source yet. 3. **Duplicate address detection (DAD).** The laptop joins the all-nodes group and the tentative address's solicited-node group, waits a random 0–1 s, and sends a Neighbor Solicitation whose source is the **unspecified address `::`**, whose destination is that solicited-node group and whose target is the tentative address. With the defaults (one transmission, `RetransTimer` 1,000 ms), a second of silence lets the address be assigned. 4. **Router Solicitation.** Rather than wait for the next periodic RA (RFC 4861's default maximum interval between unsolicited RAs is 600 s), the laptop sends an RS to all-routers `ff02::2`, up to 3 times, 4 s apart. 5. **Router Advertisement.** The router answers from its link-local address, say `fe80::1`, with Hop Limit 255, either to all-nodes `ff02::1` or unicast to the laptop. 6. **Default router.** A non-zero **Router Lifetime** puts `fe80::1` on the laptop's default router list. A link-local default gateway is normal in IPv6. 7. **Global address.** For each Prefix Information option with the **A** flag set and a /64 prefix, the laptop appends an IID: `2001:db8:42:1::/64` becomes, for example, `2001:db8:42:1:5c3a:91ff:e2b0:7d14`. That address goes through DAD before it is used. Many hosts also add a short-lived **temporary address** (RFC 8981) for outgoing connections. If no RA arrives after its solicitations, the host concludes the link has no routers: it keeps its link-local address but has no SLAAC global address and no default router. ## What the Router Advertisement carries | Field or option | Effect on the laptop | |---|---| | Router Lifetime | non-zero: use this router as a default; 0: not a default router | | M and O flags | whether DHCPv6 offers addresses (M) or other settings (O) | | Cur Hop Limit | default hop limit for outgoing packets (0 = unspecified) | | Prefix Information option | the prefix, its L (on-link) and A (autonomous) flags, valid and preferred lifetimes | | Source Link-Layer Address option | the router's MAC, so no separate resolution is needed | | MTU option | the link MTU all hosts should use | | RDNSS option (RFC 8106) | recursive DNS server addresses, so name resolution works without DHCPv6 | ## Lifetimes: preferred, deprecated, gone - While the **preferred lifetime** runs, the address is used freely for new connections. - Once it lapses, the address is **deprecated**: existing connections continue, new ones should use another address. - When the **valid lifetime** lapses, the address is removed. - Each periodic RA resets the lifetimes. To stop one forged RA from expiring addresses, RFC 4862 will not cut a remaining valid lifetime below **two hours** unless the advertisement is authenticated. - A link-local address has an infinite lifetime and never times out. ## Duplicate address detection in detail - DAD is required for every unicast address — SLAAC, DHCPv6 or manual — unless a host is configured to skip it; it is never run on anycast addresses. - The source is `::` because a tentative address may not be used yet; a node that already holds the address answers with an NA to **all-nodes**, since it cannot unicast to `::`. - If another node's NS for the same target arrives first, both are trying the same address, and neither should use it. - A duplicate is never assigned. If a MAC-derived link-local address collides, RFC 4862 says IP on that interface SHOULD be disabled, since duplicate hardware addresses are the likely cause; an RFC 7217 host instead increments its DAD counter and tries a new identifier. - **Optimistic DAD** (RFC 4429) lets a host use an address while the check runs, under restrictions, trading a small risk for a faster join. ## What SLAAC does not do SLAAC keeps no per-host record, so nothing central knows which device holds which address — good for scale, awkward for audit. It cannot deliver arbitrary settings: DNS servers can arrive in the RA through RDNSS, and anything richer comes from DHCPv6, which the RA's M and O flags point to. Conversely, DHCPv6 cannot supply a default router: RFC 4862 notes that the only automatic way to learn one is the Router Advertisement, so even a network that hands out every address by DHCPv6 still runs RAs.
- Why is the IPv6 duplicate-address-detection probe sent from the unspecified address rather than from the tentative address?Until DAD succeeds the tentative address is not assigned, and using it as a source could make other nodes cache it, overwriting the rightful owner's neighbour entry. With source `::`, a node already holding the address cannot unicast back, so RFC 4861 has it multicast its Neighbor Advertisement to all-nodes, which the prober has joined.
- What happens if a laptop's IPv6 Router Solicitations get no answer?After its solicitations (three by default, four seconds apart) go unanswered, the host treats the link as having no routers. It keeps its link-local address and can reach neighbours on the link, but forms no SLAAC global address and has no default router. RFC 4862 notes that DHCPv6 may still offer addresses, but a forwarding node's address would then have to be configured by hand.
- Why can a forged Router Advertisement with a valid lifetime of ten seconds not knock existing SLAAC addresses off the link at once?RFC 4862 limits how far an unauthenticated advertisement can shorten an address. A received valid lifetime is accepted if it exceeds two hours or the time remaining; if two hours or less remain, the option is ignored for the valid lifetime; otherwise the remaining time is cut only to two hours. Genuine periodic RAs then restore the lifetime before it lapses.
saying these in an interview costs you the question
- SLAAC needs a DHCPv6 server to hand out the prefix.
- The duplicate-address-detection probe is sent from the address being tested.
- A link-local default gateway like fe80::1 is a misconfiguration.
- A host must wait for the next periodic Router Advertisement; it cannot ask for one.
- DHCPv6 can replace Router Advertisements, including the default route.
- A SLAAC address stays valid forever once assigned.