ARP (Address Resolution Protocol) is used to associate a device's IP address with its MAC address in local area networks (LANs). It maintains an ARP table that Linux systems use for efficient layer 2 packet routing.
Use arp
or ip neigh
to inspect the table:
arp -a
ip neigh show
If arp
is missing, install:
sudo apt install net-tools
Clear cached entries:
sudo ip -s -s neigh flush all
arpwatch
is a monitoring daemon that watches ARP activity and logs changes—such as new MAC addresses appearing or IPs switching hardware. It's useful for detecting network anomalies and ARP spoofing attempts.
sudo apt install arpwatch # Debian / Ubuntu
sudo yum install arpwatch # CentOS / RHEL
Start monitoring a specific interface (e.g., eth0):
sudo arpwatch -i eth0 -f /var/lib/arpwatch/arp.dat
Optional: send alert emails
sudo arpwatch -i eth0 -e [email protected]
New device:
arpwatch: new station 192.168.1.20 [00:11:22:33:44:55] on eth0
MAC change for existing IP:
arpwatch: changed ethernet address for 192.168.1.20 from 00:11:22:AA:BB to 00:11:22:33:44:55
arp
and arpwatch
are valuable Linux tools for local network diagnostics and security. Monitoring ARP behavior can reveal hidden changes in network structure, assist with asset tracking, and mitigate spoofing threats. They're especially important in sensitive networks and data centers.