DHCP Snooping
DHCP snooping validates DHCP messages on a switch to prevent rogue DHCP servers. Without it, an attacker can run a fake DHCP server that assigns client IPs pointing to the attacker as the default gateway (man-in-the-middle setup). DHCP snooping designates switch ports as trusted or untrusted. Trusted ports: ports connected to legitimate DHCP servers or uplinks — DHCP server responses (OFFER, ACK) are allowed from these ports. Untrusted ports: access ports where end devices connect — DHCP server responses arriving on these ports are dropped.
DHCP snooping binding table: DHCP snooping records every IP address assignment — client MAC address, IP address, VLAN, lease time, and switch port. This table is used by DAI and IP Source Guard. If a client receives 192.168.1.100, the binding table records: port 0/5, VLAN 10, MAC 00:11:22:33:44:55, IP 192.168.1.100.
Dynamic ARP Inspection (DAI)
DAI uses the DHCP snooping binding table to validate ARP packets. When an ARP packet arrives on an untrusted port, DAI checks whether the source IP and MAC in the ARP reply match a valid binding table entry. If the ARP maps a MAC to an IP that DHCP didn't assign to that port, DAI drops the packet — preventing ARP poisoning.
DAI trusted vs untrusted ports: same concept as DHCP snooping — trusted ports (uplinks, servers with static IPs) are not inspected. Static ARP entries can be added to the binding table for devices with static IPs (servers, gateways) that don't appear in DHCP snooping records.
Without DAI: an attacker can send fake ARP replies mapping the default gateway's IP to the attacker's MAC — all traffic intended for the gateway goes to the attacker instead. With DAI: the fake ARP is rejected because the binding table shows the gateway's IP belongs to the gateway's MAC on a specific trusted port.
IP Source Guard
IP Source Guard: another feature using the DHCP snooping binding table. Filters traffic on untrusted ports to allow only traffic from IP addresses that appear in the binding table. Prevents IP spoofing at Layer 2 — a host cannot use a different IP than what DHCP assigned. Complements DAI by enforcing IP address ownership at the access layer.