DHCP Snooping & Dynamic ARP Inspection
Layer 2 networks trust every device on the segment by default. A host can advertise itself as the DHCP server and hand out fraudulent IP addresses, redirecting all traffic through an attacker-controlled machine. A separate host can broadcast forged ARP replies, poisoning the ARP cache of every neighbour and intercepting or dropping packets silently. Both attacks succeed because switches forward these frames without any validation. DHCP Snooping and Dynamic ARP Inspection (DAI) are two complementary Cisco Catalyst security features that close both gaps at the switch level — requiring no changes to end hosts or routers.
DHCP Snooping acts as a firewall between untrusted client ports and the legitimate DHCP server — only the uplink port toward the real server is trusted to send DHCP offers. DAI uses the binding table that DHCP Snooping builds to validate every ARP packet — if an ARP reply's IP-to-MAC mapping does not match a known lease, the frame is dropped. The two features are deeply interlinked: DAI depends on the DHCP Snooping binding table for its validation data. For a conceptual overview see DHCP Snooping and Dynamic ARP Inspection.
These are Layer 2 switch features — they are configured on Cisco Catalyst switches, not routers. Ensure VLANs are already configured before starting. Review VLAN Creation and Management and Assigning VLANs to Switch Ports if needed. For the DHCP server that DHCP Snooping will protect, see DHCP Server Configuration. For the inter-VLAN routing context these VLANs operate in, see Inter-VLAN Routing — Layer 3 Switch.
1. DHCP Snooping — Core Concepts
The Rogue DHCP Server Attack
Without DHCP Snooping, any host on the VLAN can run a DHCP server. When a client broadcasts a DHCP Discover, whichever server responds first wins. An attacker runs a rogue DHCP server that responds faster than the legitimate server, assigning itself as the default gateway — all client traffic is then routed through the attacker's machine (man-in-the-middle):
Without DHCP Snooping:
Client: DHCP Discover (broadcast) ──► ALL ports
├──► Legitimate DHCP Server
└──► Rogue DHCP Server (attacker)
Both respond with DHCP Offer — client accepts the first one
Rogue server assigns: gateway = 192.168.10.99 (attacker's IP)
All client traffic now routes through attacker
With DHCP Snooping:
Client: DHCP Discover (broadcast) ──► Switch (DHCP Snooping active)
├──► TRUSTED port (uplink to real server) ──► DHCP Offer FORWARDED
└──► UNTRUSTED port (rogue server) ──► DHCP Offer DROPPED
Only legitimate server's offer reaches the client
Trusted vs Untrusted Ports
| Port Type | DHCP Packets Allowed | Typical Assignment | Default? |
|---|---|---|---|
| Trusted | All DHCP messages — Discover, Offer, Request, Ack, NAK, Release | Uplinks to legitimate DHCP servers, uplinks to other switches, router ports | No — must be explicitly configured |
| Untrusted | Only client messages — Discover and Request (sent by clients) | All access ports facing end hosts — PCs, printers, phones, IoT | Yes — all ports are untrusted by default |
The DHCP Snooping Binding Table
As clients receive DHCP leases through trusted paths, DHCP Snooping records each binding in a table. This table is the foundation for DAI and other Layer 2 security features:
| Field | Stored Value | Used By |
|---|---|---|
| MAC address | Client's MAC as seen in DHCP request | DAI — validates ARP replies; Port Security — optional correlation |
| IP address | Assigned IP from legitimate DHCP Ack | DAI — confirms the IP-to-MAC mapping is legitimate |
| VLAN | VLAN the client is on | Scopes the binding to the correct VLAN — prevents cross-VLAN spoofing |
| Port | Switch port the client is connected to | DAI and IP Source Guard — validates that traffic from an IP arrives on the correct port. See also Port Security |
| Lease time | Remaining lease duration | Automatically removes expired entries — binding table stays current |
2. Dynamic ARP Inspection — Core Concepts
The ARP Spoofing Attack
ARP has no authentication — any host can broadcast an ARP reply claiming any IP-to-MAC mapping, even without receiving an ARP request. This gratuitous ARP overwrites the ARP caches of all hosts on the segment, redirecting traffic:
Without DAI:
Attacker broadcasts: "192.168.10.1 (gateway) is at MAC aa:bb:cc:dd:ee:ff (attacker's MAC)"
All hosts update their ARP cache: gateway = aa:bb:cc:dd:ee:ff
All traffic to the gateway is now sent to the attacker (man-in-the-middle)
Attacker forwards to real gateway — victim never notices
With DAI:
Attacker sends ARP reply: "192.168.10.1 is at aa:bb:cc:dd:ee:ff"
DAI checks DHCP Snooping binding table:
192.168.10.1 is a STATIC address (not in binding table) — use ARP ACL
OR
Binding shows: 192.168.10.50 assigned to MAC 00:1a:2b:3c:4d:5e on Fa0/3
ARP reply claims 192.168.10.50 is at aa:bb:cc:dd:ee:ff — MISMATCH
DAI drops the forged ARP reply — ARP cache is never poisoned
DAI Validation Checks
| Validation Type | Command | What It Checks | Drops If... |
|---|---|---|---|
| Binding table check | Enabled by default with DAI | ARP packet's sender IP and MAC match a DHCP Snooping binding entry | IP-MAC pair not in binding table (for untrusted ports) |
| Source MAC | ip arp inspection validate src-mac |
Ethernet frame source MAC matches ARP sender MAC field | Frame MAC differs from ARP sender MAC — forged inner header |
| Destination MAC | ip arp inspection validate dst-mac |
For ARP replies: Ethernet destination MAC matches ARP target MAC | Destination MAC mismatch in ARP reply |
| IP address | ip arp inspection validate ip |
ARP sender/target IP is valid — not 0.0.0.0, 255.255.255.255, or multicast | Invalid IP in ARP payload |
DAI Trusted vs Untrusted Ports
Like DHCP Snooping, DAI has trusted and untrusted ports. Trusted ports bypass DAI validation — untrusted ports have all ARP packets checked:
| Port Type | ARP Validation | Assign To |
|---|---|---|
| Trusted (DAI) | ARP packets forwarded without validation | Uplinks between switches (trunk ports), router ports — devices that hold static IPs not in the binding table |
| Untrusted (DAI) | Every ARP packet validated against binding table or ARP ACL | All access ports facing end hosts — default for all ports |
3. Lab Topology & Scenario
NetsTuts_SW1 is a Cisco Catalyst access layer switch. The legitimate DHCP server is on a dedicated server port (Fa0/1). The uplink to the distribution switch (Gi0/1) connects to NetsTuts_SW2. All client ports (Fa0/2–Fa0/24) face end hosts and are untrusted by default. An attacker host on Fa0/10 will attempt both a rogue DHCP attack and ARP spoofing — both blocked by the completed configuration:
[DHCP Server: 192.168.10.200]
|
Fa0/1 (TRUSTED — DHCP + DAI)
┌────────────────────────────────────┐
│ NetsTuts_SW1 │
│ VLAN 10: 192.168.10.0/24 │
│ ip dhcp snooping vlan 10 │
│ ip arp inspection vlan 10 │
└────────────────────────────────────┘
Fa0/2 | Fa0/5 | Fa0/10 | Gi0/1 |
[PC1] [PC2] [PC3] [Attacker] [SW2 uplink]
.10.10 .10.11 .10.12 .10.99 TRUSTED port
Trust assignments:
Fa0/1 (DHCP Server) — TRUSTED for DHCP Snooping + DAI
Gi0/1 (Uplink SW2) — TRUSTED for DHCP Snooping + DAI
Fa0/2–Fa0/24 — UNTRUSTED (default) for both features
| Port | Connected To | DHCP Snooping Trust | DAI Trust | Reason |
|---|---|---|---|---|
| Fa0/1 | DHCP Server (192.168.10.200) | Trusted | Trusted | Legitimate DHCP server must send Offers and Acks — needs trust for both |
| Gi0/1 | Uplink to SW2 | Trusted | Trusted | Inter-switch links forward all DHCP and ARP from many VLANs — must be trusted |
| Fa0/2–Fa0/24 | End hosts / clients | Untrusted (default) | Untrusted (default) | No client should send DHCP Offers or forged ARP replies |
4. Step 1 — Configure DHCP Snooping
NetsTuts_SW1>en NetsTuts_SW1#conf t Enter configuration commands, one per line. End with CNTL/Z. ! ── Step 1a: Enable DHCP Snooping globally ─────────────── NetsTuts_SW1(config)#ip dhcp snooping ! ── Step 1b: Enable for VLAN 10 ────────────────────────── ! ── (DHCP Snooping must be enabled per-VLAN) ───────────── NetsTuts_SW1(config)#ip dhcp snooping vlan 10 ! ── Step 1c: Disable Option 82 insertion ───────────────── ! ── Option 82 adds relay info — causes server to reject ── ! ── packets if server is not configured to accept it ────── NetsTuts_SW1(config)#no ip dhcp snooping information option ! ── Step 1d: Mark uplink/server ports as trusted ───────── NetsTuts_SW1(config)#interface FastEthernet0/1 NetsTuts_SW1(config-if)#ip dhcp snooping trust NetsTuts_SW1(config-if)#exit NetsTuts_SW1(config)#interface GigabitEthernet0/1 NetsTuts_SW1(config-if)#ip dhcp snooping trust NetsTuts_SW1(config-if)#exit
ip dhcp snooping
activates the feature globally but does not yet filter any VLAN.
ip dhcp snooping vlan 10 activates filtering on VLAN 10
specifically — DHCP Snooping can be enabled on multiple VLANs
simultaneously: ip dhcp snooping vlan 10,20,30 or
ip dhcp snooping vlan 10-30. no ip dhcp snooping
information option disables Option 82 insertion — without this,
the switch adds relay agent information to DHCP packets, which many
DHCP servers reject unless specifically configured to accept it.
See DHCP Relay Agent
for how Option 82 is used in legitimate relay scenarios.
Trust assignments must be made immediately after — before any
clients attempt to get DHCP leases.
DHCP Snooping Rate Limiting
! ── Rate-limit DHCP packets on untrusted ports ─────────── ! ── Prevents DHCP starvation attacks (filling lease pool) ─ NetsTuts_SW1(config)#interface range FastEthernet0/2 - 24 NetsTuts_SW1(config-if-range)#ip dhcp snooping limit rate 15 NetsTuts_SW1(config-if-range)#exit
5. Step 2 — Configure Dynamic ARP Inspection (DAI)
! ── Step 2a: Enable DAI on VLAN 10 ────────────────────── NetsTuts_SW1(config)#ip arp inspection vlan 10 ! ── Step 2b: Mark uplink/server ports trusted for DAI ──── ! ── (Trust is per-feature — set for both DHCP and DAI) ─── NetsTuts_SW1(config)#interface FastEthernet0/1 NetsTuts_SW1(config-if)#ip arp inspection trust NetsTuts_SW1(config-if)#exit NetsTuts_SW1(config)#interface GigabitEthernet0/1 NetsTuts_SW1(config-if)#ip arp inspection trust NetsTuts_SW1(config-if)#exit ! ── Step 2c: Enable additional DAI validation checks ───── NetsTuts_SW1(config)#ip arp inspection validate src-mac dst-mac ip NetsTuts_SW1(config)#end NetsTuts_SW1#wr Building configuration... [OK]
ip arp inspection vlan 10.
Trust must be set independently for both DHCP Snooping and DAI —
the ip dhcp snooping trust command on a port does not
automatically make it trusted for DAI, and vice versa. The three
additional validation options (src-mac dst-mac ip)
can be combined on a single line. The order in the command does not
matter — IOS validates all specified criteria simultaneously.
ARP ACL for Static IP Hosts (DAI for Non-DHCP Devices)
! ── Hosts with static IPs are not in DHCP Snooping table ─ ! ── DAI would drop their ARP packets without an ARP ACL ── NetsTuts_SW1(config)#arp access-list STATIC-HOSTS NetsTuts_SW1(config-arp-nacl)#permit ip host 192.168.10.200 mac host 0050.56a1.b2c3 NetsTuts_SW1(config-arp-nacl)#permit ip host 192.168.10.1 mac host 0050.56a1.0001 NetsTuts_SW1(config-arp-nacl)#exit ! ── Apply ARP ACL to VLAN 10 — checked before binding table NetsTuts_SW1(config)#ip arp inspection filter STATIC-HOSTS vlan 10
arp access-list defines explicit
IP-to-MAC mappings for static hosts. When ip arp inspection
filter STATIC-HOSTS vlan 10 is applied, ARP packets are checked
against this ACL first — if a match is found, the packet is forwarded
or dropped per the ACL action without consulting the binding table.
6. Step 3 — DAI Rate Limiting
An attacker can flood the switch with forged ARP packets to overwhelm the DAI validation engine. DAI rate limiting on untrusted ports caps the ARP packet rate — if the limit is exceeded, the port is placed in the errdisable state:
! ── Rate-limit ARP packets on untrusted ports ──────────── NetsTuts_SW1(config)#interface range FastEthernet0/2 - 24 NetsTuts_SW1(config-if-range)#ip arp inspection limit rate 100 NetsTuts_SW1(config-if-range)#exit ! ── Rate-limit on trusted ports (lower risk but best practice) NetsTuts_SW1(config)#interface GigabitEthernet0/1 NetsTuts_SW1(config-if)#ip arp inspection limit rate 1000 burst interval 1 NetsTuts_SW1(config-if)#exit
burst interval parameter (default: 1 second) defines
the measurement window. rate 1000 burst interval 1 on
the uplink allows up to 1000 ARP packets per second — appropriate
for a trunk carrying many VLANs. If the rate is exceeded,
errdisable activates on the port. Configure
errdisable recovery cause arp-inspection for automatic
recovery.
Errdisable Recovery for DAI
! ── Auto-recover ports errdisabled by DAI rate-limit ───── NetsTuts_SW1(config)#errdisable recovery cause arp-inspection NetsTuts_SW1(config)#errdisable recovery cause dhcp-rate-limit NetsTuts_SW1(config)#errdisable recovery interval 30
shutdown then no shutdown on the interface.
With recovery configured, the switch automatically brings the port
back up after 30 seconds — useful for client ports where a legitimate
host may have briefly exceeded the rate (e.g., booting after power
cut and replaying cached ARPs). See also
PortFast & BPDU Guard
for another errdisable cause on access ports.
7. Verification
show ip dhcp snooping
NetsTuts_SW1#show ip dhcp snooping Switch DHCP snooping is enabled Switch DHCP snooping is configured on following VLANs: 10 Switch DHCP snooping is operational on following VLANs: 10 Switch DHCP snooping is NOT configured on following VLANs: 20,30 DHCP snooping is configured on 1 interface: Interface Trusted Allow option Rate limit (pps) --------- ------- ------------ ---------------- Fa0/1 yes yes unlimited Gi0/1 yes yes unlimited
ip dhcp snooping trust to that interface.
show ip dhcp snooping binding
NetsTuts_SW1#show ip dhcp snooping binding MacAddress IpAddress Lease(sec) Type VLAN Interface ------------------ --------------- ---------- ------------- ---- -------------------- 00:1A:2B:3C:4D:5E 192.168.10.10 85921 dhcp-snooping 10 FastEthernet0/2 00:2C:3D:4E:5F:6A 192.168.10.11 85900 dhcp-snooping 10 FastEthernet0/5 00:3E:4F:50:61:7B 192.168.10.12 85888 dhcp-snooping 10 FastEthernet0/3 Total number of bindings: 3
show ip arp inspection
NetsTuts_SW1#show ip arp inspection Source Mac Validation : Enabled Destination Mac Validation : Enabled IP Address Validation : Enabled Vlan Configuration Operation ACL Match Static ACL ---- ------------- --------- --------- ---------- 10 Enabled Active STATIC-HOSTS No Vlan ACL Logging DHCP Logging Probe Logging ---- ----------- ------------ ------------- 10 Deny Deny Off Vlan Forwarded Dropped DHCP Drops ACL Drops ---- --------- ------- ---------- --------- 10 1847 8 0 8
show ip arp inspection statistics vlan 10
NetsTuts_SW1#show ip arp inspection statistics vlan 10 Vlan Forwarded Dropped DHCP Drops ACL Drops ---- --------- ------- ---------- --------- 10 1847 8 0 8 Vlan ACL Permits DHCP Permits Source Mac Failures ---- ----------- ------------ ------------------- 10 4 1843 3 Vlan Dest Mac Failures IP Val Failures Req Forwarded Res Forwarded ---- ----------------- --------------- ------------- ------------- 10 2 3 1124 723
show ip arp inspection interfaces
NetsTuts_SW1#show ip arp inspection interfaces Interface Trust State Rate (pps) Burst Interval --------------- ----------- ---------- -------------- Fa0/1 Trusted None N/A Fa0/2 Untrusted 100 1 Fa0/3 Untrusted 100 1 Fa0/5 Untrusted 100 1 Fa0/10 Untrusted 100 1 Gi0/1 Trusted 1000 1
Verification Command Summary
| Command | What It Shows | Primary Use |
|---|---|---|
show ip dhcp snooping |
Global status, active VLANs, trusted port list, rate limits | Confirm DHCP Snooping is active on the correct VLANs and trusted ports are correct |
show ip dhcp snooping binding |
Full binding table — MAC, IP, VLAN, port, lease time per client | Verify clients are getting leases and entries are being recorded — DAI depends on this table |
show ip arp inspection |
DAI status per VLAN, validation checks active, forwarded/dropped packet counts | Confirm DAI is active and check cumulative drop counts for evidence of attack activity |
show ip arp inspection statistics vlan [n] |
Detailed per-VLAN drop breakdown — which validation check failed and how many times | Post-incident analysis — identify which specific ARP attack type is occurring |
show ip arp inspection interfaces |
Per-interface trust state and rate limit configuration | Verify trust assignments — confirm no untrusted port is accidentally trusted |
show errdisable recovery |
Errdisable recovery settings — which causes are enabled and recovery interval | Confirm auto-recovery is configured for arp-inspection and dhcp-rate-limit causes |
8. Troubleshooting DHCP Snooping & DAI Issues
| Problem | Symptom | Cause | Fix |
|---|---|---|---|
| Clients not getting DHCP addresses after enabling snooping | DHCP requests from clients time out — no IP assigned. show ip dhcp snooping binding shows no entries |
Uplink to DHCP server or inter-switch uplink is not marked trusted — DHCP Offers and Acks from the server are being dropped by the switch | Mark the server-facing port and uplink trusted: interface Fa0/1 then ip dhcp snooping trust. Verify with show ip dhcp snooping — confirm the port appears in the trusted list. |
| DHCP server rejects packets after snooping enabled | Clients send DHCP Discover but server logs show malformed packets or Option 82 errors | Option 82 (DHCP relay information) is being inserted by the switch. The DHCP server is not configured to accept or ignore relay information from the switch | Disable Option 82 insertion: no ip dhcp snooping information option. Alternatively configure the DHCP server to accept Option 82 packets. This is a very common issue in labs where the server is on the same VLAN as clients. |
| DAI drops legitimate ARP from static-IP host | Static-IP server or router cannot be reached — show ip arp inspection statistics shows its ARP packets as dropped |
The host uses a static IP not assigned by DHCP — no entry in the DHCP Snooping binding table. DAI finds no matching binding and drops the ARP | Create an ARP ACL for the static host: arp access-list STATIC-HOSTS then permit ip host [IP] mac host [MAC]. Apply to the VLAN: ip arp inspection filter STATIC-HOSTS vlan 10. Alternatively trust the port facing the static device (less secure). |
| Port errdisabled due to DHCP rate limit | A client port is errdisabled — show interfaces Fa0/x shows "err-disabled" |
The port exceeded the configured DHCP rate limit — a legitimate host sending excessive DHCP packets (booting after power cut, DHCP client bug) or an actual DHCP starvation attack | Investigate cause: check if it is a legitimate host (show ip dhcp snooping binding). If legitimate, increase the rate limit or enable recovery: errdisable recovery cause dhcp-rate-limit. Re-enable the port: shutdown then no shutdown. |
| DAI drops ARP from a DHCP client that recently renewed | Intermittent connectivity loss for DHCP clients — DAI drops their ARP even though they have a valid lease | DHCP lease was renewed and the IP address changed, but the old binding table entry has not been cleared yet. A race condition where the new IP is not yet in the binding table when an ARP is sent | Check show ip dhcp snooping binding — verify the client's current IP matches the binding. If the binding is stale, clear it: clear ip dhcp snooping binding. Ensure the DHCP server sends ACKs through the trusted port so bindings update correctly. |
| DHCP Snooping binding table not persisting across reload | After switch reload, all clients must re-DHCP — the binding table is empty and DAI drops all ARP until leases are renewed | The binding table is stored in RAM by default — it is lost on reload. Clients retain their leased IPs but the switch has no record of the assignments | Configure binding table persistence to flash: ip dhcp snooping database flash:snooping.db. This writes the table to flash storage periodically so it survives reloads. Set the write interval: ip dhcp snooping database write-delay 300. |
Key Points & Exam Tips
- DHCP Snooping prevents rogue DHCP servers by classifying switch ports as trusted (forwards all DHCP messages) or untrusted (drops DHCP Offers and Acks — only permits client-originated Discover and Request). All ports are untrusted by default.
- DHCP Snooping must be enabled in two places:
ip dhcp snooping(globally) ANDip dhcp snooping vlan [n](per VLAN). The global command alone does not activate filtering on any VLAN. no ip dhcp snooping information optiondisables Option 82 insertion — required when the DHCP server is on the same VLAN as clients and not configured to accept relay agent information.- The DHCP Snooping binding table (
show ip dhcp snooping binding) records MAC, IP, VLAN, port, and lease time for every client that received a DHCP lease through a trusted path. DAI uses this table as its validation source. This is distinct from the switch's CAM/MAC address table, which maps MACs to ports for forwarding decisions. - Dynamic ARP Inspection validates every ARP packet on untrusted ports against the DHCP Snooping binding table. If the IP-to-MAC mapping does not match a binding entry, the ARP is dropped — preventing ARP spoofing and man-in-the-middle attacks.
- DAI trusted/untrusted ports are independent of DHCP Snooping trusted/untrusted ports. Both must be set separately —
ip dhcp snooping trustandip arp inspection trustare different commands on the same interface. - Static-IP hosts (servers, gateways, printers) have no DHCP binding entry — DAI drops their ARP without an ARP ACL. Use
arp access-listto define static IP-to-MAC mappings and apply withip arp inspection filter [ACL] vlan [n]. - DAI additional validation (
ip arp inspection validate src-mac dst-mac ip) checks Ethernet frame MAC consistency and rejects ARP packets with invalid IPs (broadcast, multicast, 0.0.0.0). All three can be combined in one command. - Both features support rate limiting to prevent flooding attacks:
ip dhcp snooping limit rate [pps]andip arp inspection limit rate [pps]. Exceeding the limit puts the port in errdisable state — configureerrdisable recoveryfor automatic recovery. - On the CCNA exam: know the trusted/untrusted port distinction, what DHCP message types untrusted ports block (Offer and Ack), what the binding table contains, how DAI uses it, and what the
no ip dhcp snooping information optioncommand does. Also review 802.1X Port Authentication as another Layer 2 access security mechanism, and Spanning Tree which interacts with the same physical port infrastructure.