Wednesday, 20 March 2013

UBUNTU IPTABLES LOAD AUTO AT START

Auto Saving IP Tables and Auto Loading in UBUNTU

Although the IP tables are effective, they will automatically be deleted if the server reboots. To make sure that they remain in effect, we can use a package called IP-Tables persistent.

We can install it using apt-get:

sudo apt-get install iptables-persistent

During the installation, you will be asked if you want to save the iptable rules to both the IPv4 rules and the IPv6 rules. Say yes to both.

Your rules will then be saved in /etc/iptables/rules.v4 and /etc/iptables/rules.v6.

Once the installation is complete, start iptables-persistent running:

sudo service iptables-persistent start

After any server reboot, you will see that the rules remain in place. 


/etc/init.d/iptables-persistent {start|restart|reload|force-reload|save|flush}

No comments:

Post a Comment