IPTABLES-SAVE(8)
๐พ IPTABLES-SAVE(8) โ dump iptables rules ๐พ
okay bestie, buckle up, we're reading a manpage together โจ this one's the iptables-save page from the iptables package (that's manual section 8, iykyk), and it's honestly so short and so sweet.
Two whole commands live in here: iptables-save and ip6tables-save. Twins. Icons. They both dump iptables rules, just for different address families ๐ซถ
โจ SYNOPSIS โจ
here's the vibe, literally copy-paste:
iptables-save [-M modprobe] [-c] [-t table] [-f filename]
ip6tables-save [-M modprobe] [-c] [-t table] [-f filename]
same options, both commands, no cap ๐
๐ธ DESCRIPTION ๐ธ
so iptables-save and ip6tables-save are the ones you call when you want to dump the contents of the IP or IPv6 Table in an easily parseable format. and where does that dump go? either to STDOUT or to a file you specify. your choice, main character ๐
๐ OPTIONS ๐
-M,--modprobemodprobe โ tells it the path to themodprobe(8)program. and by default? it peeks at/proc/sys/kernel/modprobeto figure out that executable's path all on its own. icon behavior lowkey ๐ฅ-f,--filefilename โ pick a filename and the output gets logged there. don't specify it andiptables-savelogs toSTDOUTinstead. simple as ๐ฆ-c,--countersโ includes the current values of all packet and byte counters in the output. every single one. obsessed ๐-t,--tabletablename โ restricts the output to just one table. and hear me out: if the kernel is configured with automatic module loading, an attempt will be made to load the appropriate module for that table if it's not already there. if you don't specify a table at all, the output includes all available tables.
โ ๏ธ okay this part is important so read it twice: no module loading takes place in the "all tables" scenario. so if you want a specific table in the output, you gotta load the respective module first โ something likeiptable_mangleorip6table_raw. it's giving "load it yourself bestie" ๐
๐ BUGS ๐
None known as of the iptables-1.2.1 release. clean sheet. flawless. we love to see it โจ
๐ AUTHORS ๐
the legends behind this:
- Harald Welte
<laforge@gnumonks.org> - Rusty Russell
<rusty@rustcorp.com.au> - Andras Kis-Szabo
<kisza@sch.bme.hu>contributedip6tables-save๐ซถ
๐ SEE ALSO ๐
go read these next, bestie, they're all connected:
and the HOWTOs โ the iptables-HOWTO, which details more iptables usage, the NAT-HOWTO, which details NAT, and the netfilter-hacking-HOWTO which details the internals. literally the lore ๐
okay that's the whole page, no gatekeeping here ๐
this was iptables 1.8.13, and ngl the manpage source/version and date are baked into that number โ so consider this your cute little sign-off: version 1.8.13, iptables manual, section 8. slay ๐โจ
๐ฆ where this page comes from
- alpine 3.24: iptables-doc 1.8.13-r0 ยท GPL-2.0-or-later
- nixpkgs unstable: iptables 1.8.13
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms