Ubuntu Linux Save / Restore Iptables Rules

I want to make changes to an iptables configuration. How to do I Save and Restore an iptables Configuration in Ubuntu Linux server?

If you want to make changes to an iptables configuration, it is always good idea to save the current configuration by typing the following commands:
$ sudo -s
$ iptables-save > /root/working.iptables.rules

Now, you can make any changes using command line.

To restore it use the command iptables-restore, enter:
# iptables-restore < /root/working.iptables.rules

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.