Watch on Instagram

Network Bytes · Episode 84 · CCNA 5.7

"Dynamic ARP Inspection"

An attacker can send a fake ARP reply that says the gateway's IP address is at their MAC address and pull other people's traffic to their laptop. Dynamic ARP Inspection on the switch checks ARP messages on untrusted ports against the DHCP snooping table, and trusted uplinks skip the check.

Posted · About a 1 minute watch, 4 minute read · Take the quiz

The lie ARP can't catch

Before a PC can send traffic to its default gateway, it needs the gateway's MAC address. It finds it with ARP (see EP29): "who has 10.0.0.1?", and the gateway answers "10.0.0.1 is at my MAC." The PC saves that pair in its ARP table and uses it for every frame it sends off the local network.

ARP has no checks. Any device can send an ARP reply, even one nobody asked for, and most hosts simply believe it. So an attacker on the same VLAN can announce "10.0.0.1 is at MAC-ATTACKER." The other PCs update their ARP tables and start sending their gateway traffic to the attacker's laptop, which can read it and pass it on to the real router so nobody notices. This is called ARP spoofing or ARP poisoning, a man-in-the-middle attack.

A guard with a sign-in sheet

Dynamic ARP Inspection is a switch feature that stops this at the port. Think of a guard at the door who checks each visitor's name tag against a sign-in sheet.

When DAI is on for a VLAN, the switch intercepts every ARP request and reply that arrives on an untrusted port and compares the sender's IP address and MAC address with its list of valid bindings. A message whose IP-to-MAC pair is on the list for that port goes through as normal. One that isn't is not allowed onto the network, and the switch logs it.

By default every port is untrusted.

The sign-in sheet: the DHCP snooping table

Where does the switch get its list? From DHCP snooping (see EP59). While snooping watches DHCP on the access ports, it records each lease in the DHCP snooping binding table: the port, the VLAN, the IP address handed out and the client's MAC address. For example:

`` port 3 10.0.0.23 MAC-B port 7 10.0.0.27 MAC-C ``

DAI uses that table as its sign-in sheet. That is why DHCP snooping must be running in the same VLAN before DAI can do its job on DHCP clients.

Trusted ports

Not every port should be checked. Ports that lead to routers and to other switches carry ARP for many devices whose leases were never seen on that port, so checking them would block legitimate traffic. You mark those uplinks as trusted, and DAI skips the check on them:

`` ip dhcp snooping ip dhcp snooping vlan 10 ip arp inspection vlan 10 interface g0/1 ip dhcp snooping trust ip arp inspection trust ``

Here g0/1 is the uplink toward the router; the access ports stay untrusted.

Try it yourself

In Cisco Packet Tracer (free with a Cisco Networking Academy account), connect two PCs and a router to one switch. Run a DHCP pool for 10.0.0.0/24 on the router, enable DHCP snooping and DAI for the VLAN on the switch, and trust the uplink to the router for both features. Set the PCs to DHCP, then run show ip dhcp snooping binding on the switch and compare each entry with the PC's own ipconfig output: port, IP and MAC should all line up. Then ping the gateway from each PC and check show ip arp inspection statistics to see the ARP messages the switch has checked.

Good to know

  • CCNA 5.7 covers configuring and verifying Layer 2 security features: DHCP snooping, dynamic ARP inspection and port security. EP29 covers ARP, EP58 port security and EP59 DHCP snooping.
  • DAI intercepts ARP requests and replies on untrusted ports in the VLANs where it is enabled (ip arp inspection vlan <n>) and checks the sender IP and MAC against the DHCP snooping binding table; packets without a valid binding are dropped and logged.
  • All ports are untrusted by default. Uplinks toward routers and other switches are usually set with ip arp inspection trust.
  • Hosts with static IP addresses have no snooping binding, so they need an ARP ACL; the short skips this.
  • DAI can also rate-limit ARP on a port and err-disable a port that goes over the limit.
  • The fake ARP reply is ARP spoofing (ARP poisoning), a man-in-the-middle attack.
  • "Guard with a sign-in sheet" is an analogy. 10.0.0.x are private example addresses, and MAC-A, MAC-B and MAC-C are placeholders for real MAC addresses.

For CCNA learners

CCNA exam topic 5.7 is configure and verify Layer 2 security features. Know what DAI checks (ARP sender IP and MAC on untrusted ports), where its bindings come from (the DHCP snooping table) and which ports you trust (uplinks to routers and other switches).

Answer to the comment question

Drop. Port 5's entry in the DHCP snooping table binds 10.0.0.25 to MAC-A. The ARP reply from port 5 claims "10.0.0.1 is at MAC-A", and there is no binding that pairs 10.0.0.1 with MAC-A on that port. With no matching binding, DAI drops the reply and logs it, so the other PCs never learn the fake gateway address.

Test your knowledge

Quick quiz: "Dynamic ARP Inspection"

4 multiple-choice questions. Pick one answer for each, then check how you did.

1What does a fake ARP reply in an ARP spoofing attack claim?
2What does Dynamic ARP Inspection compare ARP messages against?
3Which ports are usually set as trusted for DAI?
4An ARP reply on an untrusted port matches the port's DHCP snooping entry. What happens?

Sources

Video transcript

What stops a laptop from lying, "I'm the router," and stealing your traffic?

ARP links IP addresses to MAC addresses. An attacker can fake an ARP reply: the gateway's IP is at my MAC.

Dynamic ARP Inspection checks every ARP message on untrusted ports, like a guard checking name tags against a sign-in sheet.

The sign-in sheet is the DHCP snooping table: which IP and MAC were handed out on which port.

If the ARP message matches, it passes. If not, the switch drops it. Ports toward routers and other switches are trusted and skip the check.

Port 5's sign-in entry says its laptop is .25. Its ARP reply claims to be .1, the gateway. Forward or drop? Comment your answer below!

That's your byte.

More from Network Bytes

All Network Bytes lessons