Is the ufw firewall default setting save or not?

Asked by Manes


I installed Ubuntu 8.04 on my computer. I enabled the firewall ufw by "sudo ufw enable". What is the default status of ufw? Is it save or not? Are there any ports open? Can someone access my computer from the Internet? I would like to avoid this.
What do I need to do forbid any access from the Internet? I know there it the command "sudo ufw default deny". Only this doesn't seem to be persistent. I would not like to run it with each log on. How could I make this persistent?

Thanks for your help


Question information

English Edit question
Ubuntu ufw Edit question
No assignee Edit question
Solved by:
Vojtěch Trefný
Last query:
Last reply:
Revision history for this message
Best Vojtěch Trefný (vojtech.trefny) said :

Hi, default status of UFW is to deny all incoming traffic. If you want to create special rules, or just set the firewall, you can use GUFW - graphical interface for UFW -- it's simple and easy.

Homepage --
Launchpad page --

Revision history for this message
Deepak Mishra (dpux) said :

download the GUI (Gufw), this will get you what you want.

Revision history for this message
bodhi.zazen (bodhi.zazen) said :

I hate to post contrary information, but the default status of ufw is permissive :

Also gui tools do not answer the OP question nor do they work on server w/o X, LOL

Check it out for yourself :

sudo ufw enable
sudo iptables -L

To set your default, use

sudo ufw default allow


sudo ufw default deny

See also :

Revision history for this message
Jamie Strandboge (jdstrand) said :

By default the firewall is disabled. If you do 'sudo ufw enable', the firewall is default deny for incoming and default allow for outgoing. Once ufw is enabled, it is saved so subsequent reboots will have it enabled. ufw has a straightforward command line interface for adding rules and changing various settings. Please see and 'man ufw' for details.

Revision history for this message
Manes (manes-j-deactivatedaccount) said :

Thanks Vojtěch Trefný, that solved my question.