DHCP Snooping and DAI

Understand and implement DHCP Snooping and Dynamic ARP Inspection to secure Layer 2 networks.

1. Executive Summary & Objective

In modern enterprise networks, the Layer 2 domain represents a significant attack surface, often overlooked by perimeter-focused security strategies. The Local Area Network (LAN) is inherently trusting; protocols like DHCP and ARP were designed for functionality and simplicity rather than security. This implicit trust makes the network vulnerable to devastating internal attacks such as rogue DHCP server deployment and Address Resolution Protocol (ARP) poisoning or spoofing.

The primary objective of this module is to comprehensively understand and deploy DHCP Snooping and Dynamic ARP Inspection (DAI). By the end of this deep-dive, network engineers and cybersecurity specialists will be equipped to architect resilient Layer 2 boundaries, configure and enforce trust boundaries on switching infrastructure, and validate the integrity of IP-to-MAC bindings across the network edge. Mastering these two interdependent features is a non-negotiable requirement for zero-trust LAN architectures.

2. Core Concept & Theory (The “Why”)

The Mechanics of DHCP Vulnerabilities

The Dynamic Host Configuration Protocol (DHCP) operates via a broadcast-based mechanism (DORA: Discover, Offer, Request, Acknowledge). When a client sends a DHCP Discover broadcast, any device on the network segment can reply with a DHCP Offer. An attacker can easily connect a rogue DHCP server to an access port and race the legitimate server to respond. If the rogue server wins, it assigns the client a malicious IP address, subnet mask, and default gateway. This results in traffic interception, man-in-the-middle (MitM) attacks, or denial-of-service (DoS) conditions where clients receive invalid routing information.

The ARP Spoofing Dilemma

ARP is stateless. When a client wants to communicate with another IP (like the default gateway), it broadcasts an ARP request. However, clients also accept unsolicited ARP replies (gratuitous ARPs). An attacker can broadcast forged ARP replies claiming their MAC address corresponds to the default gateway’s IP address. Unsuspecting hosts update their ARP caches, routing all outbound traffic through the attacker’s machine. The attacker can then silently eavesdrop, modify packets, or drop them entirely.

The Solution: DHCP Snooping and DAI

DHCP Snooping acts as a Layer 2 firewall for DHCP traffic. It establishes a logical trust boundary:

  • Trusted Ports: Allowed to send both client and server DHCP messages. Typically uplinks to the legitimate DHCP server.
  • Untrusted Ports: Allowed to send only client messages. If a server message (Offer, Ack) is received on an untrusted port, it is immediately dropped.

Crucially, DHCP Snooping builds a Binding Database. As legitimate clients receive IP addresses, the switch records their MAC address, assigned IP, lease time, VLAN, and physical port.

Dynamic ARP Inspection (DAI) leverages this exact database. DAI intercepts all ARP packets on untrusted ports and validates them against the DHCP Snooping database. If a user tries to spoof an IP they were not legitimately assigned, the forged ARP packet is dropped, neutralizing the MitM attack before it begins.

3. Architecture & Topology (Visualizing)

Imagine a standard three-tier or collapsed core campus topology:

  • Core/Distribution Switch: Hosts the legitimate DHCP server or acts as a DHCP relay.
  • Access Switch: Provides connectivity to end-user devices (PCs, IP Phones).
  • Attacker Device: Connected to a random wall jack (Port GigabitEthernet1/0/10).
💻
Attacker Device
DHCP Offer
🖥️
Access Switch

Trust Boundary: The uplink port from the Access Switch to the Core Switch is explicitly defined as a Trusted Port for both DHCP Snooping and DAI. All end-user ports (GigabitEthernet1/0/1 through 1/0/48) are left as the default Untrusted Ports.

When the attacker on Gi1/0/10 spins up a malicious DHCP server (e.g., using Yersinia or Kali Linux), the DHCP Offer packet entering Gi1/0/10 is instantly discarded by the switch’s ASIC because the port is untrusted. When the same attacker attempts an ARP spoofing attack using Ettercap to claim they are the core router, the forged ARP packet entering Gi1/0/10 is inspected by DAI. DAI checks the DHCP binding database, sees the attacker’s MAC does not map to the core router’s IP, and drops the packet.

4. Command Execution & Deployment (The “How”)

Implementing DHCP Snooping and DAI requires a phased approach. Enabling these features blindly can cause massive network outages, as legitimate traffic might be dropped if bindings aren’t present.

Phase A: Enabling DHCP Snooping

  1. Enable globally:
    Switch(config)# ip dhcp snooping
  2. Enable on specific VLANs: (Assuming users are on VLAN 10 and 20)
    Switch(config)# ip dhcp snooping vlan 10,20
  3. Configure the Trust Boundary: The uplink to the DHCP server (e.g., Gi1/0/49) must be trusted.
    Switch(config)# interface GigabitEthernet1/0/49
    Switch(config-if)# ip dhcp snooping trust
  4. Rate Limiting (Optional but Recommended): Prevent attackers from flooding DHCP Discover messages (DHCP Starvation) on untrusted ports.
    Switch(config)# interface range GigabitEthernet1/0/1-48
    Switch(config-if-range)# ip dhcp snooping limit rate 10

Phase B: Enabling Dynamic ARP Inspection (DAI)

Note: Ensure DHCP Snooping has been running long enough to populate the binding database before enabling DAI.

  1. Enable globally per VLAN:
    Switch(config)# ip arp inspection vlan 10,20
  2. Configure the Trust Boundary: Uplinks must bypass inspection to prevent dropping legitimate inter-switch ARP traffic.
    Switch(config)# interface GigabitEthernet1/0/49
    Switch(config-if)# ip arp inspection trust
  3. Configure Rate Limiting (Mitigating ARP Floods):
    Switch(config)# interface range GigabitEthernet1/0/1-48
    Switch(config-if-range)# ip arp inspection limit rate 15

5. Verification & Troubleshooting

Verification is critical to ensure bindings are forming and legitimate traffic flows unimpeded.

1. Verifying DHCP Snooping:

Switch# show ip dhcp snooping

This command confirms which VLANs are operational and lists the trusted interfaces.

2. Verifying the Binding Database:

Switch# show ip dhcp snooping binding

Look for client MAC addresses, their leased IP addresses, and the associated port. If this is empty, DAI will drop all ARP traffic for those clients!

3. Verifying DAI:

Switch# show ip arp inspection vlan 10

This displays the number of ARP packets forwarded and dropped. A rapidly increasing “dropped” counter indicates an ongoing attack or a misconfiguration.

Troubleshooting Scenarios:

  • Symptom: Valid users lose connectivity after DAI is enabled.
  • Root Cause: The user has a static IP address. They never requested a DHCP address, so they aren’t in the snooping database.
  • Resolution: Create an ARP Access Control List (ARP ACL) for static hosts and apply it to the DAI configuration to bypass the database check.
  • Symptom: Port goes into err-disable state.
  • Root Cause: The port exceeded the DHCP snooping or DAI rate limits.
  • Resolution: Check if a legitimate application is bursting traffic, adjust the limit rate, or configure errdisable recovery.

6. Sandbox / Interactive Lab Context

To master these concepts, build a virtual lab using tools like Cisco Packet Tracer, EVE-NG, or GNS3.

Lab Scenario:

  1. Deploy one L3 Switch (Core/DHCP Server), one L2 Switch (Access), and two VPCS (Virtual PCs).
  2. Connect the Core switch to the Access switch via a trunk on port Gi0/1.
  3. Connect PC1 (Legitimate User) to Gi0/2 and PC2 (Attacker) to Gi0/3.
  4. Enable DHCP Snooping and DAI on the Access switch. Do not trust the uplink port initially.
  5. Watch PC1 fail to get an IP address. Why? The DHCP Offer from the Core switch is dropped on the untrusted uplink.
  6. Trust the uplink port (Gi0/1) and observe PC1 successfully acquiring an IP.
  7. Use the CLI on the switch to inspect the DHCP snooping binding table. You will see PC1’s binding.
  8. Simulate an attack: change PC2’s IP address statically to match PC1’s IP address, and try to ping the Core router.
  9. Watch the switch console logs as DAI intercepts the fraudulent ARP request from PC2 and discards it, protecting PC1’s session.

🧪 Want to practise this on your own computer? See how to set up your lab →

🤖

Need clarification? Ask GT

Hi, I'm GT — your AI tutor for DHCP Snooping and DAI. What would you like to know?
📝

Knowledge Check

1 of 3

What attack does DHCP snooping primarily prevent?

Report a problem

About: /lessons/dhcp-snooping-and-dai