The Dynamic Host Configuration Protocol version 6 (DHCPv6) is a network protocol for configuring Internet Protocol version 6 (IPv6) hosts with IP addresses, IP prefixes, and other configuration data required to operate in an IPv6 network. It is not just the IPv6 equivalent of the Dynamic Host Configuration Protocol for IPv4.

IPv6 hosts may automatically generate IP addresses internally using stateless address autoconfiguration (SLAAC), or they may be assigned configuration data with DHCPv6, or both.

DHCPv6 and SLAAC are complementary services. Unlike the Neighbor Discovery Protocol (NDP) used by SLAAC, DHCPv6 can not only assign single unicast addresses, but also entire prefixes in prefix delegation. For example, an ISP's router can provide a prefix to a customer's router via DHCPv6 so that the customer's router can assign addresses to the customer's many devices via either DHCPv6 or SLAAC. This allows routers for residential networks to be configured with no operator intervention.

DHCPv6 also allows the distribution of information other than what SLAAC/NDP provides on a given network: this works even without DHCPv6 managing the distribution of network addresses. The standard method for a SLAAC/NDP network to hand out Domain Name System (DNS) server settings is via setting a flag in the Router Advertisement (RA) message telling the clients to ask for such settings over DHCPv6, although this specific use case is being replaced via a nonstandard extension of the RA message. Still, there remains a plethora of DHCPv6 options for providing additional information not handled by SLAAC/NDP, much like the wide range of information conveyed by legacy DHCP options.

Finally, DHCPv6 also offers a stateful approach, which provides more control than SLAAC's stateless approach.

Operation

Multicast addresses in DHCPv6 DHCPv6 uses IPv6 multicast addresses to enable communication between clients, relay agents, and servers when unicast addresses are not yet known. RFC 9915 defines two well-known multicast groups for this purpose.

Defined multicast addresses Multicast addressNameScopeUsed byPurposeAll_DHCP_Relay_Agents_and_ServersLink-localClientsDiscover on-link DHCPv6 servers and relay agentsAll_DHCP_ServersSite-localRelay agentsForward client messages to all DHCPv6 servers within a site All DHCPv6 servers and relay agents must join the appropriate multicast groups on relevant interfaces.

Notes

Link-local multicast traffic () is never forwarded beyond the local link. Site-local multicast () requires the relay agent to have an address with sufficient scope to reach servers within the site. Multicast support is mandatory for correct DHCPv6 operation.

Port numbers Clients listen for DHCP messages on UDP port 546. Servers and relay agents listen for DHCP messages on UDP port 547.

Identifiers DHCP unique identifier The DHCP unique identifier (DUID) is used by a client to get an IP address from a DHCPv6 server. It has a 2-byte DUID type field, and a variable-length identifier field up to 128 bytes. Its actual length depends on its type. The server compares the DUID with its database and delivers configuration data (address, lease times, DNS servers, etc.) to the client.

Four DUID types are identified: TypeNameDescription1DUID-LLTlink-layer address plus time2DUID-ENVendor-assigned identifier based on Enterprise Number3DUID-LLlink-layer address4DUID-UUIDUniversally Unique Identifier (UUID)

RFC 6939: Client Link-Layer Address Option Due to the fact that it is difficult to manage multiple identifiers in a dual-stack environment, and the fact that DUIDs are simply not optimal for some situations, RFC 6939 was released, giving a way to identify a host based on its MAC address. It defines a way for a DHCPv6 relay to pass that information to a DHCPv6 server.

Example

In this example, without rapid-commit present, the server's link-local address is and the client's link-local address is . Client sends a solicit from []:546 to multicast address []:547. Server replies with an advertise from []:547 to []:546. Client replies with a request from []:546 to []:547. Server finishes with a reply from []:547 to []:546.

Client/Server Message Formats DHCP messages utilize a fixed-format header followed by a variable-format options area.

Message Structure Overview All values in the message header and options are encoded in network byte order.

Message Types

This table lists the DHCPv6 message types.

+ CodeNameDescription RFC1SOLICITClient initiates to locate available servers.RFC 84152ADVERTISEServer indicates availability in response to Solicit.RFC 84153REQUESTClient requests parameters/addresses from a specific server.RFC 84154CONFIRMClient verifies if assigned addresses remain valid for the link.RFC 84155RENEWClient requests lease extension from the original server.RFC 84156REBINDClient requests lease extension from any available server after a RENEW fails.RFC 84157REPLYServer provides leases, parameters, or acknowledgments in response to client messages.RFC 84158RELEASEClient notifies the issuing server that it is relinquishing one or more leases.RFC 84159DECLINEClient notifies server that assigned addresses are already in use on the link.RFC 841510RECONFIGUREServer prompts client to initiate a transaction to receive updated parameters.RFC 841511INFORMATION-REQUESTClient requests configuration parameters without lease assignments.RFC 841512RELAY-FORWRelay agent forwards a message to a server. The original message is encapsulated within an option.RFC 841513RELAY-REPLServer sends a response to a relay agent. The response for the client is encapsulated within an option for the relay to extract.RFC 841514LEASEQUERYA requestor queries a server to retrieve information regarding a client's lease state. The query scope is defined by the OPTION_LQ_QUERY.RFC 500715LEASEQUERY-REPLYThe server responds to a LEASEQUERY with the requested client lease data or status.RFC 500716LEASEQUERY-DONESignals the termination of a leasequery response stream.RFC 546017LEASEQUERY-DATATransmits data for a single client's leases or Prefix Delegation (PD) bindings.RFC 546018RECONFIGURE-REQUESTRFC 697719RECONFIGURE-REPLYRFC 697720DHCPV4-QUERYClient sends this to a DHCP 4o6 server. It contains the DHCPv4 message within a 'DHCPv4 Message' option.RFC 734121DHCPV4-RESPONSEServer responds to the client. It carries the resulting DHCPv4 message inside a 'DHCPv4 Message' option.RFC 734122ACTIVELEASEQUERYProvide real-time (or near real-time) updates on DHCPv6 binding activity. Unlike a standard query, it instructs the server to transmit updates as they occur after the request is received.RFC 765323STARTTLSInitiates the establishment of a Transport Layer Security (TLS) connection between a requestor and a DHCPv6 server.RFC 7653

Option Codes

This table lists some of DHCPv6 Option codes. Full list can be for her IANA DHCPv6 Option Codes

+ Option-Code Name Description RFC 1 OPTION_CLIENTID Carries a DUID to uniquely identify the client. RFC 8415 2 OPTION_SERVERID Carries a DUID to uniquely identify the server. RFC 8415 3 OPTION_IA_NA Container for non-temporary address assignments and associated parameters. RFC 8415 4 OPTION_IA_TA Container for temporary address assignments. RFC 8415 5 OPTION_IAADDR Specifies an IPv6 address associated with an IA_NA or IA_TA. RFC 8415 6 OPTION_ORO Identifies a list of requested options by their option codes. RFC 8415 7 OPTION_PREFERENCE Provides a preference value to influence the client's server selection. RFC 8415 8 OPTION_ELAPSED_TIME Reports the duration of the current DHCP transaction in hundredths of a second. RFC 8415 9 OPTION_RELAY_MSG Encapsulates a DHCPv6 message for transmission between relay agents and servers. RFC 8415 11 OPTION_AUTH Carries authentication information to verify the identity of the sender. RFC 8415 12 OPTION_UNICAST Indicates a server unicast address the client may use for direct contact. RFC 8415 13 OPTION_STATUS_CODE Communicates success or failure status and associated error messages. RFC 8415 14 OPTION_RAPID_COMMIT Signals the use of a two-message exchange for address assignment. RFC 8415 15 OPTION_USER_CLASS Identifies the type or category of user or application on the client. RFC 8415 16 OPTION_VENDOR_CLASS Identifies the vendor and hardware/software configuration of the client. RFC 8415 17 OPTION_VENDOR_OPTS Carries vendor-specific information and parameters. RFC 8415 18 OPTION_INTERFACE_ID Identifies the specific interface on which a relay agent received a message. RFC 8415 19 OPTION_RECONF_MSG Specifies the message type a client must use when responding to reconfiguration. RFC 8415 20 OPTION_RECONF_ACCEPT Signals that the client supports and will accept Reconfigure messages. RFC 8415 25 OPTION_IA_PD Container for prefix delegation identity associations and parameters. RFC 8415 26 OPTION_IAPREFIX Specifies an IPv6 prefix associated with an IA_PD. RFC 8415 32 OPTION_INFORMATION_REFRESH_TIME Defines the interval at which a client should refresh its configuration information. RFC 8415 82 OPTION_SOL_MAX_RT Defines the maximum retransmission timeout for Solicit messages. RFC 8415 83 OPTION_INF_MAX_RT Defines the maximum retransmission timeout for Information-request messages. RFC 8415

DHCP Unique Identifier (DUID) option

All devices participating in a DHCPv6 exchange, whether acting as a client or a server, must possess a single DHCP Unique Identifier (DUID) to establish a persistent identity within the network. This identifier is carried in the OPTION_CLIENTID (1) and OPTION_SERVERID (2) fields to ensure that transactions remain consistent even if hardware interfaces are swapped or addresses are reassigned. The DUID is designed to be permanent across reboots and reconfigurations, acting as the definitive anchor for the server’s binding database and the client’s server-selection logic.

DUID-LLT (Link-Layer Address Plus Time) DUID-LLT (Type 1) consists of:

DUID type (1) Hardware type (IANA-assigned) Time value (seconds since 00:00 UTC, 1 January 2000, modulo 2³²) link-layer address

The time component reduces the likelihood of collisions if the same link-layer address is reused on another device. Devices using DUID-LLT must store the generated identifier in stable, non-volatile storage and continue using it even if the original network interface is removed.

This type is recommended for general-purpose computing devices such as desktops, laptops, and printers, that provide writable persistent storage.

DUID-EN (Enterprise Number) DUID-EN (Type 2) is assigned by the device vendor and consists of:

DUID type (2) Vendor’s IANA-assigned Private Enterprise Number Vendor-defined unique identifier

The identifier must be unique per device and stored in non-volatile storage. This type is commonly assigned during manufacturing or at first boot in virtualized environments.

DUID-LL (Link-Layer Address) DUID-LL (Type 3) consists of:

DUID type (3) Hardware type link-layer address

Unlike DUID-LLT, no time value is included. This type is intended for devices with a permanently attached network interface and no writable persistent storage. It should not be used if the permanence of the interface cannot be guaranteed.

DUID-UUID (Universally Unique Identifier) DUID-UUID (Type 4) uses a 128-bit UUID as its identifier.

DUID-UUID consists of:

DUID type (4) Universally Unique Identifier

Its usage and UUID selection rules are defined in RFC 6355. This type is suitable for devices that already store a UUID in firmware or platform configuration.

Option Request Option (ORO) The Option Request Option (ORO), identified by OPTION_ORO (6), is the mechanism used by a DHCPv6 client to inform the server which configuration parameters it is interested in receiving. Rather than the server blindly pushing all available data, the client provides a list of option codes within the ORO to tailor the response to its specific needs.