Yannis Tsopokis web site

Let the programmers be many and the managers few -- then all will be productive....


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

  1. Make sure iptables is installed
  2. $ sudo apt-get install iptables

  3. Download the script and copy it to /etc/init.d/
  4. $ wget http://tsopokis.gr/utilities/firewall/firewall -O /tmp/firewall

    $ sudo cp /tmp/firewall /etc/init.d/


  5. Make it executable
  6. $ sudo chmod +x /etc/init.d/firewall

  7. Make it starting automatically
  8. $ sudo update-rc.d firewall start 57 2 3 4 5 . stop 57 0 1 6 .

  9. Start it
  10. $ sudo /etc/init.d/firewall start


It is now working!

:: Links

Netfilter/iptables project