How to save rules of the iptables?
The easy way is to use iptables-persistent
.
Install iptables-persistent
:
sudo apt-get install iptables-persistent
After it's installed, you can save/reload iptables rules anytime:
sudo /etc/init.d/iptables-persistent save
sudo /etc/init.d/iptables-persistent reload
Ubuntu 16.04 Server
The installation as described above works without a problem, but the two commands for saving and reloading above do not seem to work with a 16.04 server. The following commands work with that version:
sudo netfilter-persistent save
sudo netfilter-persistent reload
欢迎转载,转载请保留页面地址。帮助到你的请点个推荐。