ip-sentinel(8)
okay bestie, sit down, we're reading ip-sentinel(8) โ straight out of the System Manager's Manual. Yes it's a daemon page. Yes it's got warnings. Yes we're doing this together. ๐ซถ
โจ NAME โจ
ip-sentinel โ keeps your IP space clean ๐
๐ธ SYNOPSIS ๐ธ
ip-sentinel [--user|-u username] [--group|-g groupname] [--chroot|-r
dir] [--ipfile|-i file] [--pidfile|-p file] [--logfile|-l file]
[--errfile|-e file] [--mac mac] [--llmac mac] [--direction dir]
[--action program] [--nofork|-n] [--help|-h] [--version] interface
๐ฆ DESCRIPTION ๐ฆ
So. ip-sentinel boots up a daemon whose whole entire job is stopping unauthorized usage of IPs inside an ethernet broadcastdomain โ and it does that by answering ARP requests. ๐ฏ
The way it works is lowkey genius: once the requesting party gets that faked reply, it stores the MAC address in its ARP-table, and from then on it sends all its future packets to that invalid MAC. Which means the IP is justโฆ unreachable. Rendered useless. Ghosted. ๐
After startup it opens its logfiles, goes into a chroot jail, drops privileges, and forks itself into background by default. Every one of those operations is configurable with the options down below, bestie. โจ
Warning: with an uncareful configuration,ip-sentinelcan bring down the entire network and your physical presence at the ip-sentinel machine and/or the switch will be required to fix it. ๐ญ Some switches can show an unexpected behavior and even crash when the special802.*mac-addresses get used. So likeโฆ be careful. fr fr.
๐ OPTIONS ๐
--user|-u usernameand--group|-g groupnameโ after doing basical initializations, the program drops its privilegies by changing its user and group ID. Theusernameandgroupnameparameters decide these new IDs, and they have to be an alphanumeric username/groupname or a numeric uid/gid. ๐ซถ
Attention: if you've got a dietlibc-compiled version on a system that uses remote NSS (like LDAP, NIS) for passwd-lookups, you will have to use numeric IDs. no cap.
--chroot|-r dirnameโ tells the program which directory to go into and callchroot()in, after it finishes its initialization. Default? It's the homedirectory of the user you specified with the--useroption. ๐--ipfile|-i filenameโ sets the name of the configuration file holding the list of forbidden IPs. This name is relative to the chroot, and it'sips.cfgby default. This file gets reread automatically after changes, so you can just edit and go. โจ--pidfile|-p filenameโ sets the file where the pid of the daemon gets written. This filename is relative to the root-filesystem, and it's/var/run/ip-sentinel.runby default. ๐--logfile|-l filenameโ sets the file where normal operations get logged. "Normal operations" means stuff like an ARP-reply for a forbidden IP. This filename is relative to the root-filesystem, and it's/var/log/ip-sentinel.outby default. ๐--errfile|-e filenameโ sets the file where error-conditions get logged. Error-conditions are things like detected DOS attacks (aka bombing the ip-sentinel with ARP-requests) or errors in the configuration file. This filename is relative to the root-filesystem, and it's/var/log/ip-sentinel.errby default. ๐จ--nofork|-nโ prevents the daemon from going into background after initialization. This one's useful when you're using advanced init-concepts like minit (http://www.fefe.de/minit/). ๐--direction dirโip-sentinelcan answer both requests asking for an intruder's address, and requests coming from an intruder asking for official addresses. This parameter says which requests shall be answered. Possible values areFROM(requests from intruders),TO(requests to intruders) andBOTH. The current default value isTO, but it will probably change toBOTHin future versions. ๐--mac macโ usemacas the default faked mac-address; see below for the possible values. This parameter can be overriden in the ipfile for each questionable IP. The default value isRANDOM. ๐ฒ--llmac macโ specifies the mac-address used in the link-level headers when answering requests from intruders. On top of the values described below,ip-sentinelalso understands theSAMEstring, which means the address from the ARP-header will be used. If you're not using theFROMorBOTHdirections, the assigned value won't have any effect. The default isLOCAL. ๐--poisonโ when an intruder sends a request from a registered ip address and this option is set,ip-sentinelwill send ARP replies that are poisoning this ip. When the@!srcmacsyntax is used for the questionable ip, thesrcmacis used as the is-at mac. Else, the mac specified by the--macoption is used. โ ๏ธ
This option takes an affect only when --destination BOTH or FROM is specified.
--action programโ executeprogramwhen a faked ARP reply gets generated. It will be called with 6 arguments:typeโ0when an intruder sent the request,1when a protected IP was requested, and-1else (should never happen) ๐spaโ the protocol address (IP) of the sourceshaโ the hardware address (MAC) of the sourcetpaโ the protocol address (IP) of the targetthaโ the hardware address (MAC) of the targetmacโ the generated MAC address
The program will be executed only without evaluating its return value or something else. Also please note that the program will be executed in the chroot with restricted rights. ๐
--help|-hโ prints help message and exits. ๐ซถ--versionโ prints the version of the program and exits. โญinterfaceโ specifies the network-interface whereip-sentinellistens for ARP-requests and sends ARP-replies. It's a name like"eth0"; aliases like"eth0:1"are not possible. ๐ซ
and that's it for this part, bestie โ the rest is coming, don't go anywhere ๐ธ
๐ CONFIGURATION FILE ๐
okay bestie, so where does this file even live? The location of the configfile is relative to the chosen chroot-directory. Its default is baked in at compilation time, but you can override it with the --ipfile option. ๐
The content of this file follows this syntax, and I'm gonna walk you through literally every single form because there are no skips on this tour:
ip [mac]โ says thisipshall be blocked. And "blocked" means ARP-replies will be generated telling everyone that the IP addressiphas the MACmac. Nomacgiven? A random one gets chosen for you. ๐ฒ
โ ๏ธ Attention: assigning a MAC in a switched environment will not have the desired effect, because the switch will be confused when receiving ARP-replies for the same IP on different ports (this one of the bad-host and this one of the ip-sentinel host). Yeah. Chaos.
Examples are: 192.168.42.23 11:22:33:44:55:66 or 10.0.0.0.
ip@[!]srcmac [mac]โ same energy as above, but when receiving ARP-requests, the entire sender-address (IP and MAC) gets compared against theipandsrcmacvalues. This setting affects packets from intruders only; ip-sentinel will not generate replies whenipis requested. ๐ต๏ธโ๏ธ
When the srcmac is negated with !, only addresses from this ip which are not having this mac will be matching.
Examples are: 10.0.0.1@0:1:2:3:4:5 or 10.0.0.2@!a:b:c:d:e:f.
*@srcmac [mac]โ every host using thesrcmacwill be blocked unless there is a matchingip@srcmacspecification. Heads up: this option does not support!modifiers. ๐ โ๏ธnet/mask [mac]/net/mask@[!]srcmac [mac]โ says IPs of an entire network shall be blocked. See above for the meaning of "blocked". You can specify a MAC address; else a random one will be generated. โจ
Examples are: 169.0.0.0/8, 192.168.8.15/255.255.65.31 or 192.168.23.42/26 a:b:c:d:e:f.
!ip/!ip@[!]srcmacโ the given IP addressipwill be ignored. By default, any not specified address will be ignored, but when you've got blocked netmasks it may be useful to allow certain IPs. ๐ซถ
An example is: !192.168.23.42
!net/mask/!net/mask@[!]srcmacโ tells that IPs of the given network shall be ignored.
Examples are: !192.168.1.0/255.255.255.0 or !0.0.0.0/0 (the default).
# comment(and empty lines) โ a comment; will be ignored. Bestie, your notes are safe. ๐
To be switch-friendly, there are only a few random MACs possible, and they're having the format de:ad:be:ef:00:XX. Within a short timespan only 32 values are possible for XX.
When having overlapping networks and/or single IPs, the one with the most specified netmask (count of 1's) takes precedence. When netmasks are equal, networks which are using the @srcmac or @!srcmac syntax are taking precedence over those without source-macs. This @... rule does not apply to IPs. And the behavior is unspecified when having overlapping networks with the same count of 1's and @... specification, or when having duplicate IPs. ๐
โก PERFORMANCE โก
The lookup of single IPs has a complexity of O(log n) and this of netmasks a complexity of O(n). Slay, math. ๐งฎ
๐ SPECIAL MAC ADDRESSES ๐
Beside the usual hex-octets-delimited-by-colons mac addresses, ip-sentinel understands some special strings both on the commandline and in the configuration file:
LOCALโ expands to the mac-address of the used interface. ๐RANDOMโ means a random mac-address which is newly calculated on every usage. ๐ฐ802.1dโ expands to01:80:C2:00:00:00which is the "Bridge Group Address".802.3xโ expands to01:80:C2:00:00:01which is the "IEEE Std. 802.3x Full Duplex PAUSE operation". This MAC address will be blocked by a lot of switches and will probably become the default in future versions. ๐ฅ
The 802.* addresses are having a special meaning for some switches, and packets having them as destination-address will be dropped by the switch instead of flooding all ports. But it depends on the used switch how/if these macs are honored. ๐คทโ๏ธ
๐ Some switches can show an unexpected behavior or even crash if the special 802.* mac-addresses will be used. No cap, be careful.
๐ RANGES ๐
Except in comments, it is possible to specify ranges everywhere in the configuration file. These ranges are having the format {from-to} or {item1,item2,...,itemN}. The first format includes any number beginning at from till to (inclusive), while the latter format expands to the listed items only. The expansion happens on a line-level and it is possible to use more than one range per line, so that
192.168.0.{1-3} 0:0:0:0:0:1
192.168.1.{1,3} 0:0:0:0:0:2
192.168.{2,4}.{1-3} 0:0:0:0:0:3
is the same like writing
192.168.0.1 0:0:0:0:0:1
192.168.0.2 0:0:0:0:0:1
192.168.0.3 0:0:0:0:0:1
192.168.1.1 0:0:0:0:0:1
192.168.1.3 0:0:0:0:0:1
192.168.2.1 0:0:0:0:0:3
192.168.2.2 0:0:0:0:0:3
192.168.2.3 0:0:0:0:0:3
192.168.4.1 0:0:0:0:0:3
192.168.4.2 0:0:0:0:0:3
192.168.4.3 0:0:0:0:0:3
โ ๏ธ Because there can be created very much entries with a single line (e.g. {0-255}.{0-255}.{0-255}.{0-255} would cover the entire IPv4 internet), ranges should be used sparely. When possible, large ranges should be expressed with netmasks. Bestie, don't do that to your config. ๐ญ
๐ EXAMPLE ๐
0.0.0.0/0 ## Block anything
!192.168.0.0/24 ## Allow IPs of the form 192.168.0.*
192.168.0.0 ## but block 192.168.0.0
192.168.0.1 a:b:c:d:e:f ## use a special mac for 192.168.0.1
192.168.0.2 802.1d ## and 01:80:C2:00:00:00 for 192.168.0.2
10.0.0.1@a:a:a:a:a:a
10.0.0.2@!1:1:1:1:1:1
*@b:b:b:b:b:b ## block MAC b:b:b:b:b:b regardless of the IP
This setup will not send ARP-replies for the IPs 192.168.0.{3-255} but when a host tries to use e.g. 169.254.145.213, ip-sentinel will tell that this IP has a MAC of de:ad:be:ef:00:XX. iconic behavior honestly. โจ
When an intruder is at 10.0.0.1 and uses the mac a:a:a:a:a:a:, a faked reply will be generated. Users at the same ip but another mac will be ignored. ๐
In opposite, users with ip 10.0.0.2 and mac 1:1:1:1:1:1 will be ignored but intruders with other macs (e.g. 2:2:2:2:2:2) are getting faked replies. When --poision is used, ip-sentinel will generate a 10.0.0.2 is at 1:1:1:1:1:1 arp-reply to a broad address. ๐
๐ฆ SEE ALSO ๐ฆ
RFC 826, IEEE Std 802.1D
๐ AUTHOR ๐
Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
and that's a wrap bestie ๐ซถ this whole thing is ip-sentinel version 0.11, dated Dec 15 2004 โ shoutout to the legend Enrico Scholz, and yeah the page itself signs off as ip-sentinel(8). go forth and block those IPs, mwah ๐
๐
๐ฆ where this page comes from
- fedora 43: ip-sentinel 0.12-1933.fc43 ยท GPL-2.0-only
- fedora 44: ip-sentinel 0.12-1934.fc44 ยท GPL-2.0-only
- Copyright (C) 2002,2003,2004,2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms