Firewall configuration - iptables simple rules
How to create a custom script for enabling iptables firewall under Linux
Click here for the Greek version of this document.
These instructions are for those who need a simple firewall for Debian/Ubuntu and uses iptables. If you need a GUI look for gufw.
View this script
- Make sure iptables is installed
- Download the script and copy it to /etc/init.d/
- Make it executable
- Make it starting automatically
- Start it
$ sudo apt-get install iptables
$ wget http://tsopokis.gr/utilities/firewall/firewall -O /tmp/firewall
$ sudo cp /tmp/firewall /etc/init.d/
$ sudo chmod +x /etc/init.d/firewall
$ sudo update-rc.d firewall start 57 2 3 4 5 . stop 57 0 1 6 .
$ sudo /etc/init.d/firewall start
It is now working!