[SOLVED] Does Anyone Know Why My UFW Keeps Turning Itself Off?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

[SOLVED] Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 6:49 pm

It doesn't seem to matter whether I enable UFW through the GUI or CLI, after a reboot or even just after a certain amount of time it just turns itself off. I double checked and start at boot is set to yes. I can't figure it out, I'm barely intermediate at configs. Can someone help me please?
Last edited by Gamemasta114 on Fri Aug 23, 2019 11:18 pm, edited 1 time in total.

gm10
Level 18
Level 18
Posts: 8726
Joined: Thu Jun 21, 2018 5:11 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by gm10 » Fri Aug 23, 2019 6:57 pm

Does it turn itself off or is it just crashing? Or maybe better: How are you determining that it turned itself off?
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 6:59 pm

gm10 wrote:
Fri Aug 23, 2019 6:57 pm
Does it turn itself off or is it just crashing? Or maybe better: How are you determining that it turned itself off?
I can either open the GUI and it'll show that it's off or i can sudo ufw status and it'll say disabled. At that point I can turn it on again and it'll be enabled but when I reboot it will be off again.

all41
Level 15
Level 15
Posts: 5583
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by all41 » Fri Aug 23, 2019 7:02 pm

sudo ufw status verbose
post the results

Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 7:04 pm

all41 wrote:
Fri Aug 23, 2019 7:02 pm
sudo ufw status verbose
post the results
I manually enabled it about 20 minutes ago.

Code: Select all

Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

gm10
Level 18
Level 18
Posts: 8726
Joined: Thu Jun 21, 2018 5:11 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by gm10 » Fri Aug 23, 2019 7:08 pm

Well, wait for it to be turned off again, check whether the configuration file was changed: /etc/ufw/ufw.conf. If it still says enabled then it crashed, otherwise someone or something changed the configuration. Either way time to then check the logs I guess.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

all41
Level 15
Level 15
Posts: 5583
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by all41 » Fri Aug 23, 2019 7:11 pm

run sudo ufw status verbose when you suspect ufw is disabled and post those results again
Also cat /etc/ufw/ufw.conf does ENABLED=yes
Last edited by all41 on Fri Aug 23, 2019 7:15 pm, edited 1 time in total.

Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 7:14 pm

gm10 wrote:
Fri Aug 23, 2019 7:08 pm
Well, wait for it to be turned off again, check whether the configuration file was changed: /etc/ufw/ufw.conf. If it still says enabled then it crashed, otherwise someone or something changed the configuration. Either way time to then check the logs I guess.
Well that's strange. I rebooted and checked the status and it was inactive as expected, I went to check the config file again and this time start on boot is set to no. I swear it was yes before the reboot, I even double checked it.

Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 7:23 pm

gm10 wrote:
Fri Aug 23, 2019 7:08 pm
Well, wait for it to be turned off again, check whether the configuration file was changed: /etc/ufw/ufw.conf. If it still says enabled then it crashed, otherwise someone or something changed the configuration. Either way time to then check the logs I guess.
Now I know I'm not seeing things. I just went and changed the config file to yes again, rebooted and it somehow the config file was back to no. I'm so confused now.

Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 7:26 pm

all41 wrote:
Fri Aug 23, 2019 7:11 pm
run sudo ufw status verbose when you suspect ufw is disabled and post those results again
Also cat /etc/ufw/ufw.conf does ENABLED=yes
So the strange thing is my config file keeps changing itself back to start on boot=no. I changed it with nano and then rebooted and it went back to no and UFW is inactive.

gm10
Level 18
Level 18
Posts: 8726
Joined: Thu Jun 21, 2018 5:11 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by gm10 » Fri Aug 23, 2019 7:57 pm

I guess I should have asked this first but what system is this on actually? Post output of:

Code: Select all

inxi -SIx
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 8:01 pm

gm10 wrote:
Fri Aug 23, 2019 7:57 pm
I guess I should have asked this first but what system is this on actually? Post output of:

Code: Select all

inxi -SIx
Here's my output. I forgot to mention earlier, I'm not sure if it matters to a firewall but I use a VPN.

Code: Select all

System:
  Host: mike-VivoBook-12-ASUS-Laptop-E203MAS-E203MA 
  Kernel: 4.15.0-58-generic x86_64 bits: 64 compiler: gcc v: 7.4.0 
  Desktop: Cinnamon 4.2.3 Distro: Linux Mint 19.2 Tina 
  base: Ubuntu 18.04 bionic 
Info:
  Processes: 206 Uptime: 9m Memory: 3.68 GiB used: 1.29 GiB (35.1%) 
  Init: systemd runlevel: 5 Compilers: gcc: 7.4.0 Shell: bash v: 4.4.20 
  inxi: 3.0.32 

gm10
Level 18
Level 18
Posts: 8726
Joined: Thu Jun 21, 2018 5:11 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by gm10 » Fri Aug 23, 2019 9:26 pm

Doesn't matter. So you're saying that the config file actually changes and reads ENABLED=no after a reboot? Curious, that would mean something is running ufw disable.

Nevertheless run this just in case:

Code: Select all

sudo systemctl enable ufw
and then reboot and check the status.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

LuvNix
Level 3
Level 3
Posts: 127
Joined: Wed Jan 02, 2019 4:50 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by LuvNix » Fri Aug 23, 2019 9:29 pm

Been a long time since bothered messing with ufw but remember seeing this same weird behavior had to go ahead and install it just to be sure, it's staying active now. One of 3 things, make sure you've enabled it with both "sudo ufw enable" and "sudo systemctl enable ufw" try reboot and check if it stays active. If not turn off logging "sudo ufw logging off", reboot and check again. Remember back when, logging was the issue. May have to create or define a log file in the correct place/config file to get it to act right.

all41
Level 15
Level 15
Posts: 5583
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by all41 » Fri Aug 23, 2019 9:32 pm

vpn shouldn't matter.
Try making a new user with 'Users and Groups'
Log out and back in as the new user
How does ufw behave there

LuvNix
Level 3
Level 3
Posts: 127
Joined: Wed Jan 02, 2019 4:50 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by LuvNix » Fri Aug 23, 2019 9:48 pm

Mentioned recall it being logging. Never bothered figuring out where ufw even logs to. Though went ahead and turned it back on "sudo ufw logging low" and its still staying active on reboots now.

Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 9:53 pm

gm10 wrote:
Fri Aug 23, 2019 9:26 pm
Doesn't matter. So you're saying that the config file actually changes and reads ENABLED=no after a reboot? Curious, that would mean something is running ufw disable.

Nevertheless run this just in case:

Code: Select all

sudo systemctl enable ufw
and then reboot and check the status.
I ran your command as well as sudo ufw enable again and the problem persists. I took a couple screenshots of my config file, before and after the reboot. About an hour ago I did a full purge of ufw and gufw, including configs. I reinstalled ufw but it doesn't seem to have helped.
Screenshot from 2019-08-23 21-48-23.png
Screenshot from 2019-08-23 21-45-44.png

Gamemasta114
Level 1
Level 1
Posts: 35
Joined: Wed Jun 05, 2019 8:58 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by Gamemasta114 » Fri Aug 23, 2019 10:00 pm

LuvNix wrote:
Fri Aug 23, 2019 9:29 pm
Been a long time since bothered messing with ufw but remember seeing this same weird behavior had to go ahead and install it just to be sure, it's staying active now. One of 3 things, make sure you've enabled it with both "sudo ufw enable" and "sudo systemctl enable ufw" try reboot and check if it stays active. If not turn off logging "sudo ufw logging off", reboot and check again. Remember back when, logging was the issue. May have to create or define a log file in the correct place/config file to get it to act right.
I tried running sudo ufw logging off but unfortunately I'm still having the issue.

all41
Level 15
Level 15
Posts: 5583
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by all41 » Fri Aug 23, 2019 10:06 pm

and its still staying active on rebbts now
does this mean 'after reboot'?
The ufw enable instruction should be immutable

LuvNix
Level 3
Level 3
Posts: 127
Joined: Wed Jan 02, 2019 4:50 pm

Re: Does Anyone Know Why My UFW Keeps Turning Itself Off?

Post by LuvNix » Fri Aug 23, 2019 10:19 pm

^Yep reboots, android autocorrect. OP then don't know what else to suggest. Just installed it/ufw went through similar and it's working fine now and was same situation 8/9yrs ago when dorking with ufw. Good luck though.

Plus there are other gnu/nix firewalls. If ufw keeps being a pain

Post Reply

Return to “Newbie Questions”