DHCPv6

On this page 7

DHCPv6, the Dynamic Host Configuration Protocol for IPv6, is the protocol that lets a server assign IPv6 addresses, delegate prefixes and deliver configuration options such as DNS servers to hosts and routers. In address configuration for IPv6 networks, it is the stateful alternative and complement to SLAAC, and it is specified in RFC 8415.

DHCPv6 is not simply DHCP with longer addresses. It uses different ports, multicast instead of broadcast, a new client identifier and a message set of its own, and it relies on router advertisements to tell hosts whether they should use it at all.

How DHCPv6 assigns addresses

A DHCPv6 client sends its requests from its link-local address on UDP port 546 to the multicast address ff02::1:2, which reaches all DHCPv6 servers and relay agents on the link. Servers listen on UDP port 547. No broadcast exists in IPv6, so multicast takes its place.

A full exchange has four messages: Solicit, Advertise, Request and Reply, the counterparts of the DHCPv4 discover, offer, request and acknowledge sequence. When the client includes the Rapid Commit option and the server accepts it, the exchange shortens to Solicit and Reply. Leased addresses are renewed with Renew and Rebind messages before they expire.

MessageSenderPurpose
SolicitClientLocates available servers
AdvertiseServerOffers addresses or prefixes
RequestClientAsks a chosen server for the offered leases
ReplyServerConfirms leases and delivers options
Renew and RebindClientExtends leases at T1 and T2 timers
Information-requestClientRequests options only, without addresses
Relay-forward and Relay-replyRelay agent and serverCarry messages across routed networks
Main DHCPv6 message types

Each client identifies itself with a DHCP Unique Identifier (DUID) rather than a MAC address. A DUID can be based on a link-layer address and time, a vendor number or a UUID, and it is meant to stay stable across interfaces and reboots. This is a frequent source of confusion when administrators try to create reservations based on MAC addresses.

Stateful, stateless and prefix delegation modes

DHCPv6 operates in three distinct roles, and a network can use one or several of them at once. Router advertisements decide which roles a host activates through the M and O flags and the A flag in the prefix information option.

ModeWhat the server providesTypical use
Stateful DHCPv6Addresses through IA_NA, plus optionsEnterprise LANs needing address tracking
Stateless DHCPv6Options only, addresses come from SLAACDelivering DNS servers and domain lists
Prefix delegationWhole prefixes through IA_PDISPs assigning /48 or /56 prefixes to customer routers
DHCPv6 operating modes

Prefix delegation is arguably the most important use of DHCPv6 on the internet today. A home or branch router requests a prefix from its provider, commonly a /56 or /60 for residential lines and a /48 for businesses, and then splits it into /64 subnets for its internal networks.

DHCPv6 compared with DHCP and SLAAC

The three address configuration methods overlap, but each has properties the others lack. The comparison clarifies the choices.

PropertyDHCP for IPv4SLAACDHCPv6
Address sourceServerHost derives from prefixServer
Default gatewayOption 3 from serverRouter advertisementRouter advertisement only
DNS serversServer optionRDNSS in router advertisementServer option
Central lease recordsYesNoYes
Prefix delegationNot availableNot availableAvailable
Android support for addressesYesYesNo
Address configuration methods compared

The most surprising difference for engineers coming from IPv4 is that DHCPv6 does not provide a default gateway. Hosts always learn their router from router advertisements, so a network with a DHCPv6 server but no advertisements leaves hosts with addresses and no way off the link. Another practical limit is that Android devices do not implement stateful DHCPv6 addressing, so networks serving mobile devices must offer SLAAC as well.

Deploying DHCPv6 across routed networks

In larger networks a central DHCPv6 server serves many subnets through relay agents on each router. The relay wraps the client message in a Relay-forward message, records the link address that identifies the subnet, and can add the interface-id and remote-id options so the server can apply per-port policy.

Because the client’s link-layer address is not visible in relayed traffic, RFC 6939 defines a client link-layer address option that relays insert. Server platforms that need MAC-based reservations or audit trails depend on this option being enabled on the relay.

Lease timing follows the same logic as in IPv4 but uses two lifetimes per address. The preferred lifetime marks when a host should stop using the address for new connections, and the valid lifetime marks when it must be removed. The T1 timer, commonly half of the preferred lifetime, triggers a Renew to the original server, while T2, commonly 80 percent, triggers a Rebind to any server. Redundant servers therefore need consistent address pools or a failover arrangement, because DHCPv6 has no standardized server-to-server failover protocol.

Typical DHCPv6 problems

Most DHCPv6 failures come from mismatches between router advertisements and server configuration, not from the server itself. The table lists the common cases.

SymptomLikely causeRemedy
Hosts never contact the serverM and O flags not set in advertisementsSet the flags on the router interface
Addresses but no internet accessNo router advertisements on the linkEnable advertisements with a router lifetime
Reservation does not match the hostDUID changed after reinstall or cloningReserve by DUID or use the link-layer option
Two addresses per hostBoth SLAAC and stateful mode activeClear the A flag if only DHCPv6 is wanted
Rogue configurationUnauthorized server on the linkEnable DHCPv6 Guard on access switches
Symptoms, causes and remedies

The simple explanation

Every device on an IPv6 network needs an address and a few settings. DHCPv6 is like a front desk that hands out room numbers. It also keeps a register of who received which one.

IPv6 also lets devices pick their own address. So the network first tells each device whether to ask the front desk or work it out alone. Home routers mostly use DHCPv6 to receive a whole block of addresses from the internet provider. They then share it among the rooms of the house.

How it is used in practice

A university network team must be able to trace every IPv6 address back to a device for security investigations. The team enables stateful DHCPv6 on student and staff networks, sets the M flag in router advertisements, and clears the A flag so that hosts do not build additional SLAAC addresses that would bypass the lease records.

Routers relay requests to two central servers and insert the client link-layer address option, so leases can be matched with switch port data. Phones on the separate wireless guest network keep SLAAC with RDNSS, because Android would otherwise receive no IPv6 address. The result is a complete, searchable address history for managed devices and working IPv6 for every guest.