ipfstat(8)
β¨ ipfstat(8) β¨
hey bestie! π welcome to the ipfstat(8) page from the System Manager's Manual. okay so this is literally your go-to for checking out packet filter stats and filter lists. let's get into it, no cap.
π SYNOPSIS π
ipfstat [ -46aAdfghIilnoRsv ]
ipfstat -t [ -6C ] [ -D <addrport> ] [ -P <protocol> ] [ -S <addrport> ]
[ -T <refresh time> ]
π DESCRIPTION π
okay so ipfstat examines /dev/kmem using the symbols _fr_flags, _frstats, _filterin, and _filterout. to run and work, it needs to be able to read both /dev/kmem and the kernel itself. the kernel name defaults to /boot/kernel/kernel. iconic.
the default behaviour of ipfstat is to retrieve and display the accumulated statistics which have been accumulated over time as the kernel has put packets through the filter. it's giving "main character energy" for your packet filter. β¨
πΈ OPTIONS πΈ
-4β display filter lists and states for IPv4, if available. this is the default when displaying states.-4and-6is the default when displaying lists. slay.-6β display filter lists and states for IPv6, if available.-aβ display the accounting filter list and show bytes counted against each rule. πΈ-Aβ display packet authentication statistics.-Cβ this option is only valid in combination with-t. display "closed" states as well in the top. normally, a TCP connection is not displayed when it reaches theCLOSE_WAITprotocol state. with this option enabled, all state entries are displayed. it's giving "i want to see everything" energy. π-dβ produce debugging output when displaying data.-D <addrport>β this option is only valid in combination with-t. limit the state top display to show only state entries whose destination IP address and port match the addrport argument. the addrport specification is of the formipaddress[,port]. the ipaddress and port should be either numerical or the string"any"(specifying any IP address resp. any port). if the-Doption is not specified, it defaults to"-D any,any". so you can be as specific or as chill as you want. πββοΈ-fβ show fragment state information (statistics) and held state information (in the kernel) if any is present.-gβ show groups currently configured (both active and inactive). group chat vibes. π―ββοΈ-hβ show per-rule the number of times each one scores a "hit". π―-iβ display the filter list used for the input side of the kernel IP processing.-Iβ swap between retrieving "inactive"/"active" filter list details. for use in combination with-i.-nβ show the "rule number" for each rule as it is printed. π’-oβ display the filter list used for the output side of the kernel IP processing.-P <protocol>β this option is only valid in combination with-t. limit the state top display to show only state entries that match a specific protocol. the argument can be a protocol name (as defined in/etc/protocols) or a protocol number. if this option is not specified, state entries for any protocol are specified. so you can filter by vibe (protocol). π-Rβ don't try to resolve addresses to hostnames and ports to services while printing statistics. no DNS lookups, just raw numbers. π ββοΈ-sβ show packet/flow state information (statistics only).-slβ show held state information (in the kernel) if any is present (no statistics). note: this is literally-splus-l? no, it's its own thing. bestie, just use it as written.-S <addrport>β this option is only valid in combination with-t. limit the state top display to show only state entries whose source IP address and port match the addrport argument. the addrport specification is of the formipaddress[,port]. the ipaddress and port should be either numerical or the string"any"(specifying any IP address resp. any port). if the-Soption is not specified, it defaults to"-S any,any". same energy as-Dbut for source. π«Ά-tβ show the state table in a way similar to the waytop(1)shows the process table. states can be sorted using a number of different ways. this option requirescurses(3)and needs to be compiled in. it may not be available on all operating systems. see below, for more information on the keys that can be used whileipfstatis in top mode. it's giving "top but for states" and i'm obsessed. π₯-T <refreshtime>β this option is only valid in combination with-t. specifies how often the state top display should be updated. the refresh time is the number of seconds between an update. any positive integer can be used. the default (and minimal update time) is1. so you can set it to1,2,3β¦ you get it. β±οΈ-vβ turn verbose mode on. displays more debugging information. when used with either-ior-o, counters associated with the rule, such as the number of times it has been matched and the number of bytes from such packets is displayed. for "keep state" rules, a count of the number of state sessions active against the rule is also displayed. verbose mode is literally the "tell me everything" mode. π£οΈ
π SYNOPSIS π
the role of ipfstat is to display current kernel statistics gathered as a result of applying the filters in place (if any) to packets going in and out of the kernel. this is the default operation when no command line parameters are present. so if you just run ipfstat with no args, you get the stats. periodt.
when supplied with either -i or -o, it will retrieve and display the appropriate list of filter rules currently installed and in use by the kernel.
one of the statistics that ipfstat shows is ticks. this number indicates how long the filter has been enabled. the number is incremented every half-second. so ticks are literally the heartbeat of your filter. π
π¦ STATE TOP π¦
using the -t option ipfstat will enter the state top mode. in this mode the state table is displayed similar to the way top displays the process table. the -C, -D, -P, -S and -T command line options can be used to restrict the state entries that will be shown and to specify the frequency of display updates.
in state top mode, the following keys can be used to influence the displayed information:
bβ show packets/bytes from backward direction.fβ show packets/bytes from forward direction. (default)lβ redraw the screen.qβ quit the program.sβ switch between different sorting criterion.rβ reverse the sorting criterion.
states can be sorted by protocol number, by number of IP packets, by number of bytes and by time-to-live of the state entry. the default is to sort by the number of bytes. states are sorted in descending order, but you can use the r key to sort them in ascending order. so you can sort by whatever vibe you're feeling. π
π«Ά STATE TOP LIMITATIONS π«Ά
- it is currently not possible to interactively change the source, destination and protocol filters or the refresh frequency. this must be done from the command line. so no touching the UI for that, bestie. π
- the screen must have at least 80 columns. this is however not checked. when running state top in IPv6 mode, the screen must be much wider to display the very long IPv6 addresses. those addresses are literally huge, so make sure your terminal is wide enough. π
- only the first X-5 entries that match the sort and filter criteria are displayed (where X is the number of rows on the display). the only way to see more entries is to resize the screen. so if you want more, just make your window bigger. simple. π
π FILES π
/dev/kmem/dev/ipl/dev/ipstate/kernel
π SEE ALSO π
π BUGS π
-4 and -6 are only valid with -i, -o, and -t. an error should result when used with other arguments. so don't try to be clever and mix them with random flags, okay? it's not the vibe. π
thatβs the whole page, bestie! π this is ipfstat(8) from the System Manager's Manual. no cap, youβre now an expert. go slay! β¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms