10

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.

iptables:
  Installed: 1.4.21-1ubuntu1
  Candidate: 1.4.21-1ubuntu1
  Version table:
 *** 1.4.21-1ubuntu1 0
        500 http://us.archive.ubuntu.com/ubuntu/ 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
6
  • Did you install iptables manually?
    – Raphael
    Jan 23, 2016 at 21:45
  • 2
    If not then to disable firewall completely do: sudo ufw disable . To check status do: sudo ufw status
    – Raphael
    Jan 23, 2016 at 21:47
  • thanks for replying , i want to check if iptables are installed or not , how can i check it ?
    – sam
    Jan 23, 2016 at 21:52
  • 2
    apt-cache policy iptables
    – Raphael
    Jan 23, 2016 at 21:54
  • 1
    It is installed
    – Raphael
    Jan 23, 2016 at 21:55

1 Answer 1

25
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

Your output, with no lines between the target prot opt source destination header and the next Chain, indicates that no rules are active.

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

6
  • 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 ?
    – sam
    Jan 23, 2016 at 21:53
  • installed does not mean rules active ;-) iptables -L to see if there are any rules.
    – Rinzwind
    Jan 23, 2016 at 21:56
  • i edited post with result
    – sam
    Jan 23, 2016 at 21:58
  • That result in your edit means there are NO rules active ;)
    – Rinzwind
    Jan 23, 2016 at 21:59
  • 1
    yeah you would have seen lines with port numbers and things like that if it was active ;-)
    – Rinzwind
    Jan 23, 2016 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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