DHCPv6, the Dynamic Host Configuration Protocol for IPv6, is surprisingly more about managing state than just handing out addresses.

Let’s watch it in action. Imagine a new client machine booting up on an IPv6 network. It doesn’t know anything about its network configuration.

# On the client side, after boot, we might see these packets (simplified)

# Client sends a Solicit message to the all-DHCP-agents multicast address (ff02::1:2)
# "Anyone out there giving out IPv6 config?"

# A DHCPv6 server on the network responds with an Advertise message.
# "I'm here, and I can offer you config."

# The client then sends a Request message to the specific server that advertised.
# "Okay, I'd like the config you advertised."

# Finally, the server sends a Reply message with the actual configuration.
# "Here's your IPv6 address, DNS server, domain name, etc."

This process, often called "stateful" DHCPv6, is analogous to DHCP for IPv4. The server keeps track of which client has which address, ensuring no duplicates and providing a central point of control. But this isn’t the whole story.

The real magic, and where DHCPv6 often surprises people, is its ability to work alongside Stateless Address Autoconfiguration (SLAAC). SLAAC uses router advertisements (RAs) to tell clients about the network prefix, allowing them to generate their own IPv6 addresses. This is great for basic connectivity, but it doesn’t tell clients where to find DNS servers or other crucial network services.

This is where DHCPv6 shines, even in its "stateless" mode.

In stateless DHCPv6, the client already has an IPv6 address (usually from SLAAC), but it still needs configuration options like DNS server addresses. The DHCPv6 client sends a INFORMATION-REQUEST message to the DHCPv6 server. The server, without needing to track address assignments, simply replies with the requested options.

# Client sends INFORMATION-REQUEST to the all-DHCP-agents multicast address (ff02::1:2)
# "I have an address, but can you tell me about DNS?"

# DHCPv6 server responds with a REPLY containing DNS server info, domain name, etc.
# "Here are your DNS servers: 2001:db8:abcd:1234::1 and 2001:db8:abcd:1234::2"

This dual-mode operation is key. A router can advertise a network prefix for SLAAC, and simultaneously signal to clients (via flags in the Router Advertisement itself) that they should also use DHCPv6 for other configuration options. The M flag (Managed address configuration) in the RA tells clients to use stateful DHCPv6 for addresses and other options. The O flag (Other configuration) tells clients to use stateless DHCPv6 for options only.

The fundamental problem DHCPv6 solves is providing robust and flexible network configuration for IPv6 hosts in a way that can scale and integrate with existing IPv6 autoconfiguration mechanisms. It allows administrators to manage address pools centrally (stateful) or simply distribute critical network parameters like DNS information (stateless) without the overhead of tracking every single IP address assignment.

The one thing most people don’t realize about DHCPv6 is its reliance on the Router Advertisement (RA) flags to dictate its behavior. Without the correct M and O flags being set on the router’s RA messages, the DHCPv6 client on the host might not even attempt to contact a DHCPv6 server, or it might try to get an address when it’s only supposed to get options (or vice-versa). It’s not just about having a DHCPv6 server running; it’s about the router telling the clients how to use it.

Understanding these RA flags and how they interact with DHCPv6 modes is crucial for troubleshooting and designing scalable IPv6 networks.

Want structured learning?

Take the full Computer Networking course →