ARPD(8)

๐ŸŽ€ ARPD(8) ๐ŸŽ€

System Manager's Manual โœจ

๐Ÿ’– NAME ๐Ÿ’–

arpd - userspace arp daemon. ๐Ÿฆ‹

๐Ÿงš SYNOPSIS ๐Ÿงš

Usage: arpd [ -lkh? ] [ -a N ] [ -b dbase ] [ -B number ] [ -f file ]
[-p interval ] [ -n time ] [ -R rate ] [ <INTERFACES> ]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so the arpd daemon is literally a collector bestie ๐Ÿ’… It gathers gratuitous ARP information and saves it to local disk, then feeds it back to the kernel whenever it's asked. Why? Because the kernel's ARP cache is pretty small, and this stops it from having to shout into the void with redundant broadcasts over and over. Lowkey genius. โœจ

๐Ÿ’œ OPTIONS ๐Ÿ’œ

  • -h, -? โ€” Print help. Your lifeline when you forget everything ๐Ÿ™ˆ
  • -l โ€” Dump the arpd database to stdout and then exit. The output has three columns: the interface index, the IP address of the interface, and the MAC address of the interface. Negative entries for dead hosts show up too ๐Ÿ’€ For those, the MAC address gets swapped out for the word FAILED, then a colon, then the most recent time when the host was proven to be dead.
  • -f <FILE> โ€” Read and load an arpd database from FILE, which is a text format similar to what -l dumps. It exits after loading, and if -l is also given it'll list the resulting database first. If FILE is -, stdin gets read instead to grab the ARP table ๐Ÿซถ
  • -b <DATABASE> โ€” The location of the database file. The default spot is /var/lib/arpd/arpd.db ๐Ÿ“
  • -a <NUMBER> โ€” With this option, arpd doesn't just passively listen for ARP packets on the interface, it also sends broadcast queries itself. NUMBER is how many of those queries to make before a destination is considered dead. Now the tea: if arpd is started as a kernel helper (like with app_solicit enabled in sysctl or even with -k) and you skip this option, and it still hasn't learned enough info, you might see 1 second gaps in service. Not fatal, but not good ๐Ÿ˜ญ
  • -k โ€” Suppress sending broadcast queries by the kernel. This one only makes sense alongside -a. ๐Ÿ”ฅ
  • -n <TIME> โ€” Sets the timeout of the negative cache. When resolution fails, arpd stops trying to resolve that same destination for this period. This only makes sense together with -k. The timeout shouldn't be way longer than the boot time of a typical host that doesn't support gratuitous ARP. The default is 60 seconds โฐ
  • -p <TIME> โ€” How long to wait, in seconds, between polling attempts to the kernel ARP table. TIME can be a floating point number. The default is 30 โœจ
  • -R <RATE> โ€” The maximal steady rate of broadcasts arpd sends, in packets per second. The default is 1 ๐Ÿฆ‹
  • -B <NUMBER> โ€” The number of broadcasts arpd sends back to back. The default is 3. Together with -R, this keeps the number of broadcast ARP queries from going over B+R*T in any interval of time T. Strict but fair ๐Ÿ’…

INTERFACES is a list of names of networking interfaces to watch. If you don't give any, arpd monitors all of them. In that case arpd does not adjust sysctl parameters, so it's assumed you'll do that yourself after arpd starts ๐Ÿงš

๐ŸŒˆ SIGNALS ๐ŸŒˆ

โš ๏ธ Only SIGINT and SIGTERM (graceful exit), SIGHUP (sync), and SIGUSR1 (stats) have defined behavior here. Any other signal is undefined and may corrupt the database and leave the sysctl parameters in an unpredictable state. Not it. ๐Ÿ’€

When arpd gets a SIGINT or SIGTERM, it exits gracefully, syncing the database and restoring the adjusted sysctl parameters. On a SIGHUP, it syncs the database to disk. With SIGUSR1, it sends some statistics to syslog. The effect of any other signals is undefined. In particular, they may corrupt the database and leave the sysctl parameters in an unpredictable state.

๐ŸŽ€ NOTE ๐ŸŽ€

So for arpd to work as an ARP resolver, the kernel has to be compiled with the option CONFIG_ARPD. Also, if the interface list isn't given on the command line, the variable app_solicit on the interfaces you care about should be in /proc/sys/net/ipv4/neigh/*. If that isn't set up, arpd still collects gratuitous ARP information in its database, so it's not a total loss ๐Ÿซถ

๐Ÿ“ EXAMPLES ๐Ÿ“

arpd -b /var/tmp/arpd.db

Start arpd to collect gratuitous ARP, without messing with kernel functionality. Chill mode ๐Ÿง˜

killall arpd ; arpd -l -b /var/tmp/arpd.db

Look at the result after some time. Patience, bestie โณ

arpd -b /var/tmp/arpd.db -a 1 eth0 eth1

Enable the kernel helper and leave the leading role to the kernel ๐Ÿ‘‘

arpd -b /var/tmp/arpd.db -a 3 -k eth0 eth1

Completely replace kernel resolution on interfaces eth0 and eth1. In this case the kernel still does unicast probing to validate entries, but all the broadcast activity is suppressed and handled under the authority of arpd. Main character energy ๐Ÿ’œ

This is the mode in which arpd normally is supposed to work. It is not the default, to prevent occasional enabling of too aggressive a mode. Safety first, periodt ๐Ÿ’…


okay that's the whole tea, bestie ๐Ÿซถ ARPD(8) was last updated on 28 June, 2007, and it's giving System Manager's Manual vibes all the way through โœจ๐Ÿฆ‹๐ŸŒˆ