Iptables as you all know is the firewall for linux.Basically its fully command line although there are a few GUI's for it.But mostly everyone uses the command line atleast i am quite comfortable with it.As we dont mess with it always , only at certain times when we need to configure anything.At times we do need to mess up the iptables rules, by either entering the wrong command or the wrong port or the wrong whatever..So it could screw up network traffic at times.Sometimes could totally disconnect or block all internet traffic to your computer, this happens if you mess up with port 80.If you are an iptables expert you could undo the changes by writing a rule which was the opposite of the rule which messed up your configuration.Like replace REJECT with ACCEPT or something.To know about a few important Iptables Commands you could check THIS LINK.But it could get confusing at times, so the safest way is to flush your iptables.Flushing iptables basically removes all the iptable rules you have created so you could start from scratch.Here's how you do it :
All you need to do is Go to the Terminal(Applications->Accessories->Terminal) and type the following commands

sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -F
sudo iptables -X


Although some people tell you to make a script out of it and then execute it, i feel its not necessary as you wont be flushing your iptables everyday!!.

This should solve your problems incase it was a firewall issue!!

7 comments

Anonymous said... @ January 7, 2009 at 11:18 AM

I had messed up my iptables while trying to configure internet sharing on my ubuntu box. You have no idea how much this article of yours helped me. thanks a bunch!

Anonymous said... @ February 21, 2009 at 12:00 PM

Ho man! You saved my life!

Anonymous said... @ April 6, 2009 at 1:06 PM

Thank you very much! It helped me a lot :-) You saved my night from being sleepless :-)

Prash Babu said... @ April 6, 2009 at 8:25 PM

Glad it helped all of you:)

Anonymous said... @ June 8, 2012 at 1:41 AM

Thanks Dude

Anonymous said... @ April 2, 2013 at 8:07 AM

Thank you very much. You saved me

Unknown said... @ November 7, 2013 at 9:59 AM

You, you, Life safer, you are legend. iRedmail was somehow messed up IP tables on my Ubuntu Server, so 90% of network applications didn't work.
After entering commands you posted, everything works perfectly. :)

Post a Comment