Linux "iptables-apply" Command Line Options and Examples
a safer way to update iptables remotely

iptables-apply will try to apply a new rulesfile (as output by iptables-save, read by iptables-restore) or run a command to configure iptables and then prompt the user whether the changes are okay. If the new iptables rules cut the existing connection, the user will not be able to answer affirmatively.


Usage:

iptables-apply [-hV] [-t timeout] [-w savefile] {[rulesfile]|-c [runcmd]}






Command Line Options:

-t
Sets the timeout in seconds after which the script will roll back to the previous ruleset (default: 10).
iptables-apply -t ...
-w
Specify the savefile where successfully applied rules will be written to (default if empty string is given:/etc/network/iptables.up.rules).
iptables-apply -w ...
-c
Run command runcmd to configure iptables instead of applying a rulesfile (default: /etc/network/iptables.up.run).
iptables-apply -c ...
-h
Display usage information.
iptables-apply -h ...
-V
Display version information.
iptables-apply -V ...