ipband(8)
β¨ NAME β¨
ipband β IP bandwidth watchdog ππ¦Ίπ
This page is ipband(8), bestie. Buckle up.
π SYNOPSIS π
ipband -aAbcCdfFhJlLmMowPrtTv INTERFACE
πΈ DESCRIPTION πΈ
ipband is a pcap-based IP traffic monitor. It tallies per-subnet traffic and bandwidth usage, and the second the traffic for a specific subnet blows past the threshold you set, it starts detailed logging. If traffic stays high for a certain period of time, it generates a report for that subnet β and you can append that report to a file or e-mail it. When bandwidth usage drops back below the threshold, detailed logging for that subnet stops and the memory gets freed. Cleanup era. π§Ήβ¨
This utility is lowkey a lifesaver in a limited-bandwidth WAN environment (frame relay, ISDN, etc. circuits) β like, when certain links get saturated to the point where legit packets start getting dropped, it helps you pinpoint the offending traffic source. π
It can also be used to monitor an internet connection when you specify the range of local IP addresses (so you don't fire off reports about networks that aren't yours). No one needs that drama. π
Bandwidth is defined as the total size in kBytes of the layer 2 frames with IP packets passing the specified interface during the averaging period, divided by the number of seconds in that period. Math but make it cute. π
π COMMAND LINE OPTIONS π
interfaceβ the network interface we're reading data from.-asecs β averaging period in seconds, i.e. how often total traffic and bandwidth should be calculated. Default is60secs. β±οΈ-Aβ include threshold-exceeded accumulated time and percentage in the report. Heads up bestie: this option only works with preloaded subnets (that's the"subnet"directive), because otherwise subnet data gets deleted when bandwidth usage drops below threshold, to clear memory and cut down processing time. So if you don't preload, the data's just... gone. π-bkBps β bandwidth threshold in kBytes per sec. Default is7kBps, i.e.56kbps.-cfilename β use filename as the configuration file. Default is/etc/ipband.conf. Setting a different bandwidth threshold per subnet is only available through the config file β check thesubnetdirective in the CONFIGURATION FILE section below.-Cβ ignore the configuration file. Not today, config. π«-dlevel β debug level.0β no debugging;1β summary;2β subnet statistics;3β all packets captured. Default is0.-ffilterstr β use filterstr as the pcap filter. See the manual page fortcpdump. Also peep the EXAMPLES section below.-Fβ fork and run in the background. Default is to run in the foreground.-hβ print help and exit. π-Jnumber β packet length adjustment in bytes. Use this when the layer 2 frame sizes for the interfaceipbandis listening on and the interface you're measuring bandwidth for are different. Example: if you care about bandwidth usage on a router's frame relay interface with6bytes overhead (frame header + RFC1490 encapsulation) whileipbandis running on an ethernet interface with14bytes MAC frame, you could use the value-8for this option to get a more accurate bandwidth calculation. The number can be a positive or a negative integer. Negative values should not exceed the layer 2 frame size foripband's interface β so, like, you can't use-15in the example above. The default is0.-lfilename β if the-Moption (or themailtodirective in the config file) is set, this specifies the name of the file to be appended to the end of e-mail reports.-Lip-range[:ip-range[:ip-range[..]]] β this option says which network numbers should be considered local when collecting data and generating reports (fr, non-local networks aren't logged at all). It can be used instead of the config file's multiple"subnet"directives β but heads up, unlike that directive, there'd be a single bandwidth threshold, specified by the-boption. This option is perfect for monitoring internet connections when you do NOT want reports about someone else's networks. π
There can be many ip-ranges separated by colons. No spaces may appear in the argument. Each ip-range can be:
- a single IP address such as
192.168.1.1, which indicates a range of one, - a partial IP address such as
192.168.1.0, which indicates a range from192.168.1.0to192.168.1.255, - a low and high IP address separated by a hyphen (
-), - and a single IP address, a slash (
/) and an integer between0and32(a "net address"), which indicates a network.
If you run ipband with the debug option (-d), the program will print the entire list of IP ranges, so you can check their values. Vibe check your ranges, bestie. π
Here's a list of arguments to -L along with the corresponding range:
COMMAND: ipband eth0 -l 137.99.11
RANGE: 137.99.11.0-137.99.11.255
COMMAND: ipband eth0 -L 137.99.11:127.0.5/23
RANGE: 137.99.11.0-137.99.11.255,127.0.4.0-127.0.5.255
COMMAND: ipband eth0 -L 127.1.5.17-127.1.7.131
RANGE: 127.1.5.17-127.1.7.131
-mmaskbits β set number of subnet mask bits (1-32) for subnet traffic aggregation. Default is24(255.255.255.0).-Memail address(es) β send the detailed subnet report to the specified e-mail address(es). Multiple addresses must be separated by comma. π§-ofilename β filename to output the detailed subnet report. Default isipband.txtin the current directory.-wfilename β HTML report output file. Default isipband.htmlin the current directory. Thestyles.cssfile can be used in the same directory to customize its look and feel. β¨ (aesthetic customization, we love to see it)-Pβ do not use promiscuous mode on the network interface we're listening on.-rsecs β reporting period: the number of seconds the bandwidth threshold may be exceeded before it should be reported. Default is300seconds.-tnumber β limit the subnet report to a given number of per-host connections with the highest byte count (top connections). Default is no limit.-Tstring β MTA command string for mailing reports. Default is"/usr/sbin/sendmail -t -oi". The string is tokenized and passed directly toexec(), so shell metacharacters are not interpreted. π-vβ print version and exit.
π CONFIGURATION FILE π
On top of the command line options, you can use a configuration file. When ipband starts, it first looks for /etc/ipband.conf. You can also pass '-c' (see OPTIONS above) to specify a configuration file.
The options in the config file are specified by keyword/value pairs. Lines starting with # are ignored. (Comments! We stan. π¬)
Below is a list of config file options:
interfaceinterface β interface to read packets from.promisc {yes/no}β like the-Poption, this specifies whether or not to use promiscuous mode on the listening network interface. Promiscuous mode is the default.debug {0-3}β like the-doption, specifies the debug level.fork {yes/no}β like the-Foption, specifies whether or not to run in the background. Default isno.filterfilterstr β like the-foption, specifies the pcap filter.outfilefilename β like the-ooption, specifies the report file name. Default isipband.txtin the current directory.htmlfilefilename β like the-woption, HTML report output file. Default isipband.htmlin the current directory. Thestyles.cssfile can be used in the same directory to customize its look and feel.htmltitletitle β HTML title of the report output file.bandwidthkBps β like the-boption, bandwidth threshold in kBytes per second. Default is7.0kBps.averagesecs β like the-aoption, tellsipbandthe number of seconds to average per-subnet traffic and calculate bandwidth usage. Default is60seconds.lenadjnumber β like the-Joption, specifies packet length adjustment in bytes.reportsecs β like the-roption, the number of seconds the specified threshold(s) may be exceeded before a report is fired off. Default is300secs.topnumber β like the-toption, limits the subnet report to a given number of per-host connections with the highest byte count (top connections). Default is0β no limit.accumulate {yes/no}β like the-Aoption, whether or not to include threshold-exceeded accumulated time and percentage in the report. Default isno.mailtoemail address(es) β like the-Moption, the e-mail address(es) the detailed subnet report should be sent to. Multiple addresses must be separated by comma.mailfootfilename β like the-loption, name of the file to be appended to the end of e-mail reports.mtastringstring β like the-Toption, specifies the MTA command string for mailing reports. Default is"/usr/sbin/sendmail -t -oi".maskbits {1-32}β like the-moption, sets the number of network mask bits. Default is24(corresponding to subnet mask255.255.255.0).localrangeip_range β like the-Loption, determines which range(s) of IP addresses are considered local.subnetsubnet-ip bandwidth kBps β specifies which subnetsipbandshould work with and sets individual bandwidth thresholds for them β onesubnetoption per line (the subnet mask is set by themaskbitsoption). This option is only available through a configuration file. Setting it limits data collection and reporting to the specified subnets.
π EXAMPLES π
ipband eth0 -f net 10.10.0.0/16 -m 24 -a 300 -r 900
Will capture packets from/to IP addresses matching 10.10.0.0/255.255.0.0, tally traffic by the third octet, calculate bandwidth utilization every 5 minutes, and report per host traffic every 15 minutes. β¨
ipband -c ipband.conf
Read configuration from file ipband.conf.
π BUGS π
Report mailing blocks until the pipe to sendmail returns. (Yeah. It just sits there. π)
Report any bugs to anevynni@russelmetals.com. Thanks.
π AUTHOR π
Andrew Nevynniy anevynni@russelmetals.com
ipband is based on ipaudit-0.95 by J Rifkin jon.rifkin@uconn.edu (http://www.sp.uconn.edu/~jrifkin).
β VERSION β
0.8.1 Jun 13, 2008
π¦ SEE ALSO π¦
And that's the whole page, bestie β written by Andrew Nevynniy, dated Jun 13, 2008, and this little manual is ipband(8), so now you're in the group chat. Go watch some bandwidth. π«Άπ
π¦ where this page comes from
- debian bookworm: ipband 0.8.1-5.1+b1 Β· GPL-2.0-or-later
- debian trixie: ipband 0.8.1-5.1+b2 Β· GPL-2.0-or-later
- ubuntu jammy: ipband 0.8.1-5.1 Β· GPL-2.0-or-later
- ubuntu noble: ipband 0.8.1-5.1build2 Β· GPL-2.0-or-later
- ubuntu questing: ipband 0.8.1-5.1build2
- ubuntu resolute: ipband 0.8.1-6 Β· GPL-2.0-or-later
- ubuntu stonking: ipband 0.8.1-6 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms