Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to Ubuntu. I want to turn off firewall and make sure that it's turned off and want to turn off iptables.

  Installed: 1.4.21-1ubuntu1
  Candidate: 1.4.21-1ubuntu1
  Version table:
 *** 1.4.21-1ubuntu1 0
        500 trusty/main amd64 Packages
        100 /var/lib/dpkg/status

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destinat
share|improve this question
Did you install iptables manually? – Raphael Jan 23 at 21:45
If not then to disable firewall completely do: sudo ufw disable . To check status do: sudo ufw status – Raphael Jan 23 at 21:47
thanks for replying , i want to check if iptables are installed or not , how can i check it ? – user5520049 Jan 23 at 21:52
apt-cache policy iptables – Raphael Jan 23 at 21:54
It is installed – Raphael Jan 23 at 21:55
up vote 8 down vote accepted
sudo ufw status
Status: inactive

You can turn it off and on with ...

sudo ufw disable
sudo ufw enable

By default it is disabled.

You can check if there are iptables rules active with:

sudo iptables -L

If you have iptables active this will cancel it

sudo iptables -X
sudo iptables -t nat -F
sudo iptables -t nat -X
sudo iptables -t mangle -F
sudo iptables -t mangle -X
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT

If you want a graphical method:

sudo apt-get install gufw

enter image description here

share|improve this answer
Thanks , i tried firewall now and it's inactive so it's disabled , but iptables i want to check if it's installed ot not , and where can i find it ? – user5520049 Jan 23 at 21:53
installed does not mean rules active ;-) iptables -L to see if there are any rules. – Rinzwind Jan 23 at 21:56
i edited post with result – user5520049 Jan 23 at 21:58
That result in your edit means there are NO rules active ;) – Rinzwind Jan 23 at 21:59
yeah you would have seen lines with port numbers and things like that if it was active ;-) – Rinzwind Jan 23 at 22:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.