How does DHCPv6 relay work, and what is DHCPv6 prefix delegation?
Show the answer
Say this first
A relay on the client's first-hop router catches the client's multicast to ff02::1:2, wraps it in a
Relay-Forward message and unicasts it to the server. The link-address field tells the server which subnet
the client is on. On IOS that is ipv6 dhcp relay destination on the client-facing interface. Prefix
delegation (IA_PD) hands a whole prefix, such as a /56, to a requesting router, which then carves /64s from
it for its own LANs. It is how ISPs give IPv6 to home and branch routers.
Go deeper
Relay
interface GigabitEthernet0/0/1
ipv6 address 2001:db8:acad:20::1/64
ipv6 nd managed-config-flag
ipv6 nd prefix default no-autoconfig
ipv6 dhcp relay destination 2001:db8:acad:100::10- Relay-Forward carries the link-address (a global address of the client's link), the peer-address (the client's link-local), and often an Interface-ID option.
- The server answers with Relay-Reply. The relay unwraps it and sends the Reply to the client.
- You still set the RA flags on the relay interface. Without M=1 clients never start DHCPv6.
Prefix delegation
ISP router (delegating) ---> CPE (requesting router)
IA_PD: 2001:db8:5600::/56 LAN1 2001:db8:5600:1::/64
LAN2 2001:db8:5600:2::/64On an IOS CPE:
interface GigabitEthernet0/0/1
description WAN to ISP
ipv6 address autoconfig default
ipv6 dhcp client pd FROM-ISP
!
interface GigabitEthernet0/0/0
ipv6 address FROM-ISP ::1:0:0:0:1/64FROM-ISP is a general prefix name. The LAN gets 2001:db8:5600:1::1/64 and follows automatically if the
ISP changes the delegated prefix.
The return route
Something upstream must route the delegated /56 to the CPE. Broadband gear and many relays install that route when they see the delegation. If nothing does, the CPE gets its prefix and nothing comes back.
They will ask next
Why put the relay on the first-hop router and not anywhere in the path?
Client messages go to a link-scope multicast address, so they never leave the link. Only a device on that link can catch them.
What happens to LAN addresses if the ISP changes the delegated prefix?
The CPE renumbers its LANs and advertises the new prefix. Hosts keep the old addresses until their lifetimes run out unless the CPE deprecates the old prefix. That is why stable PD matters to customers.
Traps
- Forgetting the M flag on the relay interface.
- Assuming the delegated prefix is routed to the CPE by magic.