arpwatch keeps track of Ethernet/IP address pairings.
It syslogs activity and reports certain changes via email. arpwatch uses pcap to listen for arp packets on a local ethernet interface.
Author: Craig Leres
arpwatch [-CdFNpqsvzZ] [-D arpdir] [-f datafile] [-i interface] [-P pidfile] [-w watcher@email] [-W watchee@email] [-n net[/width]] [-x net[/width]] [-r file]
The -C flag (default) uses compact padded ethernet addresses in arp.dat, e.g. 0:8:e1:1:2:d6.
The -d flag is used enable debugging. This also inhibits forking into the background and emailing the reports. Instead, they are sent to stderr.
The -D flag is used to specify the arpwatch working directory. This defaults to /usr/local/arpwatch.
The -f flag is used to set the ethernet/ip address database filename. The default is arp.dat.
The -F flag is prevents arpwatch from forking causing it to run in the foreground.
The -i flag is used to override the default interface.
The -n flag specifies additional local networks. This can be useful to avoid "bogon" warnings when there is more than one network running on the same wire. If the optional width is not specified, the default netmask for the network's class is used.
The -N flag disables reporting any bogons.
The -p flag disables promiscuous mode.
The -P flag specifies the pidfile.
The -q flag suppresses reports being logged or printed to stderr.
The -r flag is used to specify a savefile (perhaps created by tcpdump or pcapture) to read from instead of reading from the network. In this case arpwatch does not fork. Note that an empty arp.dat file must be created before the first time you run arpwatch.
The -s flag suppresses reports sent by email.
The -v flag disables the reporting of VRRP/CARP ethernet prefixes as described in RFC5798 (00:00:5e:00:01:xx).
The -w flag is used to specify the target address for email reports. The default is root.
The -W flag is used specifies the from address for email reports. The default is root.
The -z flag disables reporting 0.0.0.0 changes, helpful in busy DHCP-served networks.
The -Z flag uses zero padded ethernet addresses in arp.dat, e.g. 00:08:e1:01:02:d6.
Here's a quick list of the report messages generated by arpwatch (and arpsnmp):
This ethernet/ip address pair has been used for the first time six months or more.
The ethernet address has not been seen before.
The ethernet address has changed from the most recently seen address to the second most recently seen address. (If either the old or new ethernet address is a DECnet address and it is less than 24 hours, the email version of the report is suppressed.)
changed ethernet address
The host switched to a new ethernet address.
Here are some of the syslog messages; note that messages that are reported are also sysloged.
The mac ethernet address of the host is a broadcast address.
The ip address of the host is a broadcast address.
The source ip address is not local to the local subnet.
The source mac or arp ethernet address was all ones or all zeros.
The source mac ethernet address didn't match the address inside the arp packet.
reused old ethernet address
The ethernet address has changed from the most recently seen address to the third (or greater) least recently seen address. (This is similar to a flip flop.)
suppressed DECnet flip flop
A "flip flop" report was suppressed because one of the two addresses was a DECnet address.
default ethernet/ip address database
vendor ethernet block list
Explanation of terms on Wikipedia
arpwatch Usage Example
Run the program in debug mode, without creating forks in the background and sending messages by mail. Instead, messages are sent to stderr (standard error output).
sudo /usr/sbin/arpwatch -d
To run the program as a daemon, open and edit the /etc/arpwatch.conf file, write the name of the interface for monitoring there, set the options and the name of the user to whom to send emails about changes.
Then start the service:
sudo systemctl start arpwatch
Different distributions may have different versions of arpwatch and the example shown above may not work.
An example of a working launch of arpwatch on Kali Linux.
Create a file in which the program will store its data:
Run a command like this:
sudo /usr/sbin/arpwatch -d -i INTERFACE -f /tmp/arp.dat
sudo /usr/sbin/arpwatch -d -i eth0 -f /tmp/arp.dat
It may give the following error:
arpwatch: Warning: Not compiled with -DDEBUG
This error means that arpwatch was compiled without the debug option enabled.
You can run the program without this option:
sudo arpwatch -i INTERFACE -f /tmp/arp.dat
In this case, arpwatch will immediately go to the background and it will not be clear whether the program is working or not. To check that the arpwatch process is running:
ps -e | grep arpwatch
To see the messages displayed by arpwatch, run the command:
journalctl -b | grep arpwatch
How to install arpwatch
Installation on Kali Linux
sudo apt install arpwatch
Installation on Debian, Linux Mint, Ubuntu
sudo apt install arpwatch
Installation on BlackArch
The program is pre-installed on BlackArch. To install in minimal builds run:
sudo pacman -Si arpwatch