Dynamic ARP Inspection (DAI)
ARP Review & ARP Poisoning Attack
- ARP (Address Resolution Protocol): Resolves known IPv4 addresses to unknown MAC addresses. ARP messages are encapsulated directly in Ethernet frames (no IP header) and are only broadcast within the local network.
- Gratuitous ARP (GARP): An ARP reply sent without a preceding ARP request. It is sent to the broadcast MAC address (
FFFF.FFFF.FFFF).- Used to announce IP/MAC changes or proactively populate ARP tables of other devices.
- ARP Poisoning Attack:
- Attacker sends GARP messages claiming to be another device (e.g., the Default Gateway).
- Victims receive the GARP and update their ARP tables, mapping the attacker’s MAC address to the legitimate IP.
- Results in a Man-in-the-Middle (MitM) attack where traffic is intercepted, inspected, or modified by the attacker before being forwarded to the real gateway.
Dynamic ARP Inspection (DAI) Overview
- Concept: A Layer 2 security feature that inspects ARP messages on untrusted ports and drops invalid ARP packets to prevent ARP poisoning. It only filters ARP messages; all other traffic is unaffected.
- Port States:
- Untrusted (Default): Ports connected to end hosts. DAI inspects all ARP messages received on these ports.
- Trusted: Ports connected to other switches, routers, or APs. DAI forwards ARP messages without inspection.
- Validation Mechanism:
- Checks the Sender MAC and Sender IP fields in the ARP message.
- Compares them against the DHCP Snooping Binding Table or manually configured ARP ACLs.
- If a match is found, the packet is forwarded. If no match is found, the packet is dropped.
DAI Configuration Basics
- Enable DAI: Must be enabled per VLAN.
- Trust Ports: Must be manually configured on uplinks to other network devices.
! Enable DAI for specific VLANs (e.g., VLAN 1)
Switch(config)# ip arp inspection vlan 1
! Configure an interface as trusted
Switch(config-if)# ip arp inspection trust
Things to note: Unlike DHCP snooping (which requires a global enable command and a VLAN enable command), DAI only requires the VLAN-level command (ip arp inspection vlan) to be enabled.
DAI Rate Limiting
- Purpose: Prevents attackers from overwhelming the switch CPU with a flood of ARP messages.
- Action: If the rate is exceeded, the interface is placed in an err-disabled state.
- Defaults:
- Untrusted ports: Enabled by default at 15 packets per second (pps).
- Trusted ports: Disabled by default.
! Configure rate limit with burst interval (e.g., 25 packets per 2 seconds)
Switch(config-if)# ip arp inspection limit rate 25 burst interval 2
! Configure rate limit without burst interval (defaults to 1 second)
Switch(config-if)# ip arp inspection limit rate 10
! Enable err-disable recovery for ARP inspection
Switch(config)# errdisable recovery cause arp-inspection
Things to note:
- Rate limiting applies to ARP messages received on the interface, not sent.
- Interfaces disabled by DAI can be recovered manually (
shutdown/no shutdown) or automatically viaerrdisable recovery. - The
burst intervalallows for short spikes in traffic (e.g., 45 packets over 3 seconds averages 15 pps but allows bursts, whereas 15 pps strictly enforces a maximum of 15 every single second).
Optional Validation Checks
By default, DAI only checks Sender MAC/IP against the DHCP snooping table. You can enable deeper checks comparing the Ethernet header fields to the ARP payload fields.
| Check | Description |
|---|---|
dst-mac |
Validates ARP replies by checking if the Ethernet header destination MAC matches the ARP target MAC. |
ip |
Checks for invalid/unexpected IPs (e.g., 0.0.0.0, 255.255.255.255, multicast). Checks Sender IP in req/reply, Target IP only in replies. |
src-mac |
Checks if the Ethernet header source MAC matches the ARP sender MAC. |
! CRITICAL: All desired checks MUST be configured in a single command!
! Subsequent commands will overwrite previous ones.
Switch(config)# ip arp inspection validate dst-mac ip src-mac
Things to note: If you configure validate dst-mac, then later enter validate ip, the dst-mac check is overwritten and disabled. The order of the arguments in the single command does not matter.
ARP ACLs for Static Hosts
- Concept: Hosts with static IPs do not appear in the DHCP Snooping binding table, so DAI will drop their ARP messages by default.
- Solution: Create an ARP ACL to manually map their IP and MAC addresses.
! Create the ARP ACL
Switch(config)# arp access-list ARP-ACL-1
Switch(config-arp-nacl)# permit ip host 192.168.1.100 mac host 0011.2233.4455
! Apply the ARP ACL to a specific VLAN
Switch(config)# ip arp inspection filter ARP-ACL-1 vlan 1
Things to note:
- Static ACL: In the
show ip arp inspectionoutput, if the ACL is configured as a “static ACL”, the implicit deny at the end of the ACL takes effect, and only the ARP ACL is checked (the DHCP snooping table is ignored). By default, static is set tono, meaning the implicit deny is ignored and both the ACL and DHCP snooping table are checked.
Comparison: DAI vs. DHCP Snooping
| Feature | DHCP Snooping | Dynamic ARP Inspection (DAI) |
|---|---|---|
| Inspects | DHCP Messages | ARP Messages |
| Prevents | Rogue DHCP Servers / DHCP Starvation | ARP Poisoning / MitM Attacks |
| Default Port State | Untrusted | Untrusted |
| Rate Limiting Default | Disabled on all ports | Enabled on untrusted ports (15 pps) |
| Rate Limiting Syntax | limit rate [pps] |
limit rate [pps] [burst interval [sec]] |
| Enable Command | Global + VLAN commands | VLAN command only |
Show Commands & Statistics
! Show DAI interface trust state and rate limits
Switch# show ip arp inspection interfaces
! Show overall DAI configuration, validation checks, and drop statistics
Switch# show ip arp inspection
! Show err-disable recovery settings
Switch# show errdisable recovery
Things to note: In show ip arp inspection, look at the statistics to see how many packets were dropped due to DHCP snooping mismatches (DHCP drops) versus ACL permits/denies.
Command Summary
! --- Basic Configuration ---
Switch(config)# ip arp inspection vlan [vlan_ids]
Switch(config-if)# ip arp inspection trust
! --- Rate Limiting ---
Switch(config-if)# ip arp inspection limit rate [packets] burst interval [seconds]
Switch(config-if)# ip arp inspection limit rate [packets]
Switch(config)# errdisable recovery cause arp-inspection
! --- Optional Validation ---
Switch(config)# ip arp inspection validate dst-mac ip src-mac
! --- ARP ACLs ---
Switch(config)# arp access-list [name]
Switch(config-arp-nacl)# permit ip host [IP] mac host [MAC]
Switch(config)# ip arp inspection filter [name] vlan [vlan_id]
! --- Verification ---
Switch# show ip arp inspection interfaces
Switch# show ip arp inspection
Switch# show errdisable recovery