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, --modprobe modprobe โ€” tells it the path to the modprobe(8) program. and by default? it peeks at /proc/sys/kernel/modprobe to figure out that executable's path all on its own. icon behavior lowkey ๐Ÿ”ฅ
  • -f, --file filename โ€” pick a filename and the output gets logged there. don't specify it and iptables-save logs to STDOUT instead. simple as ๐Ÿฆ‹
  • -c, --counters โ€” includes the current values of all packet and byte counters in the output. every single one. obsessed ๐Ÿ“
  • -t, --table tablename โ€” 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 like iptable_mangle or ip6table_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> contributed ip6tables-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