Understanding DHCPv6: Protocol Overview and IPv6 Address Acquisition on Tencent Cloud CVM
The article explains DHCPv6 fundamentals—including its multicast communication, message formats, and common message types—and walks through the complete IPv6 address acquisition process on Tencent Cloud CVM, detailing the Solicit‑Advertise‑Request‑Reply sequence for first‑time assignment and the Confirm‑Reply flow after a reboot.
Introduction
With the widespread adoption of IPv6, DHCPv6 has become a fundamental technology that every IT professional should understand. This article, based on Tencent Cloud CVM, explains the working principle of DHCPv6 and shows how a cloud server automatically obtains an IPv6 address.
1. DHCPv6 Overview
DHCPv6 (Dynamic Host Configuration Protocol for IPv6) is a network protocol used to assign IPv6 addresses, prefixes, DNS servers, and other configuration parameters. It operates between a client and a server over UDP (client port 546, server port 547). Because IPv6 lacks broadcast, DHCPv6 uses multicast (default group FF02::1:2) for communication, so the client does not need to know the server’s IPv6 address.
Advantages of DHCPv6
Better control of IPv6 address allocation, including the ability to assign specific addresses to specific hosts.
Supports allocation of IPv6 prefixes for hierarchical network configuration.
Can distribute additional parameters such as DNS server addresses.
2. DHCPv6 Message Format
DHCPv6 operates at the application layer of the OSI model, encapsulated within an IPv6 header and a UDP header.
3. DHCPv6 Field Descriptions
msg-type: 8‑bit field indicating the type of the message (13 types defined).
transaction-id: 24‑bit field generated by the client to identify a request‑response exchange.
options: Variable‑length field containing optional configuration data such as client identifier, server identifier, lease time, etc.
4. Common DHCPv6 Message Types
Solicit – client discovers DHCPv6 servers.
Advertise – server replies to Solicit, announcing available services.
Request – client asks the chosen server for an IPv6 address and other parameters.
Confirm – client checks whether an already assigned address is still valid.
Reply – server sends the requested configuration (address, prefix, DNS, etc.).
Decline – client informs the server that a proposed address is already in use.
5. First‑Time IPv6 Address Acquisition (CVM)
Discovery Phase
The CVM (cloud server) sends a Solicit message to the multicast address FF02::1:2 to locate DHCPv6 servers. The Solicit contains the client’s DUID and the request for a non‑temporary address.
Advertisement Phase
Upon receiving Solicit, the server selects an available IPv6 address (sorted from low to high) and replies with an Advertise message containing both DUIDs, the offered address, and lease information.
Selection Phase
If multiple servers respond, the client selects the Advertise with the highest Preference option, then sends a Request (multicast) that includes the chosen server’s DUID.
Confirmation Phase
The server validates the DUID in the Request. If it matches, the server unicasts a Reply confirming the address allocation; otherwise the request is ignored and the address is reclaimed.
Client Processing
After receiving Reply, the CVM performs Neighbor Solicitation (address conflict detection). If no response is received, the address is considered safe to use.
6. IPv6 Address Acquisition After Reboot
When a CVM restarts, it sends a Confirm message (multicast) to verify whether its previously assigned IPv6 address is still valid.
If the server confirms the address, it replies with a successful Reply; otherwise the client restarts the Solicit process. After a successful Reply, the client again performs Neighbor Solicitation to ensure no address conflict.
Through these steps, the article demonstrates how DHCPv6 enables both first‑time and subsequent automatic IPv6 address acquisition on Tencent Cloud CVM, and explains the six most common DHCPv6 message types.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.