The DHCPv6 server allocates an IPv6 address or prefix to a DHCPv6 client in the following sequence:
Select an IPv6 address pool.
An IPv6 address pool can be bound to an interface of the DHCPv6 server. The DHCPv6 server assigns an address or prefix to the DHCPv6 client from the IPv6 address pool. If a relay exists, the IPv6 address pool cannot be bound to the interface of the DHCPv6 server. Based on the first link-address field (identifies the link range of the DHCPv6 clients) whose value is not 0 in the packet, the address pool that can be bound must be in the same link range with the network prefixes or IPv6 address prefixes in the configured address pools.
Select an IPv6 address or prefix.
After the address pool is configured, the DHCPv6 server assigns IPv6 addresses or prefixes to DHCPv6 clients in the following procedures:
The addresses allocated by DHCPv6 servers to DHCPv6 clients have leases. A lease is composed of the lifetime (including the preferred lifetime and valid lifetime) and lease extension time (T1 and T2 in an IA). After the valid lifetime of an address is reached, a DHCPv6 client can no longer use this address. Before the valid lifetime is reached, a DHCPv6 client needs to update the address lease if it needs to continue to use this address.
To extend the valid lifetime and preferred lifetime for the addresses associated with an IA, a DHCPv6 client sends a Renew packet to the DHCPv6 server at T1. The IA option in the Renew packet carries the addresses whose leases need to be extended. If the DHCPv6 client does not receive a response packet, it sends a Rebind packet at T2 to the DHCPv6 server to continue to extend the address lease.
Figure 1 shows the process of updating the address lease at T1.
The process of updating the address lease at T1 is as follows:
Figure 2 shows the process of updating the address lease at T2.
The process of updating the address lease at T2 is as follows:
If the DHCPv6 client does not receive a response packet from the DHCPv6 server, the DHCPv6 client stops using this address after the valid lifetime is reached.
The DHCPv6 server supports reserved IPv6 addresses that cannot be dynamically allocated. For example, an IPv6 address can be reserved for a DNS server.