My server which I am hosting this blog on runs Ubuntu Linux 5.10, I have been meaning to configure iptables to lock down the open ports.
I am not going to explain the configuration of iptables here, but there are many guides available.
Now you have created your iptables rules they are stored in memory and when you reboot your machine will be lost
.
I found a solution to the problem on the Ubuntu Forums.
First off we need to create /etc/init.d/iptables and populate it, I have a put a copy of the iptables script on my server for you to download.
# wget http://files.toonarmy.mine.nu/iptables
MD5 Sum: 7cf9c61f8d284f65b99781c2d3355747
/etc/init.d/iptables needs to be executable:
Next we need to get iptables loaded at boot time before networking, this can be done with the following command:
Now we have to save our current rules from memory to file so they are loaded at each boot.
A word of warning calling /etc/init.d/iptables stop twice in a row will clear your iptables configuration. I would advise you to make a backup of /etc/default/iptables-rules I use a simple copy command:
Note: This is mainly for my own reference but others may find it handy ![]()
Playing:
