DHCPv6 Prefix Delegation: ISP to CPE Config - 夜莺博客

DHCPv6 Prefix Delegation: ISP to CPE Config

DHCPv6 prefix delegation is how an ISP hands a customer router a block of address space (a /56 or /48 rather than a single /64), which the CPE then subnets for its internal networks. It is the backbone of IPv6 broadband and it fails in very identifiable ways: the CPE never requests a prefix, the ISP delegates one that is too short to subnet, or the delegated prefix is never applied to the LAN interface. This guide covers the client and server configuration, verification, and the failure modes to check in order.

How it works

The requesting router (CPE) sends a DHCPv6 Solicit with an Identity Association for Prefix Delegation (IA_PD), identified by an IAID. The delegating router (ISP edge) selects a prefix from a pool or from a static binding keyed on the client's DUID, and returns it with preferred and valid lifetimes. The CPE stores the prefix in a general prefix pool and can then number its downstream interfaces from it. Address assignment and prefix delegation are separate IA types: IA_NA gives the CPE an address on the WAN link, IA_PD gives it a block to hand out internally.

Client (CPE) configuration

interface GigabitEthernet0/0
 ipv6 address autoconfig
 ipv6 enable
 ipv6 dhcp client pd dhcp-prefix rapid-commit
 ipv6 nd ra-interval 30
 no shutdown
interface GigabitEthernet0/1
 ipv6 address dhcp-prefix ::1/64
 ipv6 nd other-config-flag
 no shutdown

ipv6 dhcp client pd enables the client process and requests delegation; the general prefix pool name (dhcp-prefix) can then be referenced in any interface address as dhcp-prefix ::1/64 or with a specific subnet number. rapid-commit shortens the exchange to a two-message Solicit/Reply where the server supports it.

Server (ISP edge) configuration

ipv6 unicast-routing
ipv6 dhcp database flash:/dhcpv6-db
ipv6 dhcp pool CPE-POOL
 address prefix 2001:db8:100::/64
 prefix-delegation pool CUST-PD lifetime 2592000 604800
 dns-server 2001:db8::53

ipv6 local pool CUST-PD 2001:db8:1000::/40 56
interface GigabitEthernet0/0
 ipv6 address 2001:db8:1::1/64
 ipv6 dhcp server CPE-POOL rapid-commit
 ipv6 nd managed-config-flag
 ipv6 nd other-config-flag

ipv6 dhcp binding            ! static binding by DUID
ipv6 dhcp pool CPE-STATIC
 prefix-delegation 2001:db8:2000::/56 0123456789ABCDEF

Static bindings (keyed on DUID) are how you give a business customer a fixed prefix. For scale, the root can also come from RADIUS using the Framed-IPv6-Prefix attribute, which is what most ISPs use so the prefix is tied to the subscriber account.

Verification

show ipv6 dhcp interface GigabitEthernet0/0
show ipv6 general-prefix
show ipv6 dhcp binding
show ipv6 interface GigabitEthernet0/1
show ipv6 routers
debug ipv6 dhcp detail       ! brief, high CPU on busy routers

On the CPE, show ipv6 general-prefix must list the delegated block, and the LAN interface address must be derived from it. On the ISP edge, show ipv6 dhcp binding shows the DUID, IAID and delegated prefix for each customer.

Failure modes, in the order to check them

  • No delegation at all – the CPE must send IA_PD; check show ipv6 dhcp interface for the client state, and confirm the request is not being dropped by a filter on the WAN interface.
  • Address but no prefix – the ISP answers IA_NA but not IA_PD: the pool or RADIUS attribute is missing, or the requested prefix length is not available.
  • Prefix too short to subnet – if the ISP delegates a /64, the customer cannot create additional /64s. Request a /56 (or /48) explicitly; RFC 9762 introduces a P flag in Router Advertisements so clients know a dedicated prefix is available and ask for one.
  • LAN not numbered – the prefix arrived but no interface references it, or the RA flags on the LAN keep hosts on SLAAC with a stale prefix.
  • Renewal problems – lifetimes matter: a prefix that expires while the LAN still advertises it causes intermittent connectivity. Ensure the client renews well before the valid lifetime ends.
  • Multiple WAN links – with two uplinks each delegating a prefix, the CPE must decide which to use for each LAN; running both without a policy produces address drift.

Household example with a /60

An ISP delegating a /60 gives the customer sixteen /64s, enough for a home router to run a guest, IoT and management network separately rather than flattening everything into one subnet. When clients also take prefixes via DHCPv6-PD, the address space must be large enough – a /60 with fifteen devices each requesting a /64 runs out quickly, which is precisely the scenario RFC 9762 flags for the P flag.

Related: IPv6 neighbour discovery and RAs, ISC DHCP server configuration, and MTU, MSS and PMTUD.

原文链接:https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/ipaddr_dhcp/configuration/xe-16/dhcp-xe-16-book/ip6-dhcp-prefix-xe.html