DHCP, DHCP relay & DHCP snooping

Regular DHCP packets

1. PC sends DHCP Discover as broadcast, contains the IP assigned previously
    we see two discover packets here, note the previous assigned IP 192.168.2.205


























2. DHCP server responses with DHCP offer, also is broadcast



























3. PC sends DHCP Request, also is broadcast.
     it has DHCP server IP in order to confirm that PC will take its assignment.























4. DHCP server acknowledge the DHCP request.
























5. PC sends ARP probe to verify no duplicate IP on the network.


















6. If  PC gets ARP response which indicates duplicated IP exists on the network, PC will sends DHCP Decline, then restart DHCP discover
    note there is no previous assigned IP in the new DHCP Discover message


















































7. PC may send DHCP Inform to obtain other info such as default gateway and DNS.

























================================================================

Issue when "Device tracking" is enabled on access switch

Symptoms:
DHCP server has lots IPs marked as BAD-ADDRESS when assigning IPs.

Cause:
access switch with device tracking enabled sends Cisco ARP Probe
the highlight packet is from access switch with source IP 0.0.0.0. PC doesn't really understand it, it thinks this indicates a duplicate IP, so send DHCP Decline to DHCP server.



















Solution:
Adjust access switch ARP probe configuration to delay switch ARP probe 10 seconds.

ip device tracking probe delay 10



========================




1. DHCP relay is enabled on switch L3 interface with command: ip helper-address x.x.x.x

2. DHCP relay on WLC is enabled when enable DHCP proxy and configure the primary DHCP server IP. If DHCP proxy is disable, this DHCP IP will be ignored.
When DHCP relay is disabled, DHCP discovery and request will be bridged to switch L3 interface, so use switch DHCP relay setting.

3. The DHCP discover packet is sent from relay agent to DHCP server has Relay agent IP address is set, this packet will be dropped by switch DHCP snooping with error:
  %DHCP_SNOOPING-5-DHCP_SNOOPING_NONZERO_GIADDR: DHCP_SNOOPING drop message with non-zero giaddr or option82 value on untrusted port, message type: DHCPDISCOVER, MAC sa: 000c.290a.fd76
One option to fix this is to set the relay agent (like WLC) switch port to DHCP snooping trust.
 
4.Option 82 basically attach switch ID and switch port ID to the DHCP discover and request, DHCP Offer returns from DHCP server has the same info attached, so the switch knows where to send the DHCP offer, with DHCP snooping, this literally turns DHCP from broadcast to unicast.

Reference:
https://nexp.com.ua/technologies/rns/dhcp-snooping-and-option-82/



Comments

Popular posts from this blog

ASA IKEv1 VPN troubleshooting Steps and Tips

Firepower 2100/1100 FTD/ASA initial setup, reimage, upgrade.

Firepower FMC and FTD troubleshooting