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 frip6tables-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,--modprobemodprobe โ specifies the path to themodprobe(8)program. by default,iptables-restorepeeks at/proc/sys/kernel/modprobeto figure out the executable's path. detective behavior ๐-T,--tablename โ 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>wroteiptables-restorebased on code from Rusty Russell. king behavior tbh ๐ซถ - Andras Kis-Szabo
<kisza@sch.bme.hu>contributedip6tables-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
- 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