We all know and love DHCP in IPv4. We understand the broadcast operation and the DORA (Discover, Offer, Request, ACK), as well as the ‘ip helper-address’ we use when the DHCP server is on another subnet.
But what about IPv6 and DHCPv6? How does it work?
Here’s a new mnemonic acronym: SARR (Solict, Advertise, Request, Reply). There’s no broadcast or ‘ipv6 helper-address’, but rather configuration of the IPv6 relay with ‘ipv6 dhcp relay destination’. There’s also a reserved, link-scoped multicast address (FF02::1:2) and a site-scoped multicast address (FF05::1:3) used by the relay agent. New UDP port numbers clients listen for DHCP messages on UDP port 546. Servers and relay agents listen for DHCP messages on UDP port 547. And for the relay agent, we need to make a new mnemonic acronym out of the Relay-Forw (Solicit), Relay-Reply (Advertise), Relay-Forw (Request), Relay-Reply (Reply).
This post will show basic operations of DHCP and DHCPv6 “side-by-side” with Wireshark captures for a packet level view of the differences and debugs from the router CLI. This will cover stateful DHCPv6, which is the most similar to the operation of DHCP in allocating IPv6 addresses or prefixes to a DHCPv6 client. This will be shown with 4 scenarios: Scenario #1 and #2 will be broadcast/multicast with a single DHCPServer and DHCPClient connected via fast Ethernet with the Wireshark capture on the link directly connecting the server and client. Scenario #3 and Scenario #4 will be a DHCP and DHCPv6 relay with a single DHCPServer and DHCPClient connected via a router separating the broadcast/multicast domain, with the Wireshark capture between the server and the relay.
Scenario #1 – IPv4 DHCP broadcast
- · DHCPServer <-> DHCPClient
hostname DHCPServer
!
ip dhcp pool DHCP_POOL
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 4.2.2.2
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
hostname DHCPClient
!
interface FastEthernet0/0
ip address dhcp
Run the debug on the DHCPServer
DHCPServer#sh debugging
DHCP server packet debugging is on.
DHCP server event debugging is on.
DHCPServer#
DHCPD: Sending notification of DISCOVER:
DHCPD: htype 1 chaddr c208.10e0.0000
DHCPD: remote id 020a0000c0a8010100000000
DHCPD: circuit id 00000000
DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.302d.4661.302f.30 on interface FastEthernet0/0.
DHCPD: Seeing if there is an internally specified pool class:
DHCPD: htype 1 chaddr c208.10e0.0000
DHCPD: remote id 020a0000c0a8010100000000
DHCPD: circuit id 00000000
DHCPD: Allocate an address without class information (192.168.1.0)
DHCPD: Adding binding to radix tree (192.168.1.2)
DHCPD: Adding binding to hash tree
DHCPD: assigned IP address 192.168.1.2 to client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.302d.4661.302f.30.
DHCPD: Sending DHCPOFFER to client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.302d.4661.302f.30 (192.168.1.2).
DHCPD: broadcasting BOOTREPLY to client c208.10e0.0000.
DHCPD: DHCPREQUEST received from client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.302d.4661.302f.30.
DHCPD: Sending notification of ASSIGNMENT:
DHCPD: address 192.168.1.2 mask 255.255.255.0
DHCPD: htype 1 chaddr c208.10e0.0000
DHCPD: lease time remaining (secs) = 86400
DHCPD: No default domain to append – abort update
DHCPD: Sending DHCPACK to client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.302d.4661.302f.30 (192.168.1.2).
DHCPD: broadcasting BOOTREPLY to client c208.10e0.0000.
Take a look at Wireshark or view online with CloudShark
Scenario #2 – IPv6 DHCPv6 link-local multicast
- · DHCPServer <-> DHCPCient
hostname DHCPServer
!
ipv6 unicast-routing
ipv6 dhcp pool dhcp-pool
prefix-delegation pool client-prefix-pool1 lifetime 1800 600
dns-server 2001:DB8:3000:3000::42
domain-name example.com
!
interface FastEthernet0/0
description downlink to clients
ipv6 address 2001:DB8:1200:5::200/64
ipv6 dhcp server dhcp-pool
!
ipv6 local pool client-prefix-pool1 2001:DB8:1200::/40 48
hostname DHCPClient
!
interface FastEthernet0/0
description uplink to provider from DHCP IPv6 server
ipv6 address prefix-from-provider ::5:0:0:0:100/64
ipv6 enable
ipv6 dhcp client pd prefix-from-provider
Run the debug on the DHCPServer
DHCPServer#sh debugging
Generic IPv6:
IPv6 DHCP debugging is on
DHCPServer#
*Mar 1 00:02:42.727: IPv6 DHCP: Add routes, pool dhcp-pool, idb FastEthernet0/0
IPv6 DHCP: Received SOLICIT from FE80::C008:10FF:FEE0:0 on FastEthernet0/0
IPv6 DHCP: Sending ADVERTISE to FE80::C008:10FF:FEE0:0 on FastEthernet0/0
IPv6 DHCP: Received REQUEST from FE80::C008:10FF:FEE0:0 on FastEthernet0/0
IPv6 DHCP: Creating binding for FE80::C008:10FF:FEE0:0 in pool dhcp-pool
IPv6 DHCP: Allocating IA_PD 00040001 in binding for FE80::C008:10FF:FEE0:0
IPv6 DHCP: Allocating prefix 2001:DB8:1200::/48 in binding for FE80::C008:10FF:FEE0:0, IAID 00040001
IPv6 DHCP: Sending REPLY to FE80::C008:10FF:FEE0:0 on FastEthernet0/0
DHCPServer#sh ipv6 dhcp binding
Client: FE80::C008:10FF:FEE0:0
DUID: 00030001C20810E00000
Username : unassigned
Interface : FastEthernet0/0
IA PD: IA ID 0×00040001, T1 300, T2 480
Prefix: 2001:DB8:1200::/48
preferred lifetime 600, valid lifetime 1800
expires at Mar 01 2002 12:34 AM (1764 seconds)
DHCPClient#sh ipv6 int
FastEthernet0/0 is up, line protocol is up
IPv6 is enabled, link-local address is FE80::C008:10FF:FEE0:0
No Virtual link-local address(es):
Description: uplink to provider from DHCP IPv6 server
Global unicast address(es):
2001:DB8:1200:5::100, subnet is 2001:DB8:1200:5::/64 [CAL/PRE]
valid lifetime 1723 preferred lifetime 523
Take a look at Wireshark or view online with CloudShark
Scenario #3 – IPv4 DHCP relay
- · DHCPServer <-> DHCPRelay <-> DHCPCient
hostname DHCPServer
!
ip dhcp excluded-address 23.23.23.1
ip dhcp excluded-address 23.23.23.2
!
ip dhcp pool DHCP_POOL
network 23.23.23.0 255.255.255.0
default-router 23.23.23.2
dns-server 4.2.2.2
!
interface FastEthernet0/0
ip address 12.12.12.1 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 12.12.12.2
hostname DHCPRelay
!
interface FastEthernet0/0
ip address 12.12.12.2 255.255.255.0
!
interface FastEthernet0/1
ip address 23.23.23.2 255.255.255.0
ip helper-address 12.12.12.1
hostname DHCPClient
!
interface FastEthernet0/1
ip address dhcp
Run the debug on the DHCPServer
DHCPServer#sh debug
DHCP server packet debugging is on.
DHCP server event debugging is on.
DHCPServer#
DHCPD: Sending notification of DISCOVER:
DHCPD: htype 1 chaddr c208.10e0.0001
DHCPD: remote id 020a00000c0c0c0100000000
DHCPD: circuit id 00000000
DHCPD: DHCPDISCOVER received from client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.312d.4661.302f.31 through relay 23.23.23.2.
DHCPD: Seeing if there is an internally specified pool class:
DHCPD: htype 1 chaddr c208.10e0.0001
DHCPD: remote id 020a00000c0c0c0100000000
DHCPD: circuit id 00000000
DHCPD: Allocate an address without class information (23.23.23.0)
DHCPD: Adding binding to radix tree (23.23.23.5)
DHCPD: Adding binding to hash tree
DHCPD: assigned IP address 23.23.23.5 to client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.312d.4661.302f.31.
DHCPD: Sending DHCPOFFER to client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.312d.4661.302f.31 (23.23.23.5).
DHCP: BOOTREPLY for client c208.10e0.0001 to relay 23.23.23.2.
DHCPD: DHCPREQUEST received from client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.312d.4661.302f.31.
DHCPD: Sending notification of ASSIGNMENT:
DHCPD: address 23.23.23.5 mask 255.255.255.0
DHCPD: htype 1 chaddr c208.10e0.0001
DHCPD: lease time remaining (secs) = 86400
DHCPD: No default domain to append – abort update
DHCPD: Sending DHCPACK to client 0063.6973.636f.2d63.3230.382e.3130.6530.2e30.3030.312d.4661.302f.31 (23.23.23.5).
DHCPD: unicasting BOOTREPLY for client c208.10e0.0001 to relay 23.23.23.2.
Take a look at Wirseshark or view online with CloudShark
Scenario #4 – IPv6 DHCPv6 relay
- · DHCPServer <-> DHCPRelay <-> DHCPClient
hostname DHCPServer
!
ipv6 unicast-routing
ipv6 dhcp pool dhcp-pool
prefix-delegation pool client-prefix-pool1 lifetime 1800 600
dns-server 2001:DB8:3000:3000::42
domain-name example.com
!
interface FastEthernet0/0
description downlink to clients
ipv6 address 2001:DB8:1::1/64
ipv6 dhcp server dhcp-pool
!
ipv6 route ::/0 2001:DB8:1::2
ipv6 local pool client-prefix-pool1 2001:DB8:1200::/40 48
hostname DHCPRelay
!
ipv6 unicast-routing
!
interface FastEthernet0/0
ipv6 address 2001:DB8:1::2/64
!
interface FastEthernet0/1
ipv6 address 2001:DB8:1200:5::200/64
ipv6 dhcp relay destination FE80::C003:1AFF:FE80:0 FastEthernet0/0
hostname DHCPClient
!
interface FastEthernet0/1
description uplink to provider from DHCP IPv6 server
ipv6 address prefix-from-provider ::5:0:0:0:100/64
ipv6 enable
ipv6 dhcp client pd prefix-from-provider
Run the debug on the DHCPServer and DHCPRelay
DHCPServer#sh debugging
Generic IPv6:
IPv6 DHCP debugging is on
DHCPServer#
*Mar 1 00:10:25.011: IPv6 DHCP: Received RELAY-FORWARD from FE80::C004:1AFF:FE80:0 on FastEthernet0/0
*Mar 1 00:10:25.015: IPv6 DHCP: Sending RELAY-REPLY to FE80::C004:1AFF:FE80:0 on FastEthernet0/0
*Mar 1 00:10:26.007: IPv6 DHCP: Received RELAY-FORWARD from FE80::C004:1AFF:FE80:0 on FastEthernet0/0
*Mar 1 00:10:26.007: IPv6 DHCP: Creating binding for FE80::C005:1AFF:FE80:1 in pool dhcp-pool
*Mar 1 00:10:26.011: IPv6 DHCP: Allocating IA_PD 00050001 in binding for FE80::C005:1AFF:FE80:1
*Mar 1 00:10:26.011: IPv6 DHCP: Allocating prefix 2001:DB8:1200::/48 in binding for FE80::C005:1AFF:FE80:1, IAID 00050001
*Mar 1 00:10:26.015: IPv6 DHCP: Sending RELAY-REPLY to FE80::C004:1AFF:FE80:0 on FastEthernet0/0
DHCPRelay#debug ipv6 dhcp relay
IPv6 DHCP relay debugging is on
DHCPRelay#
*Mar 1 00:10:20.995: IPv6 DHCP_RELAY: Relaying SOLICIT from FE80::C005:1AFF:FE80:1 on FastEthernet0/1
*Mar 1 00:10:20.999: IPv6 DHCP_RELAY: to FE80::C003:1AFF:FE80:0 via FastEthernet0/0
*Mar 1 00:10:21.091: IPv6 DHCP_RELAY: Relaying RELAY-REPLY from FE80::C003:1AFF:FE80:0 on FastEthernet0/0
*Mar 1 00:10:21.095: IPv6 DHCP_RELAY: to FE80::C005:1AFF:FE80:1 via FastEthernet0/1
*Mar 1 00:10:22.055: IPv6 DHCP_RELAY: Relaying REQUEST from FE80::C005:1AFF:FE80:1 on FastEthernet0/1
*Mar 1 00:10:22.055: IPv6 DHCP_RELAY: to FE80::C003:1AFF:FE80:0 via FastEthernet0/0
*Mar 1 00:10:22.087: IPv6 DHCP_RELAY: Relaying RELAY-REPLY from FE80::C003:1AFF:FE80:0 on FastEthernet0/0
*Mar 1 00:10:22.087: IPv6 DHCP_RELAY: to FE80::C005:1AFF:FE80:1 via FastEthernet0/1
DHCPServer#sh ipv6 dhcp binding
Client: FE80::C005:1AFF:FE80:1
DUID: 00030001C2051A800000
Username : unassigned
Interface : relayed
IA PD: IA ID 0×00050001, T1 300, T2 480
Prefix: 2001:DB8:1200::/48
preferred lifetime 600, valid lifetime 1800
expires at Mar 01 2002 12:40 AM (1644 seconds)
DHCPClient(config-if)#do sh ipv6 int
FastEthernet0/1 is up, line protocol is up
IPv6 is enabled, link-local address is FE80::C005:1AFF:FE80:1
No Virtual link-local address(es):
Description: uplink to provider from DHCP IPv6 server
Global unicast address(es):
2001:DB8:1200:5::100, subnet is 2001:DB8:1200:5::/64 [CAL/PRE]
valid lifetime 1670 preferred lifetime 470
Take a look at Wirseshark or view online CloudShark
WRAP UP
Wrapping up this post, there is SO much more to learn about DHCP and DHCPv6, but hopefully this will whet your appetite to dig in and get more detail. I plan on working on it some more in the future. When I do, I’ll post what I see here. There’s lots of good information of course on the Cisco DocCD and from NANOG, plus the RFC’s covering DHCPv6.




Pingback: Who owns what? On Service Demarcation