ARP Spoofing and How to Defend Against It

Enterprise networks

ARP does not verify where a reply came from, and that design gap makes a local man-in-the-middle attack cheap enough to run from a single laptop. Understanding how the attack works is what lets you judge which defences actually help.

How the attack runs

The attacker usually wants the victim's gateway-bound traffic to arrive at their own machine. They do it by repeatedly sending forged ARP replies to the victim claiming that the gateway's IP maps to the attacker's MAC. Because ARP updates its cache on any reply, the victim's cache is poisoned and all outbound traffic goes to the attacker first.

At the same time the attacker sends forged replies toward the gateway claiming that the victim's IP maps to the attacker's MAC. Traffic in both directions now flows through them, which is a complete man-in-the-middle position. The attacker forwards the traffic onward, so the victim notices nothing beyond an extra hop.

From that position an attacker can sniff unencrypted traffic, alter cleartext content, attempt HTTPS downgrades, or simply drop packets for a denial of service.

How to detect it

Watch the gateway's MAC for changes. This is the most direct signal. Record the MAC the gateway normally presents and compare periodically:

ip neigh show | grep 192.168.1.1

Look for duplicate MAC addresses. If two different IPs in the ARP table point at one MAC and they should not be the same device, something is wrong:

arp -a | awk '{print $4}' | sort | uniq -d

Watch ARP reply frequency. On a healthy network ARP replies are sparse. A capture showing one MAC sending a high rate of unsolicited replies is a textbook sign of attack traffic.

Once you have a suspicious MAC, check its vendor on the lookup page. If the gateway's MAC has suddenly changed from a router vendor to a laptop adapter vendor, the conclusion is not subtle.

Defences that genuinely work

Dynamic ARP Inspection on switches. This is the only measure that solves the problem in the network itself. The switch observes DHCP assignments, builds a trusted IP-to-MAC table, then inspects every ARP packet passing through and drops the ones that do not match. It requires DHCP snooping alongside it and is a standard feature on enterprise switches.

Port security and static bindings. Limit how many MACs a switch port may learn, or bind a port to a specific MAC. Very practical for server access ports, too costly to maintain for a floor full of mobile devices.

Static ARP entries on hosts. Pin the critical mapping:

sudo ip neigh add 192.168.1.1 lladdr aa:bb:cc:dd:ee:ff dev eth0 nud permanent

Effective for a handful of important machines, but it does not scale and needs manual upkeep whenever gateway hardware is replaced.

End-to-end encryption. Strictly speaking this does not prevent spoofing; it makes spoofing worthless. HTTPS everywhere plus HSTS means an attacker in the middle still cannot read the content. It is the highest-return layer and should be a given.

What not to rely on

VLAN segmentation only shrinks the broadcast domain; the attack works unchanged inside one VLAN. MAC filtering offers nothing, because an attacker can set their MAC to whatever they like, as explained in why MAC filtering is not a security measure. Endpoint ARP-guard software can raise an alert, but it protects only the machine it runs on and tends to produce frequent false positives.

A sensible combination in practice is DHCP snooping with Dynamic ARP Inspection at the access layer, port security on server ports, and HTTPS across every service.

Related Articles
About the Author · Jondy

Network engineer with a background in enterprise network operations and security. Founded 7n4.cn in 2017. Questions or suggestions are welcome—get in touch.

← Back to Blog