IPTABLES-RESTORE(8)

๐Ÿ’… IPTABLES-RESTORE โ€” like, the manual page, but make it make sense โœจ

okay bestie, so this is the page for iptables-restore and ip6tables-restore โ€” part of the whole iptables 1.8.13 situation. yes i'm aware the name is a mouthful, we'll get through it together ๐Ÿซถ


๐ŸŒธ NAME ๐ŸŒธ

  • iptables-restore โ€” restore IP Tables, fr fr
  • ip6tables-restore โ€” restore IPv6 Tables, the sequel ๐Ÿ‘‘

โญ SYNOPSIS โญ

like, the whole shape of the thing:

iptables-restore [-chntvV] [-w seconds] [-M modprobe] [-T name] [file]

ip6tables-restore [-chntvV] [-w seconds] [-M modprobe] [-T name] [file]

periodt. that's the vibe check ๐ŸŽ€


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so iptables-restore and ip6tables-restore are the two besties that restore your IP and IPv6 Tables from data you feed them โ€” either from STDIN or from file. you can use the I/O redirection your shell already gives you to read from a file, or you can just pass file as an argument, whichever feels more main character ๐Ÿ’–

โœจ the flags (the fun part, lowkey) โœจ

  • -c, --counters โ€” restores the values of all the packet and byte counters. all of them. no cap ๐Ÿ’€
  • -h, --help โ€” prints a short option summary. a lil snack, not the full meal ๐Ÿ˜Œ
  • -n, --noflush โ€” does NOT flush the previous contents of the table. and if you don't specify this? both commands flush (delete) all previous contents of the respective table. and heads up, this option will flush user-defined chains if they are declared. example time, iykyk:
*filter
:FILTERS - [0:0]
-A FILTERS ...

so in that scenario it'll flush and re-build the FILTERS chain from scratch, while keeping the content of all the other chains in the table safe and sound ๐Ÿงš

  • -t, --test โ€” only parses and constructs the ruleset, but does not commit it. a lil dress rehearsal, no commitment ๐Ÿ’…
  • -v, --verbose โ€” prints additional debug info during ruleset processing. specify it multiple times to crank the debug level up. obsessed with a stackable flag ๐ŸŒˆ
  • -V, --version โ€” prints the program version number. iconic, brief, slay
  • -w, --wait [seconds] โ€” waits for the xtables lock. so basically, to stop multiple instances of the program from running concurrently, it tries to grab an exclusive lock at launch. by default the program will just exit if it can't get the lock (rude ๐Ÿ˜ญ), but this option makes it wait โ€” indefinitely, or for the optional seconds โ€” until the exclusive lock can be obtained ๐Ÿ•
  • -M, --modprobe modprobe โ€” specifies the path to the modprobe(8) program. by default, iptables-restore peeks at /proc/sys/kernel/modprobe to figure out the executable's path. detective behavior ๐Ÿ”
  • -T, --table name โ€” restores only the named table, even if the input stream contains other ones. tunnel vision, but make it useful ๐Ÿ’œ

๐Ÿ’€ BUGS ๐Ÿ’€

none known as of the iptables-1.2.1 release. genuinely nothing. we're clean, bestie ๐Ÿงผโœจ


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

  • Harald Welte <laforge@gnumonks.org> wrote iptables-restore based on code from Rusty Russell. king behavior tbh ๐Ÿซถ
  • Andras Kis-Szabo <kisza@sch.bme.hu> contributed ip6tables-restore. the IPv6 girlies thank you ๐ŸŒˆ

๐Ÿ“ SEE ALSO ๐Ÿ“

go read these next, they're giving required reading ๐Ÿ“š

and also the iptables-HOWTO, which details iptables usage, the NAT-HOWTO, which details NAT, and the netfilter-hacking-HOWTO which details the internals. nerd hours, but like, in a hot way ๐Ÿ”ฅ


ok that's the whole page, nothing skipped, nothing invented, all facts intact โ€” don't come for me ๐Ÿ˜ญ๐Ÿ’–

made with love by your favorite unix girlie, from the iptables 1.8.13 pages (yes that's the version, and it's the one on the tin) โ€” mwah ๐Ÿ’‹

๐Ÿ“ฆ where this page comes from