How to save/restore iptables rules

We can take the backup of existing rules in the iptables firewall using the following command.

#iptables-save > /root/backup.iptables.rules

Now all the rules will be stored to the file '/root/backup.iptables.rules'.

The backed up rules can be restored at any time using the below command.

#iptables-restore < /root/backup.iptables.rules

That's all.....

Leave a Reply