How To Save iptables firewall rules Centos/Redhat/Fedora Linux -
How To Save iptables firewall rules Centos/Redhat/Fedora Linux
This is something that annoys a lot of people, fortunately the Redhat style OS's are the most simple in this respect. I disagree that Debian's way makes sense, it is more of a hackish approach in how they implement iptables.
Anyway, for those who are using Redhat/Centos style OS's it is very simple.
Set your rules from the shell/command prompt and to save the iptables firewall rules so they are remember/loaded on boot just run this command:
service iptables save
What happens is the rules are automatically saved to
If you make frequent changes it's wise to manually back that file up or make copies of it. The reason this works well is because Redhat has a smart initscript that always check upon startup for rules in the
/etc/sysconfig/iptables and loads them if they are found.
After this everytime you reboot your iptables settings will be restored and preserved.