IPTSTATE(8)
π IPTSTATE β the iptstate(8) glow-up π
okay bestie, sit down, because this one is literally a whole vibe. this is the manual page for iptstate, a section 8 (system admin) command, and it's about to become your new obsession. π¦
β¨ NAME β¨
iptstate β a top-like display of IP Tables state table entries π
πΈ SYNOPSIS πΈ
iptstate [<options>]
π DESCRIPTION π
so iptstate shows you everything chillin' in the IP Tables state table, in real-time, in a format that's giving top but make it cute. it's live, it's dynamic, it's the moment. β¨
here's the tea: you can sort the output by any field, or reverse any field. you can make it print once and dip instead of doing the whole top-like thing. the refresh rate is configurable, IPs can be resolved to names, output can be formatted, the display can be filtered, and there's color coding β all of that is just some of the many features. no cap. π
π COMMAND-LINE OPTIONS π
-c,--no-colorβ toggles the color-code by protocol π-C,--countersβ toggles the display of bytes/packets counters-d,--dst-filter IP[/NETMASK]β only shows states with a destination of IP, with an optional NETMASK. > heads up bestie: this has to be an IP, hostname matching is not yet supported. π-D --dstpt-filter portβ only shows states with a destination port of port-h,--helpβ shows the help message π«Ά-i,--invert-filtersβ inverts the filters so you see the non-matching results instead π-l,--lookupβ shows hostnames instead of IP addresses. turning this on will also turn on-Lto prevent an ever-growing number of DNS requests. iykyk β¨-m,--mark-truncatedβ marks truncated hostnames with a'+'-o,--no-dynamicβ toggles dynamic formatting-L,--no-dnsβ skips outgoing DNS lookup states-f,--no-loopbackβ filters states on loopback-p,--no-scrollβ no scrolling (don't use a "pad"). see SCROLLING AND PADS below for the whole story π-r,--reverseβ reverses the sort order π-R,--rate secondsβ refresh rate, followed by the rate in seconds. note that this is for statetop mode, and it's not applicable for single-run mode (--single).-1,--singleβ single run (no curses) πβοΈ-b,--sort columnβ this decides what column you sort by. the options are:
S Source Port
d Destination IP (or Name)
D Destination Port
p Protocol
s State
t TTL
b Bytes
P Packets
to sort by Source IP (or Name), don't use -b. also, sorting by bytes/packets is only available for kernels that support it, and only when compiled against libnetfilter_conntrack (which is the default).
-s,--src-filter IP[/NETMASK]β only shows states with a source of IP, with an optional NETMASK. > same warning as before, bestie: this must be an IP, hostname matching is not yet supported. π-S,--srcpt-filter portβ only shows states with a source port of port-t,--totalsβ toggles the display of totals π
π¦ INTERACTIVE OPTIONS π¦
as of version 2.0, literally all the command-line options are available interactively using the same key as the short-option. for example, --sort is also -b, so while iptstate is running, hitting b will change the sorting to the next column. same energy with t toggling the display of totals, and so on. it's giving β¨consistencyβ¨.
there are also some extra interactive options:
Bβ change sorting to the previous column (the opposite ofb)qβ quit πxβ delete the currently highlighted state from the netfilter conntrack table π
additionally, these keys are what you use to navigate around inside iptstate:
- Up or
jβ move up one line - Down or
kβ move down one line - Left or
hβ move left one column - Right or
lβ move right one column - PageUp or
^uβ move up one page - PageDown or
^dβ move down one page - Home β go to the top β¬οΈ
- End β go to the end β¬οΈ
in a lot of cases, iptstate needs to prompt you to change something. for example, if you wanna set or change the source-ip filter, when you hit s, iptstate pops up a prompt at the top of the window asking what you wanna set it to. so polite honestly. π«Ά
and like many UNIX applications, ctrl-G tells iptstate "nevermind" β it'll remove the prompt and forget you ever hit s. selective memory, iconic. π
in most cases, a blank response means "clear" β clear the source IP filter, for example.
at any time while iptstate is running, you can hit h to get to the interactive help, which displays all the current settings for you and gives you a list of every interactive command available. so handy. π
while running, space will immediately update the display. iptstate should gracefully handle all window resizes, but if it doesn't, you can force it to re-calculate and re-draw the screen with ctrl-L.
one more thing: hittinglto enable hostname resolution while in interactive mode will also enableLto skip all DNS entries (to prevent an ever-growing number of DNS requests). πΈ
π SCROLLING AND PADS π
for almost any user, there is no reason to turn off scrolling. the ability to turn it off β and especially the ability to toggle it interactively β exists more for theoretical completeness than anything else. it's a vibe, not a necessity. π
but nonetheless, here are the details, because we don't gatekeep. typically in a curses application you create a "window." windows don't scroll though. they're, at most, the size of your terminal. windows provide double-buffering to make refreshing as fast and seamless as possible. however, to enable scrolling, you have to use "pads" instead of windows. pads can be bigger than the current terminal. then all the necessary data gets written to the pad, and "scrolling" becomes just a function of showing the right part of that pad on the screen. π
but here's the catch: pads don't have the double-buffering feature that windows have. so there might be some case where for some user on some very strange machine, having scrolling enabled could cause poor refreshing. given the nature of the way iptstate uses the screen though, the author finds this highly unlikely. plus, the scrolling method uses a little more memory. however, iptstate is not a memory intensive application, so this shouldn't be a problem even on low-memory systems. π
nonetheless, if this does negatively affect you, the option to turn it off is there.
β EXIT STATUS β
anything other than 0 indicates an error. a list of the current exit statuses is below:
0β success β1β bad command-line arguments2β error communicating with the netfilter subsystem3β terminal too narrow π
π BUGS π
we don't support filtering on resolved names. IPv6 support is new, and the dynamic formatting doesn't yet always handle IPv6 addresses as well as it should. it's a work in progress bestie, be nice. π
π«Ά BUG REPORTS π«Ά
all bugs should be reported to Phil Dibowitz <phil AT ipom DOT com>. please see the README and BUGS for more information on bug reports. and please read the WISHLIST before sending in features you hope to see. π
π§ NOTES π§
iptstate does a lot of work to try to fit everything on the screen in an easy-to-read way. however, in some cases, hostnames may need to be truncated (in lookup mode). similarly, IPv6 addresses may need to be truncated.
the truncation of names happens from the right for source, because you most likely know your own domain name, and from the left for destination, because knowing your users are connecting to "mail.a." doesn't help much. however, for addresses, this is reversed. β¨
iptstate does not automatically handle window-resizes while in the interactive help screen. if you do resize while in this window, you should return to the main window, hit ctrl-L to re-calculate and re-draw the screen, and then, if you choose, return to the interactive help. π
iptstate currently uses libnetfilter_conntrack to access the netfilter connection state table. however, older versions read out of /proc/net/ip_conntrack, and the current version can still be compiled to do this.
β οΈ this deprecated method can be racy on SMP systems, and it can hurt performance on very heavily loaded firewalls. this deprecated method should be avoided β support will be removed in future versions. fr fr, don't do it. π
π₯ SEE ALSO π₯
π AUTHOR π
iptstate was written by Phil Dibowitz <phil AT ipom DOT com> http://www.phildev.net/iptstate/
and that's the whole page, bestie! π this one is from JUNE 2012, and it's the IPTSTATE(8) manual β go forth and watch your conntrack table in style. slay. π
β¨π¦
π¦ where this page comes from
- alpine 3.24: iptstate-doc 2.2.7-r0 Β· MIT
- arch rolling: iptstate 2.2.7-2 Β· custom
- debian bookworm: iptstate 2.2.7-0.1
- debian trixie: iptstate 2.2.7-1
- epel 10: iptstate 2.3.0-1.el10_3 Β· zlib
- epel 9: iptstate 2.3.0-1.el9 Β· zlib
- fedora 43: iptstate 2.2.7-10.fc43 Β· zlib
- fedora 43: iptstate 2.3.0-1.fc43 Β· zlib
- fedora 44: iptstate 2.2.7-11.fc44 Β· zlib
- fedora 44: iptstate 2.3.0-1.fc44 Β· zlib
- ubuntu noble: iptstate 2.2.7-0.1
- ubuntu questing: iptstate 2.2.7-1
- ubuntu resolute: iptstate 2.2.7-1build1
- ubuntu stonking: iptstate 2.3.0-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms