How to make iptables rules permanent

To setup persistant iptables rules, after we enter our iptables as usual, we export them to config file.

iptables-save > /etc/iptables.conf

Edit your global rc.local file [/etc/rc.local] with your favorite editor and before the ‘exit 0’ add:

iptables-restore < /etc/iptables.conf

Save and restart, your iptables rules are now permanent

You may also like...

Leave a Reply