ipguard(8)
π ipguard(8): the ARP-protecting bestie you didn't know you needed π
okay so real talk, ipguard is from the System Manager's Manual and honestly? it's giving protective bouncer energy for your Ethernet LAN. no cap.
πΈ NAME πΈ
ipguard β a whole tool designed to protect Ethernet LAN IP address space by ARP spoofing. literally what it says on the tin, bestie.
β¨ SYNOPSIS β¨
ipguard [-h] [-ajgrxziovd] [-f ethers] [-l log] [-p pid] [-m mac] [-c
filter] [-u seconds] [-k seconds] [-n fakes] [-t mseconds] [-b buf] [-s
user] <iface>
yeah it's a lot of letters. we'll get through it together, don't worry π«Ά
π¦ DESCRIPTION π¦
so here's the vibe: ipguard listens on the network for ARP packets. all the permitted MAC-IP pairs are listed in the ethers file. (that's the guest list, basically.)
if it receives a packet with a MAC-IP pair that is not in the ethers file? it sends an ARP reply with a configured fake address. and that will prevent the not-permitted host from working properly in the local ethernet segment. it's not mean, it's just... setting boundaries. π
π OPTIONS π
-f|-eethers β the ethers file. the format of theethersfile is described inethers.sampleand in ethers(5). default is/etc/ethers.-llog β the log file. default is/var/log/ipguard_<iface>.log.-ppid β the pid file. default is/var/run/ipguard_<iface>.pid.-mmac β the fake MAC address. this gets sent in the ARP reply as the MAC of an unlisted computer. default isde:ad:xx:xx:xx:xx, wherexis a random hex number. iconic honestly.-cfilter β a PCAP filter expression. default is no filter.-useconds β the update ethers interval. this is the time between checks of theethersfile for changes, and it rescans if there are any. default0means no autoupdate.-kseconds β periodically regenerate the fake MAC address. default0means no regenerate.-nfakes β the fake replies number. default is2replies.-tmseconds β time between fakes. default is50milliseconds.-bbuf β the MAC buffer size. that's the number of last bad MAC-IP pairs stored in the buffer. default0means no buffer.-suser β drop root privileges to user. default is do not drop.-aβ no address substitution. like0.0.0.0or00:00:00:00:00:00.-jβ disable first MAC-IP pair autodetect from the interface.-gβ default to grant. do not block a MAC or IP if both are not in the list.-rβ read only. do not send anything to the net, only listen. it's giving observer mode π-xβ duplex mode. send fake packets not only to the pirate but to the request for the pirate's address too.-zβ send broadcast who-has to fix all client ARP tables that got broked by the pirate. we're healing the group chat π«Ά-iβ hidden mode. do not block gratuitous ARP packets.-oβ promiscuous mode. enable promiscuous mode. usually useless (their words, not mine).-vβ verbose. some more messages.-dβ don't fork. do not go to background and write all events to STDERR.-ddβ debug.-dddβ debug more. the triple d, the final form.-hβ help. short command line parameters description.
π EXAMPLES π
normal recommended mode, duplex, broadcast fix, autoupdate /etc/ethers every 5 min:
ipguard -xz -u 300 fxp0
same but with a PCAP filter for only the 192.168.1.0/24 network:
ipguard -xz -u 300 -c 'net 192.168.0.0/24' fxp0
read-only mode and remember the last 100 MACs not listed in ethers. useful for initial MAC-IP pairs collection:
ipguard -r -b 100 -f /dev/null rl0
run ipguard for a while then killall -USR2 ipguard and you'll get a dump of the 100 most recent MAC-IP pairs. slay.
do not go to background and be more verbose, with a test ethers file:
ipguard -vd -f /tmp/ethers my1
π TIPS π
the first MAC-IP pair in ethers always must be self MAC/IP addresses. normally they're automatically taken from the listening interface. but if the -j option is specified, then make sure that the first pair is a source MAC/IP. iykyk.
if you want to start more than one ipguard on the segment for redundancy, you must specify the same fake MAC address for every ipguard and find a method to synchronize the ethers files. teamwork makes the dream work fr.
β SIGNALS β
SIGHUPβ rescanethersand reopen the log file.SIGUSR1β dump some tables and statistics.SIGUSR2β dump the new MAC-IP table in ethers(5) format.
π FILES π
/etc/ethersβ MAC-IP pairs list./var/log/ipguard_<iface>.logβ log file./var/run/ipguard_<iface>.pidβ pid file.
π₯ SEE ALSO π₯
RFC 826, ethers(5), tcpdump(1), pcap(3), libnet
π BUGS π
- Do not use wildcard IP
0.0.0.0inetherswith the-xoption. legal clients will be banned. discovered by irix. not the vibe. - strange bug with
libnet_get_hwaddr()isn't working on OpenBSD 4.0, discovered by irix. use the-joption. - ipguard will not prevent changing the MAC address along with the IP by the pirate. it's not a miracle worker bestie.
- signals
HUP,USR1orUSR2work only when received with a new ARP packet. it's not a bug, it's a feature. periodt. - when using the
-s <user>option, ipguard will drop root privileges after creating the log and pid files. so it will not delete or reopen these files. - probably too many command line options. another one or two and i'll put them all into
/etc/ethersas comments. (author is so real for this π) - ipguard was written as a simple small tool and the author hasn't any plans for support of external databases SQL/LDAP/Whatever. use scripts.
π AUTHOR π
SeaD <sead at deep.perm.ru>
okay that's the whole thing, bestie. this page is from the System Manager's Manual, source/version and date at the bottom: ipguard(8) π¦β¨ you're gonna do great out there with your ARP tables protected. muah π
π¦ where this page comes from
- arch rolling: ipguard 1.04-10 Β· GPL
- Copyright (c) 2010 SeaD <sead at deep.perm.ru>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms