DHCPv6 Prefix Delegation (PD) is a mechanism used in IPv6 to assign a network prefix to requesting routers, typically customer premises equipment (CPE). The CPE can then allocate the assigned prefix to its downstream networks.
Table of Contents
DHCPv6 Prefix Delegation Fundamental
To better understand how DHCPv6 Prefix Delegation works, let’s consider an example:
In this scenario, the ISP has a prefix, 2001:AA:BB:E000::/52
, which it wants to allocate dynamically to its customers using DHCPv6. Each customer will receive at least a /56
prefix from the ISP. The second digit of the fourth section of the prefix will be used by DHCPv6 to assign different prefixes to different customers, allowing up to 16 customers to be addressed with this /52
prefix.
For example, in this case:
Customer 1 receives
2001:AA:BB:E000::/56
Customer 2 receives
2001:AA:BB:E100::/56
Each customer, having received a /56
prefix, can further subdivide it into /64
subnets for their local networks. This means each customer can create 256 /64
subnets using the third and fourth digits of the fourth section of the prefix.
In this example:
Customer 1 creates the subnets
2001:AA:BB:E011::/64
and2001:AA:BB:E012::/64
Customer 2 creates the subnets
2001:AA:BB:E121::/64
and2001:AA:BB:E122::/64
This demonstrates how an ISP can use DHCPv6 to delegate prefixes to customers, who can then allocate subnets within their networks.
DHCPv6 PD Configuration Example
Similar to what is discussed in theory, I’ve prepared a topology to demonstrate a practical configuration example. The setup is simple: an ISP is connected to two customers. Customer 1 has two subnets, while Customer 2 has one subnet. The prefixes assigned follow the example in the previous figure.
To configure the ISP’s DHCPv6 server for prefix delegation, we create a DHCP pool named DHCPv6-PD
. This pool will use a prefix delegation pool, DHCPv6-PD-POOL
, with the address prefix 2001:AA:BB:E000::/52
. From this prefix, /56 prefixes will be automatically assigned to the customers. Finally, the DHCP pool will be applied to the interfaces connected to the customers.
!!! ISP ipv6 unicast-routing ! interface Ethernet0/0 no shutdown ipv6 address FE80::1 link-local ipv6 address 2001:AA:BB:CC::1/64 ipv6 dhcp server DHCPv6-PD ! interface Ethernet0/1 no shutdown ipv6 address FE80::1 link-local ipv6 address 2001:AA:BB:DD::1/64 ipv6 dhcp server DHCPv6-PD ! ipv6 dhcp pool DHCPv6-PD prefix-delegation pool DHCPv6-PD-POOL ! ipv6 local pool DHCPv6-PD-POOL 2001:AA:BB:E000::/52 56
On the customer CPE, in the interface connected to the ISP, we enable the DHCP client with the command ipv6
dhcp client pd DHCPv6-PREFIX-FROM-ISP
. The name DHCPv6-PREFIX-FROM-ISP
represents the prefix that will be learned from the ISP.
For the internal interfaces of the CPE, we assign IPv6 addresses using the prefix learned from the ISP. We customize the subnet portion (between /56 and /64) and define the interface identifier
In this example, for the internal interface connected to subnet11, we assign an IPv6 address using the command ipv6
address DHCPv6-PREFIX-FROM-ISP ::11:0:0:0:1/64
, where 11
represents the subnet, and 0:0:0:1
is the interface identifier. Similarly, for the second interface, we use 12
for the subnet and 0:0:0:1
for the interface identifier.
!!! customer1 ipv6 unicast-routing ! interface Ethernet0/0 no shutdown ipv6 address FE80::100 link-local ipv6 address autoconfig default ipv6 dhcp client pd DHCPv6-PREFIX-FROM-ISP ! interface Ethernet0/1 no shutdown ipv6 address FE80::100 link-local ipv6 address DHCPv6-PREFIX-FROM-ISP ::11:0:0:0:1/64 ! interface Ethernet0/2 no shutdown ipv6 address FE80::100 link-local ipv6 address DHCPv6-PREFIX-FROM-ISP ::12:0:0:0:1/64
!!! customer2 ipv6 unicast-routing ! interface Ethernet0/0 no shutdown ipv6 address FE80::200 link-local ipv6 address autoconfig default ipv6 dhcp client pd DHCPv6-PREFIX-FROM-ISP ! interface Ethernet0/1 no shutdown ipv6 address FE80::200 link-local ipv6 address DHCPv6-PREFIX-FROM-ISP ::21:0:0:0:1/64
Finally, on the endpoints, I enabled IPv6 address assignment using the SLAAC method with the command ipv6
address autoconfig default
, since I am using a Cisco IOS router as the client. This step is obviously not required for regular client devices, which handle SLAAC automatically.
!!! Subnet11 / Subnet12 / Subnet21 interface Ethernet0/0 no shutdown ipv6 address autoconfig default/0 no shutdown ipv6 address FE80::200 link-local ipv6 address autoconfig default ipv6 dhcp client pd DHCPv6-PREFIX-FROM-ISP ! interface Ethernet0/1 no shutdown ipv6 address FE80::200 link-local ipv6 address DHCPv6-PREFIX-FROM-ISP ::21:0:0:0:1/64
Verify DHCPv6 Prefix Delegation Operation
To verify the operation of DHCPv6 Prefix Delegation, we can check the assigned prefixes on the ISP’s DHCP server using the command show
ipv6 dhcp binding
. This will display the results, confirming that the prefix 2001:AA:BB:E000::/56
is assigned to Customer1 and 2001:AA:BB:E100::/56
is assigned to Customer2.
ISP#show ipv6 dhcp binding Client: FE80::100 DUID: 00030001AABBCC000200 Username : unassigned VRF : default Interface : Ethernet0/0 IA PD: IA ID 0x00030001, T1 302400, T2 483840 Prefix: 2001:AA:BB:E000::/56 preferred lifetime 604800, valid lifetime 2592000 expires at Nov 02 2024 11:03 AM (2590671 seconds) Client: FE80::200 DUID: 00030001AABBCC000300 Username : unassigned VRF : default Interface : Ethernet0/1 IA PD: IA ID 0x00030001, T1 302400, T2 483840 Prefix: 2001:AA:BB:E100::/56 preferred lifetime 604800, valid lifetime 2592000 expires at Nov 02 2024 11:23 AM (2591848 seconds)
We can also verify the prefix assignment on the endpoints by using the command show ipv6
interface brief
, which should show the expected results.
Subnet11#show ipv6 int brief Ethernet0/0 [up/up] FE80::A8BB:CCFF:FE00:400 2001:AA:BB:E011:A8BB:CCFF:FE00:400
Subnet12#show ipv6 int brief Ethernet0/0 [up/up] FE80::A8BB:CCFF:FE00:500 2001:AA:BB:E012:A8BB:CCFF:FE00:500
Subnet21#show ipv6 interface brief Ethernet0/0 [up/up] FE80::A8BB:CCFF:FE00:600 2001:AA:BB:E121:A8BB:CCFF:FE00:600