DHCPv6 vs SLAAC: What is the Difference?
Learn the difference between DHCPv6 and SLAAC for IPv6 address assignment, the M/O flags, and when to combine both.
Expected Interview Answer
SLAAC (Stateless Address Autoconfiguration) lets an IPv6 host build its own address from a router-advertised prefix plus its interface identifier without any server tracking who has what, while DHCPv6 is a stateful client-server protocol where a server actively leases and records addresses, similar to DHCP for IPv4.
With SLAAC, a router periodically sends Router Advertisement messages containing an on-link prefix (e.g., 2001:db8:1::/64); each host combines that prefix with a locally generated interface identifier to form its own global address, then verifies uniqueness with Duplicate Address Detection. No central server keeps a lease table, so SLAAC scales effortlessly but cannot hand out DNS servers or other options in its original form and offers weak auditability. DHCPv6, in contrast, has a server that maintains state: it assigns (and can reclaim) specific addresses, hands out DNS servers, domain search lists, and other options, and gives administrators a lease log to audit which client held which address and when. Real networks frequently combine both: SLAAC for the address itself via Router Advertisements, and "stateless DHCPv6" purely for options like DNS, or full stateful DHCPv6 when tight address control is required โ the choice is signalled by the M (Managed) and O (Other config) flags in the Router Advertisement.
- SLAAC needs no server and configures addresses automatically from RA prefixes
- DHCPv6 gives centralized control, leasing, and auditability of address assignment
- DHCPv6 (stateless or stateful) can distribute DNS and other options
- M/O flags in Router Advertisements let a network mix both approaches
AI Mentor Explanation
SLAAC is like a club handing every new player a numbered training kit range and letting each player pick their own kit number within it, checking only that no two players clash โ nobody at the front desk tracks who took which number. DHCPv6 is like a kit manager who personally issues each player a specific kit number from a signed-out ledger, records the issue date, and can reclaim it when the player leaves. Both get players a valid kit number, but only the ledger approach gives the club an auditable record. A league that wants strict accountability chooses the ledger; one that just wants players moving fast chooses the open range.
Step-by-Step Explanation
Step 1
Router Advertisement
A router sends periodic or solicited RAs containing an on-link prefix and M/O flags.
Step 2
SLAAC path
If M is unset, the host derives its own address from the prefix plus an interface identifier and runs Duplicate Address Detection.
Step 3
DHCPv6 path
If M is set, the host contacts a DHCPv6 server (Solicit/Advertise/Request/Reply) which leases a specific address and records it.
Step 4
Options overlay
Even with SLAAC, the O flag can trigger stateless DHCPv6 purely for DNS servers and other options.
What Interviewer Expects
- Explains SLAAC is stateless (no server tracking) vs DHCPv6 stateful leasing
- Knows the role of Router Advertisements and the M/O flags
- Understands DHCPv6 provides auditability and centralized options
- Aware that stateless DHCPv6 and SLAAC are often combined, not exclusive
Common Mistakes
- Assuming SLAAC and DHCPv6 are mutually exclusive on every network
- Confusing SLAAC with DHCPv4 lease behavior
- Not knowing Duplicate Address Detection is part of SLAAC
- Forgetting the M/O flags in the Router Advertisement drive the choice
Best Answer (HR Friendly)
โSLAAC is IPv6's self-service way of getting an address โ a router announces a prefix and your device builds its own address from it with no server keeping track. DHCPv6 is the more traditional approach, where a server hands out and records specific addresses, similar to how DHCP works for IPv4. Networks often use both together, letting devices self-configure their address while still getting DNS settings from a DHCPv6 server.โ
Code Example
# Show IPv6 addresses and their assignment method on Linux
ip -6 addr show
# Example output distinguishing SLAAC (mngtmpaddr absent) vs DHCPv6:
# inet6 2001:db8:1::a1b2:c3d4:e5f6:7788/64 scope global temporary dynamic
# inet6 2001:db8:1::1000/128 scope global dynamic (DHCPv6-leased)
# Inspect the Router Advertisement flags received on an interface
sudo rdisc6 eth0
# Flags: M and O bits show whether DHCPv6 is Managed or only supplies Other configFollow-up Questions
- What do the M and O flags in a Router Advertisement control?
- How does Duplicate Address Detection work in SLAAC?
- When would a network require stateful DHCPv6 over plain SLAAC?
- How does privacy extension (temporary addressing) interact with SLAAC?
MCQ Practice
1. Which mechanism lets an IPv6 host build its own address without a server tracking leases?
SLAAC is stateless โ the host derives its address from a router-advertised prefix with no lease server.
2. What signals a host to use DHCPv6 for full address assignment?
The M flag in the Router Advertisement tells hosts to use stateful DHCPv6 for address assignment.
3. What is a key advantage of DHCPv6 over SLAAC?
DHCPv6 maintains server-side state, giving administrators a lease record and centralized control.
Flash Cards
SLAAC in one line? โ Stateless IPv6 address autoconfiguration derived from a Router Advertisement prefix.
DHCPv6 in one line? โ Stateful client-server protocol that leases and tracks specific IPv6 addresses.
What flags decide the mode? โ The M (Managed) and O (Other config) flags in the Router Advertisement.
Can both be used together? โ Yes โ SLAAC for the address, stateless DHCPv6 for DNS and other options.