BPFMON(8)
π BPFMON π
okay bestie, gather round, because this one is so cool. bpfmon β BPF based visual packet rate monitor π¦
β¨ SYNOPSIS β¨
no cap, here's exactly how you call her:
bpfmon
bpfmon [-autzvIiLlnNh] <device> '<bpf_filter_code>'
bpfmon [-autzvIiLlnNh] iptables '[<table>] <chain> <rulenum>'
bpfmon [-autzvIiLlnNh] iptables [select]
bpfmon [-autzvIiLlnNh] ip6tables '[<table>] <chain> <rulenum>'
bpfmon [-autzvIiLlnNh] ip6tables [select]
bpfmon [-autzvIiLlnNh] custom <path-to-binary>
πΈ DESCRIPTION πΈ
so like, bpfmon (just like tcpdump) uses a BPF filter to pick out which packets match. but here's the β¨twistβ¨: with tcpdump it's easy to see which packets matched β with bpfmon you see how much the matched packets are, in terms of bytes per second and packets per second. it's giving data, not drama. π
bpfmon shows you that info in a pseudo-graphical text interface, built for modern terminals. but she's versatile, okay? she also supports non-interactive pure ASCII display. range. π
plus β and this is the part that ate β instead of monitoring packets that match a BPF filter, bpfmon can pull its data from an iptables/ip6tables rule (on Linux systems). yes really.
bpfmon also supports getting its data from a custom script. the script can be simple and give you just a single counter pair, OR it can be fancy and let you pick from multiple different counter pairs via a selection dialog. it's giving choose-your-own-adventure π
When it's called to produce data, the script must print to standard output two whitespace-separated non-negative integers on a single line: the packet counter first, and the byte counter second. only those first two values get read, bestie. bpfmon treats them as cumulative totals and shows you the difference between successive readings β so the script has to report monotonically increasing counters, not instantaneous rates. the first value shows up as the packets-per-second figure and the second as the bytes-per-second figure. the very first reading just sets a baseline π§, and if a counter decreases between two readings (say the underlying counter got reset) then that interval is shown as zero.
Example simple script to show incoming packets on the lo interface (this is a Linux example; it prints the packet count followed by the byte count):
#!/bin/sh
grep lo: /proc/net/dev|awk '{print $3" "$2}'
bpfmon figures out whether a script supports multiple counters by first running it with bpfmon-list as its only argument. every script gets invoked this way at startup, so if your script inspects its argument it must recognise or ignore bpfmon-list (the simple example above ignores its arguments, lowkey iconic of it). if the first non-empty line of that output is exactly #bpfmon-counters, followed by one or more lines like this:
#bpfmon-counters
<argument1> <descripton1>
<argument2> <descripton2>
...
<argumentN> <descriptonN>
then bpfmon knows the script supports multiple counter pairs and lets the user bring up a selection dialog. on each line, the argument and its description are separated by the first space or tab, and any surrounding whitespace is ignored. lines whose first character is # are treated as comments (so the #bpfmon-counters marker itself and any annotations get skipped), and a line that carries no description is ignored. the #bpfmon-counters marker must be the first non-empty line of the output β otherwise the script is treated as a single-counter one. periodt.
A single-counter script is invoked with no argument to fetch its data. for a multi-counter script, the first item is automatically selected at startup and the script is called with <argument1>; selecting another entry invokes the script with that entry's argument.
See the c shortcut for how to invoke the selection dialog π
In interactive mode there are hot keys to display help or modify the mode of operation. and if you run it with no arguments at all? bpfmon will display its version and command line help. so helpful, so demure π«Ά
β OPTIONS β
-aβ use ASCII drawing characters-uβ use UTF-8 drawing characters-tβ use no interface (simple text output)-zβ use horizontal full-screen interface-vβ use vertical full-screen interface-Iβ show history in vertical full-screen-iβ hide history in vertical full-screen-Lβ show legend in vertical full-screen-lβ hide legend in vertical full-screen-nβ show interface white on black-Nβ show interface inverse (black on white)-hβ show usage information and exit
π KEYBOARD SHORTCUTS π
these are your hot keys, bestie. memorize them, they're the vibe check:
h,H,?β toggle help screena,Aβ switch to ASCII drawing charsu,Uβ switch to UTF-8 drawing charsm,Mβ toggle horizontal/vertical modei,Iβ toggle history in vertical model,Lβ toggle legend in vertical moden,Nβ toggle inverse modez,Zβ zero history and restarts,Sβ iptables rule select6β ip6tables rule selectcβ custom counter selectr,R,Ctrl-Lβ refresh screenq,Q,Ctrl-Cβ exit
ngl, Ctrl+C and Ctrl+L are doing so much heavy lifting here. main character energy fr fr. π
π¦ SEE ALSO π¦
tcpdump(8), bpf(4), pcap-filter(7) iptables(8),
π AUTHOR π
The bpfmon program was written by Boian Bonev from 2014 to 2025. twenty-eleven years of slay, honestly.
This manual page was written by Boian Bonev for the Debian project and is placed in the public domain. β¨
okay that's the whole thing, bestie π you just read the BPFMON(8) page from the System Manager's Manual, dated July 29, 2026. go forth and monitor those packet rates. no cap, you're gonna be so good at this ππ
π
π¦ where this page comes from
- nixpkgs unstable: bpfmon 2.60
- ubuntu stonking: bpfmon 2.60-1 Β· 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