...
Code Block |
---|
|
sudo chkconfig iptables on
sudo service iptables save |
Debian/Ubuntu:
Install iptables-persistent
package and the netfilter-persistent
packages:
Code Block |
---|
|
sudo apt-get install iptables-persistent
sudo apt-get install netfilter-persistent |
To save current iptable rules to these files, run the following:
...
Code Block |
---|
|
sudo iptables-restore < /etc/iptables/rules.v4
sudo ip6tables-restore < /etc/iptables/rules.v6 |
The netfilter-persistent
package has the actual init.d service which reloads the last saved iptables configuration. So, once saved (see above) start and enable the service by:
Code Block |
---|
sudo systemctl start netfilter-persistent
sudo systemctl enable netfilter-persistent |
References
- https://help.ubuntu.com/community/IptablesHowTo
- https://www.thomas-krenn.com/en/wiki/Saving_Iptables_Firewall_Rules_Permanently
...