TL;DR
ARP poisoning (or spoofing) lets attackers intercept network traffic by linking the wrong MAC address to an IP address. This guide shows you how to detect and prevent these ‘man-in-the-middle’ attacks on your network, using static ARP entries and tools like arpwatch.
Preventing ARP Poisoning Attacks
- Understand the Problem: ARP (Address Resolution Protocol) maps IP addresses to MAC addresses. Attackers send fake ARP messages to associate their MAC address with legitimate IP addresses, redirecting traffic through them.
- This allows them to eavesdrop on data or modify it before it reaches its destination.
- Static ARP Entries: The most reliable defence is to create static ARP entries for critical devices. This tells your computer to *always* use the specified MAC address for a given IP address, ignoring any conflicting messages.
- Find the correct MAC addresses: Use
arp -aon Windows or Linux/macOS to see existing mappings. Note down the MAC address of important devices (router, servers). - Add static entries (Windows): Open a command prompt as administrator and use:
arp -s 192.168.1.1 AA:BB:CC:DD:EE:FFReplace 192.168.1.1 with the IP address and AA:BB:CC:DD:EE:FF with the correct MAC address.
- Add static entries (Linux/macOS): Use:
sudo arp -s 192.168.1.1 AA:BB:CC:DD:EE:FFAgain, replace with the correct IP and MAC.
- Find the correct MAC addresses: Use
- Use ARP Monitoring Tools (arpwatch): arpwatch passively listens for ARP packets and logs any inconsistencies. It’s excellent for detecting attacks in real-time.
- Installation (Debian/Ubuntu):
sudo apt updatesudo apt install arpwatch - Configuration: Edit
/etc/arpwatch.confto set the interface to monitor (e.g., eth0, wlan0). The default settings are usually fine for a home network. - Start arpwatch:
sudo systemctl start arpwatch - Check logs: Logs are typically found in
/var/log/arpwatch.log. Look for entries indicating changed ARP mappings.
- Installation (Debian/Ubuntu):
- Port Security (Switches): If you have a managed switch, enable port security. This restricts which MAC addresses can connect to each port, preventing attackers from plugging in their devices.
- Consult your switch’s documentation for specific instructions – the process varies greatly between manufacturers.
- Regularly Review ARP Tables: Periodically check your ARP table (
arp -a) to ensure it contains only expected entries. - Network Segmentation: Separate critical devices onto their own network segment, limiting the impact of a successful attack. This is more advanced but highly effective.
Important Note: Static ARP entries need to be updated if IP addresses change. arpwatch provides detection, but doesn’t automatically correct incorrect mappings.

