Skip to content

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

Published inLinux

Be First to Comment

Leave a Reply

%d bloggers like this: