4.4 Troubleshoot DHCP for IPv4 and IPv6: clients, the IOS server, relay and options

ENARSI 300-410 v1.1 · 4.0 Infrastructure Services

DHCP hands out addresses. ENARSI troubleshoots every role an IOS device can play: DHCP client (ip address dhcp), IOS DHCP server (pools, exclusions, options), relay agent (ip helper-address, option 82), and the IPv6 versions: SLAAC, stateless and stateful DHCPv6 and DHCPv6 relay.

What you must know

Relaying DHCPv4

! R1, on the client-facing interface
interface GigabitEthernet0/1
 ip address 10.10.10.1 255.255.255.0
 ip helper-address 10.0.50.10
!
! If the server is an IOS router:
ip dhcp excluded-address 10.10.10.1 10.10.10.20
ip dhcp pool VLAN10
 network 10.10.10.0 255.255.255.0
 default-router 10.10.10.1
 dns-server 10.0.50.53
 option 150 ip 10.0.50.60

The relay (1) sets giaddr to its own interface address; the server uses it to choose the pool and to send the reply back. ip helper-address also forwards seven other UDP services (TFTP, DNS, NetBIOS, TACACS, time); limit them with no ip forward-protocol udp <port>.

SymptomCause
Clients get 169.254.x.xNo helper, wrong helper address, or no route from the server back to giaddr
Server log: no pool for giaddrNo pool whose network includes giaddr
Clients get the router's own addressMissing excluded-address; IOS detects the conflict and marks it
Relay works, then the server drops itOption 82 added by a snooping switch with giaddr 0.0.0.0 (ip dhcp relay information trust-all on the router)

DHCPv6 and the RA flags

MethodRA flagsAddress fromDNS and options from
SLAACM=0, O=0The host (prefix from the RA)RDNSS in the RA, or none
Stateless DHCPv6M=0, O=1SLAACDHCPv6 (no state on the server)
Stateful DHCPv6M=1DHCPv6 serverDHCPv6
ipv6 dhcp pool V6-LAN
 address prefix 2001:db8:10::/64
 dns-server 2001:db8:50::53
 domain-name ntpath.lab
!
interface GigabitEthernet0/1
 ipv6 address 2001:db8:10::1/64
 ipv6 nd managed-config-flag          ! M=1: stateful
 ipv6 dhcp server V6-LAN
! or, as a relay on another router:
 ipv6 dhcp relay destination 2001:db8:50::10

The router as a client

interface GigabitEthernet0/0
 ip address dhcp
 ipv6 address dhcp
 ipv6 address autoconfig default

R1# show dhcp lease
Temp IP addr: 203.0.113.42  for peer on Interface: GigabitEthernet0/0
Temp  sub net mask: 255.255.255.0
   DHCP Lease server: 203.0.113.1, state: 5 Bound
   DHCP transaction id: 1A2B
   Lease: 86400 secs,  Renewal: 43200 secs,  Rebind: 75600 secs
Temp default-gateway addr: 203.0.113.1

Commands

show ip dhcp binding / pool / conflictLeases, pool usage and detected conflicts.
show ip dhcp server statisticsMessages received and sent.
debug ip dhcp server packetEach DHCP message the server or relay handles.
show ipv6 dhcp binding / pool / interfaceDHCPv6 leases, pools and interface roles.
show dhcp leaseThe router's own DHCP client lease.

Exam traps

Check yourself

What does a relay put in giaddr, and why?
Its receiving interface address, so the server picks the right pool and can reply.
Which RA flag combination is stateless DHCPv6?
M=0, O=1.
Clients behind R1 get 169.254 addresses; the server is fine. First check?
ip helper-address on R1's client-facing interface and the server's route back to it.
Where does a stateful DHCPv6 client get its default route?
From router advertisements.

Labs

Try it live: DHCP relay to a central IOS server, and a router as a DHCP client

More topics in 4.0 Infrastructure Services