How do I turn off the firewall in Ubuntu 12.04?

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?


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

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.


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).