ComputerWillTravel 



This is a Linux Iptables script I put this together to get a better understanding on iptables and other security reasons.

copy and past this in the Terminal log in as root like this then do the second command. You need to find out your interface I'm on a  cable connection  so My interface is eth0 so after you paste the firewall.bash script you need to change it to your interface wlan0 or whatever. Also if you use KDE use kate text edit  

sudo su
sudo gedit /etc/network/interfaces

Now after you find that out close it out and go back to the Terminal you should be in root and type this in or copy paste. When you see the text editer copy and paste firewall.bash

Now its time for the script copy and past this in the text editor

sudo gedit /etc/firewall.bash

Alright now click on the floppy icon and close it out in other words save it now we make the script executable if you change any of the rules to ACCEPT or ACCEPTLOG you must make it executable

sudo chmod +x /etc/firewall.bash

Ok that part is done I use a flush script because I think its better for the firewall bash script I did not write all this I studyed HARD and came up with this so alot of it is off the net so forgive me!

sudo gedit /etc/flush_iptables.bash

Now make it executable.

sudo chmod +x /etc/flush_iptables.bash

This script will allow you to handle your firewall like all other services.

sudo gedit /etc/init.d/firewall

Now make it executable.

sudo chmod +x /etc/init.d/firewall

Do this first the final step is to make your script running on each boot of your computer

sudo update-rc.d firewall defaults

Now you can use these commands to start/stop/restart/status your firewall

sudo /etc/init.d/firewall start

sudo /etc/init.d/firewall stop

sudo /etc/init.d/firewall restart

sudo /etc/init.d/firewall status

That's is it kinda easy. so when you make a change just pull it up like this 

 sudo gedit /etc/firewall.bash

make your changes then

sudo chmod +x /etc/firewall.bash

Then 

sudo /etc/init.d/firewall restart

Thats is it when you want to check the status all you got to do is 

sudo /etc/init.d/firewall status

or I use I think this way is better because it dont resolve host

sudo iptables -L -v -n


I hope this gives you a idea on somethings go back