43

How do I turn off the firewall in Ubuntu 12.04?

Thanks for the answers. The reason for turning it off was twofold: I often cannot make a wireless connectin to internet and get the server is unable to connect message or I get a message that disappears telling me my domain is not compatible with the Avahi network whatever that is. So I thought if I disable firewall I would be ok.

So my question is as follows: What command line or configuration in Ubuntu 12.04 can I use to disable or stop the Ubuntu 12.04 default firewall?

Nathan Basanese
  • 422
  • 4
  • 17

4 Answers4

54

Actually Ubuntu got a firewall it self named uncomplicated firewall. For any reason you have problem with the firewall means you can simply disable it by running:

sudo ufw disable

from your terminal.

To again enable firewall write/paste the following command-

sudo ufw enable
Raja G
  • 105,327
  • 107
  • 262
  • 331
12

sudo iptables -F will flush the firewall rules. You won't be able to turn off the firewall as it is built into the kernel.

7

By default, the firewall on Ubuntu (which can't be removed, because its part of the kernel) is unconfigured, and has default allow on everything. Unless you've added ufw or iptables rules, the firewall (which cannot be disabled because its part of the kernel) will not filter/block anything (Default ALLOW rule).

Thomas Ward
  • 78,878
1

I had a problem that I can not access a server on my hosting machine (Ubuntu 14.04 64 Bit) from a guest windows machine by VMWare Player. I had been around for like a two days searching for a network solution while the problem was all about firewall.

I decided that it is all about firewall and I tried to see how to stop the firewall, I tried this solution : sudo ufw disable
didn't work with me, however I used another way

sudo service iptables stop

Then i tried to access the servers, and IT WORKS finally. Hope this helps

aibrahim
  • 277
  • 2
  • 10