ARPWATCH(8)

πŸ’– ARPWATCH(8) β€” the arpwatch page, but make it make sense πŸ’–

okay bestie, listen. this is the manual for arpwatch β€” yes it's section 8, yes it's a system admin tool, no it does not have to be boring. it keeps track of ethernet/ip address pairings, and honestly? it's giving watchful older sibling energy. let's get into it 🫢


✨ SYNOPSIS ✨

arpwatch [-CdFNpqsvzZ] [-D arpdir] [-f datafile] [-i interface]
         [-P pidfile] [-w watcher@email] [-W watchee@email]
         [-n net[/width]] [-x net[/width]] [-r file] [-u username]

like, that's the whole vibe in one block. every flag gets its moment below, don't worry πŸ’…


🌸 DESCRIPTION 🌸

so what does arpwatch actually do? it keeps track of ethernet/ip address pairings. it syslogs activity and reports certain changes via email. and it does all of this using pcap(3) to listen for arp packets on a local ethernet interface. no cap, that's the whole premise.

arp.dat contains three or four fields. let's break it down:

  1. first is the ethernet mac address
  2. second is the IPv4 address
  3. third is the time expressed in seconds since midnight, January 1, 1970

and the optional fourth field? that's the short hostname derived from PTR record of the ip address when a mac/ip pair is first seen. important lore: it is never updated and was intended to be a breadcrumb to determine the origin of a mac/ip pair. so it's basically a little fossil of the first time that pairing showed up πŸ¦‹


πŸ’… OPTIONS πŸ’…

okay this is the section everyone scrolls to. buckle up, there's a lot, and yes we're doing all of them.

  • -C β€” uses compact padded</> ethernet addresses in arp.dat, e.g. 0:8:e1:1:2:d6.
  • -d β€” enables debugging. also lowkey inhibits forking into the background and emailing the reports. instead, they are sent to stderr. so it just yells directly at you, which is honestly kind of iconic.
  • -D arpdir β€” used to specify the arpwatch working directory. this defaults to /var/lib/arpwatch.
  • -f datafile β€” used to set the ethernet/ip address database filename. the default is arp.dat.
  • -F β€” prevents arpwatch from forking, causing it to run in the foreground. main character energy, no backgrounding.
  • -i interface β€” used to override the default interface.
  • -n net[/width] β€” 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.
  • -N β€” disables reporting any bogons. bye bogon drama πŸ‘‹
  • -p β€” disables promiscuous mode.
  • -P pidfile β€” specifies the pidfile.
  • -q β€” suppresses reports being logged or printed to stderr. shhh 🀫
  • -r file β€” used to specify a savefile (perhaps created by tcpdump(8) or pcapture(8)) to read from instead of reading from the network. in this case arpwatch does not fork. note that too.
  • -s β€” suppresses reports sent by email.
  • -u username β€” causes arpwatch to drop root privileges and change user ID to username and group ID to that of the primary group of username. this is recommended for security reasons. fr fr, do this one.
  • -v β€” disables the reporting of VRRP/CARP ethernet prefixes as described in RFC5798 (0:0:5e:0:1:xx).
  • -w watcher@email β€” used to specify the target address for email reports. the default is root.
  • -W watchee@email β€” used to specify the from address for email reports. the default is root.
  • -z β€” disables reporting 0.0.0.0 changes, helpful in busy DHCP-served networks. honestly a lifesaver in those environments πŸ“
  • -Z β€” uses zero padded</> ethernet addresses in arp.dat, e.g. 00:08:e1:01:02:d6.
⚠️ okay important setup note bestie: an empty arp.dat file must be created before the first time you run arpwatch. also, the default directory (where arp.dat is stored) must be owned by username if the -u flag is used. don't skip this, it will not work and you will be sad 😭

πŸŽ€ REPORT MESSAGES πŸŽ€

here's a quick list of the report messages generated by arpwatch(8) (and arpsnmp(8)):

  • new activity β€” this ethernet/ip address pair has been used for the first time six months or more.
  • new station β€” the ethernet address has not been seen before.
  • flip flop β€” 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.

🌈 SYSLOG MESSAGES 🌈

here are some of the syslog messages; note that messages that are reported are also syslog'ed.

  • ethernet broadcast β€” the mac ethernet address of the host is a broadcast address.
  • ip broadcast β€” the ip address of the host is a broadcast address.
  • bogon β€” the source ip address is not local to the local subnet.
  • ethernet broadcast β€” the source mac or arp ethernet address was all ones or all zeros. (yes, this one is listed twice in the original. we don't question it, we respect it.)
  • ethernet mismatch β€” 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.

⭐ SIGNALS ⭐

normally arpwatch updates arp.dat once every 15 minutes. the SIGHUP signal causes it to update immediately. so if you're impatient, that's your moment πŸ‘‘


πŸ¦‹ FILES πŸ¦‹

/var/lib/arpwatch  default directory
arp.dat            default ethernet/ip address database
ethercodes.dat     vendor ethernet block list

πŸ’œ SEE ALSO πŸ’œ

arpsnmp(8), arp(8), bpf(2), tcpdump(8), pcapture(8), pcap(3)


🧚 AUTHORS 🧚

Craig Leres of the Lawrence Berkeley National Laboratory Network Research Group, University of California, Berkeley, CA.

the current version is available via anonymous ftp:

ftp://ftp.ee.lbl.gov/arpwatch.tar.gz

πŸ™ˆ BUGS πŸ™ˆ

please send bug reports to ⟨arpwatch@ee.lbl.gov⟩.

attempts are made to suppress DECnet flip flops but they aren't always successful.

most error messages are posted using syslog.


and that's the whole page, bestie πŸ’– this one's dated 2 December 2023, and it's the ARPWATCH(8) page β€” BSD-style source, section 8, all yours. go forth and watch those arps, you absolute legend πŸŒŸπŸŽ€βœ¨

πŸ“¦ where this page comes from