IP

IPv6 Stateless Autoconfiguration

Automatic IPv6 address configuration without DHCPv6 address assignment.

SLAAC: Stateless IPv6 Address Autoconfiguration

In IPv4, a device can obtain an address and other parameters from DHCP, but it can also be configured manually. After joining a network, a host may send a DHCP request, and the selects an address from its pool, sends it to the host, and maintains a lease. This is a stateful process because the server stores the assignment for the device.

IPv6 lets a host create an address from a prefix advertised by a router and its own interface identifier. SLAAC does not require a DHCPv6 server to create the address; the address is checked with Duplicate Address Detection. Address creation and acquisition of other parameters are separate choices. An RA can advertise more than one prefix, so a host may create multiple addresses and retain a deprecated address while existing connections continue.

The address is created with . The term "stateless" means that the router does not keep a lease table for addresses created by hosts. The router advertises a prefix and lifetimes, while the host creates an interface identifier according to local policy.

SLAAC and the Neighbor Discovery Protocol (NDP)

SLAAC uses NDP messages carried by ICMPv6. Hosts use these messages to learn about routers and link parameters. Two messages form the basis of the SLAAC process:

  • Router Solicitation (RS): A message sent by a host after joining a link to request a response from routers.
  • Router Advertisement (RA): A message sent periodically by a router or in response to an RS. It contains network parameters, including Prefix Information options with a prefix, the A flag, and address lifetimes.

The host combines the prefix with an interface identifier to create an IPv6 address. An RA can also identify the default router and indicate how additional parameters may be obtained through DHCPv6. Prefix Information carries separate preferred and valid lifetimes: after the first expires an address is no longer preferred for new connections, while after the second it should no longer be used.

The SLAAC Process, Step by Step

The following steps describe a typical host autoconfiguration sequence from joining a link to creating a global address.

  1. Step 1: Create a link-local address.

    After an interface is enabled, a host creates a local address for communication on its immediate link. It creates this itself. The address uses the prefix fe80::/10; the remaining 64 bits of a link-local address form the interface identifier. The identifier is created according to the link method and system policy. Modified EUI-64 is one option; a system may also use a stable or randomized identifier.

  2. Step 2: Verify the link-local address (DAD).

    The host performs Duplicate Address Detection (DAD) to check whether the tentative address is already in use on the link. It sends a Neighbor Solicitation with the tentative address in the Target Address field. The source is the unspecified address (::) because the tested address has not been assigned yet. If no response is received, the address may be assigned, but this does not prove that every possible collision is absent.

  3. Step 3: Find a router (Router Solicitation).

    The host sends a Router Solicitation (RS) message to the all-routers multicast address (ff02::2) to obtain an RA without waiting for the next periodic advertisement.

  4. Step 4: Receive network information (Router Advertisement).

    A router responds with a Router Advertisement (RA). Its Prefix Information option may contain a prefix (e.g., 2001:db8:acad:1::/64), the A flag, and preferred and valid lifetimes. The RA also specifies the lifetime of the default router.

  5. Step 5: Create the global unicast address.

    The host now has the two necessary ingredients:

    • The 64-bit prefix from the RA, with the A flag set (2001:db8:acad:1).
    • Its own 64-bit interface identifier.

    The host combines these fields to create a full 128-bit Global Unicast Address (GUA).

  6. Step 6: Verify the global address (DAD).

    The host also performs DAD for the new global address. It sends another Neighbor Solicitation on the local link. If no response is received, the address may be assigned; a detected conflict prevents autoconfiguration of that address.

In the typical case, the host now has a global address and a default route specified by the RA. The RA normally uses a router's link-local address as its source, and its Router Lifetime contributes the default route. Address creation does not require a DHCPv6 server, although DHCPv6 may provide additional parameters. A host may keep a link-local address, a stable address, and temporary addresses at the same time, each with its own lifetime and source-selection preference.

Modified EUI-64 Format

One method for generating a 64-bit interface identifier is the Modified EUI-64 format. The algorithm inserts FFFE into a 48-bit MAC identifier and inverts the Universal/Local bit. The method exposes a stable part of the identifier, so current systems often choose other methods.

Example: converting a MAC address

Assume a device has the MAC address 00:1B:77:54:12:34.

  1. Step 1: Split the MAC address in half.

    The 48-bit (6-byte) MAC address is split into two 24-bit (3-byte) halves.

    00:1B:77 and 54:12:34

  2. Step 2: Insert the 'FFFE' hextet.

    The 16-bit value FFFE (in hexadecimal) is inserted directly between the two halves. This expands the address to 64 bits.

    00:1B:77:FF:FE:54:12:34

  3. Step 3: Invert the U/L bit (bit 7).

    This is the modified part of EUI-64. Invert the U/L bit in the first byte, which is bit 7 from the left (bit 1 when counted from the least-significant bit). This bit is the . For the first byte 00, the inversion changes the value to 02.

    • The first byte is 00 in hex, which is 00000000 in binary.
    • Counting from the left, the bits are numbered 1 through 8; we invert bit 7. 00000000
    • Inverting bit 7 from 0 to 1 gives: 00000010.
    • In hexadecimal, 00000010 is 02.
  4. Step 4: The final interface ID.

    The result is the final 64-bit interface identifier.

    021B:77FF:FE54:1234

    For the network prefix 2001:db8:acad:1::/64, the full global address is 2001:db8:acad:1:21b:77ff:fe54:1234.

DNS and DHCPv6

SLAAC creates an address from a prefix in the RA, and the RA can identify a default router. Basic address autoconfiguration does not necessarily provide DNS server addresses. They may be advertised with the RDNSS option in an RA, obtained through DHCPv6, or configured manually.

DHCP for IPv6 (DHCPv6) can provide these additional parameters. An RA contains the M and O flags, while the A flag is in the Prefix Information option. Their values indicate whether the host should use SLAAC and DHCPv6. When M is set, O is redundant because DHCPv6 can return all available configuration information.

  • A Flag (Autonomous Address-Configuration Flag): If set to 1 in a Prefix Information option, it indicates that the prefix can be used for SLAAC.
  • M Flag (Managed Address Configuration Flag): If set to 1, it indicates that DHCPv6 should be used to obtain addresses. This mode is called stateful DHCPv6.
  • O Flag (Other Configuration Flag): If set to 1 while M is 0, it indicates that DHCPv6 should be used for additional parameters, such as DNS server addresses. When M is set, O is redundant.
A FlagM FlagO FlagResulting Host Action
100SLAAC. The host creates an address from the RA prefix and obtains a default route from the RA. DNS may come from RDNSS, manual configuration, or another protocol.
101SLAAC + Stateless DHCPv6. The host uses SLAAC to create an address and DHCPv6 for additional parameters, such as DNS server addresses.
011Stateful DHCPv6. With M=1, the host obtains addresses and available parameters through DHCPv6, while O is redundant. The default router still comes from the RA.

Privacy: EUI-64 and Temporary Identifiers

An EUI-64 identifier derived from a MAC address can remain stable across networks. This makes it easier to correlate interface addresses, for example when a laptop connects in turn to a home network, a coffee shop, and an airport.

IPv6 Privacy Extensions (RFC 4941, superseded by RFC 8981) define temporary identifiers that reduce this correlation. Operating systems including Windows, macOS, Android, and iOS may enable the feature according to their configuration.

Instead of a static EUI-64 identifier, a device may generate a temporary, randomized 64-bit identifier for a global address. Such an address is preferred for outgoing connections, including web browsing, and is regenerated according to its lifetimes. This reduces the ability to correlate activity across networks. A stable address may remain available for incoming connections, depending on system policy.

Related articles