How do I save iptables changes?
The generic method of saving iptables rules is to use the command iptables-save, which writes to stdout. The output created by iptables-save can then by read on stdin by iptables-restore. If on a server, without NetworkManager, a common approach is then to use a pre-up command in /etc/network/interfaces.
Are iptables changes persistent?
Iptables rules are by default not persistent after reboot. The objective is to make iptables rules persistent after reboot.
Why does iptables persistent work in this hard to follow way?
Why does iptables-persistent work in this hard to follow way? In general, you can edit the active iptables rules for IPv4 with a text editor by using the iptables-save command to write the rules to a file and then using the iptables-restore command to reload the new rules after you’re done, e.g.:
Is there a way to save the current iptables rules?
Very simple way to save the current iptables rules is to use the command: Using the above, which works at least in Ubuntu after installing the netfilter-persistent (and iptables-persistent) package, there is no need to run manually the iptables commands or to reconfigure the package (as suggested by even the accepted Answer above).
Where are the iptables rules saved in sysconfig?
The rules are saved in the file /etc/sysconfig/iptables for IPv4 and in the file /etc/sysconfig/ip6tables for IPv6. You may also use the init script in order to save the current rules.
Where are the iptables rules saved in lucid?
Since Ubuntu 10.04 LTS (Lucid) and Debian 6.0 (Squeeze) there is a package with the name “iptables-persistent” which takes over the automatic loading of the saved iptables rules. To do this, the rules must be saved in the file /etc/iptables/rules.v4 for IPv4 and /etc/iptables/rules.v6 for IPv6. For use, the package must simply be installed.