IPv6 SLAAC (Stateless Address Autoconfiguration) Explained
SLAAC allows IPv6 devices to configure their own IP addresses without a DHCPv6 server. Devices learn the network prefix from local routers via ICMPv6 Router Advertisements and generate their own Interface ID.
The Power of Stateless Configuration
**Stateless Address Autoconfiguration (SLAAC)** is a core feature of IPv6 that allows devices to obtain an IP address without needing a central server, like DHCP. It is "stateless" because no server maintains a database of assigned addresses. This makes IPv6 networks highly scalable and plug-and-play.
RS and RA Messages
SLAAC relies on ICMPv6 messages within the Neighbor Discovery Protocol (NDP): - **Router Solicitation (RS):** When a device boots up, it sends an RS message to the all-routers multicast group (`ff02::2`) asking, "Are there any routers here? What is the network prefix?" - **Router Advertisement (RA):** Routers periodically (or in response to an RS) send RA messages to the all-nodes multicast group (`ff02::1`). The RA contains the `/64` network prefix and default gateway information.
Generating the Interface ID
Once the host receives the RA containing the `/64` network prefix, it must generate its own 64-bit Interface ID to complete the 128-bit address. It does this using one of two methods: 1. **EUI-64:** Deriving the ID from its MAC address. 2. **Randomly Generated:** Modern operating systems (like Windows and macOS) typically generate a random Interface ID for privacy reasons, preventing tracking across different networks.
❓ Frequently Asked Questions
Does SLAAC require a DHCP server?
No, SLAAC is completely stateless and allows devices to configure themselves using information provided by local routers, without a DHCP server.
What ICMPv6 messages does SLAAC use?
SLAAC uses Router Solicitation (RS) and Router Advertisement (RA) messages.
How does a host get its default gateway in SLAAC?
The host uses the Link-Local Address (LLA) of the router that sent the Router Advertisement (RA) as its default gateway.