Make IPTables Rules Permanent
To make iptables rules permanent, we need to save them to a configuration files and ensure they are restored on each boot. The following assumes that the current rules enabled are those to be made permanent. Save current rules to config file
1 | sudo sh -c "iptables-save > /etc/iptables.conf" |
Edit /etc/rc.local as root and add the following
1 2 | # Load iptables rules from config file iptables-restore < /etc/iptables.conf |