[SOLVED, sort of] UFW disabled after reboot

Questions about applications and software
Forum rules
Before you post please read how to get help
Mintnix
Level 1
Level 1
Posts: 44
Joined: Sat Oct 03, 2015 8:00 am

[SOLVED, sort of] UFW disabled after reboot

Postby Mintnix » Mon Nov 06, 2017 6:08 pm

Mint 18.2 KDE

UFW will not stay enabled after a reboot - this is on a fresh install

ufw.conf has "ENABLED=yes"

i've seen many reports of this issue, but nothing that helped me
Last edited by Mintnix on Fri Nov 10, 2017 9:39 am, edited 3 times in total.

lmintnewb2

Re: UFW disabled after reboot

Postby lmintnewb2 » Mon Nov 06, 2017 6:28 pm

Curious did ufw come default or did you install it ? Also which init are you using, systemd ... sysV/systemd-shim ? Depending make sure you enabled the service so that it's started. ie: "sudo systemctl enable ufw" with systemd. Can't remember equivalent command at the moment for SysV but extremely similar in syntax.

Remember coming up against this once before LONG AGO, so this is from hazy memory but couldn't get ufw to stay running for love nor money between reboots. At that time the answer turned out to be turning ufw's logging off. Such as this below.
Logging

To enable logging use:
sudo ufw logging on

To disable logging use:
sudo ufw logging off

Not sure if ufw automatically creates a log for itself ... it should but honestly don't know. Could use commands like "locate ufw" to see important places throughout the filesystem and should possibly include any such logs location in the OS's filesystem and using "man ufw" will also list some important files and their locations for a given thing too.

Why not ... while of course you may want ufw logging, in which case that's something you'd have to take up with google, as am not overly familiar with uncomplicated firewall usage. However there's a metric gazillion ways to monitor and log network traffic etc in gnu/Linux, sans ufw. Yet another thing I'd advise taking up with google as am not up to reinventing the wheel with a subject SO well documented 4mil places online already.

Mintnix
Level 1
Level 1
Posts: 44
Joined: Sat Oct 03, 2015 8:00 am

Re: UFW disabled after reboot

Postby Mintnix » Mon Nov 06, 2017 6:40 pm

i ran this before and UFW still failed to load on boot...

Code: Select all

sudo systemctl enable ufw.service


funny you mention the logging - i was wondering if that might have an effect, but figured it likely wouldn't - well, i disabled UFW logging and rebooted and it is enabled, so thanks for that :)

we'll see if it keeps working

oh, and UFW was installed by default to answer your question

lmintnewb2

Re: [SOLVED] UFW disabled after reboot

Postby lmintnewb2 » Mon Nov 06, 2017 6:42 pm

^ No problem, glad it's sorted out and should continue working, did in my case if I remember anyway. Overall kind of weird, only assuming that there's more to setting up logging with ufw than meets the eye. Was never interested enough in it to bother researching further though. :)

Mintnix
Level 1
Level 1
Posts: 44
Joined: Sat Oct 03, 2015 8:00 am

Re: UFW disabled after reboot

Postby Mintnix » Tue Nov 07, 2017 4:38 pm

well, after another reboot UFW is again disabled

User avatar
minitux
Level 5
Level 5
Posts: 584
Joined: Tue Sep 12, 2017 10:05 am

Re: UFW disabled after reboot

Postby minitux » Tue Nov 07, 2017 4:57 pm

For first run

Code: Select all

sudo ufw enable
for every boot

Code: Select all

sudo systemctl enable ufw
Sorry for my English, is not my language

When you ask for support, put the output of inxi -Fxz

Mintnix
Level 1
Level 1
Posts: 44
Joined: Sat Oct 03, 2015 8:00 am

Re: UFW disabled after reboot

Postby Mintnix » Tue Nov 07, 2017 6:07 pm

i know i can do it manually, but the idea is to get to auto-run on boot

right now i'm trying this...

Code: Select all

/etc/init/ufw.conf

#start on (starting network-interface
#          or starting network-manager
#          or starting networking)
start on startup

User avatar
minitux
Level 5
Level 5
Posts: 584
Joined: Tue Sep 12, 2017 10:05 am

Re: UFW disabled after reboot

Postby minitux » Tue Nov 07, 2017 6:09 pm

this set to autorun on boot
minitux wrote:for every boot

Code: Select all

sudo systemctl enable ufw
Sorry for my English, is not my language

When you ask for support, put the output of inxi -Fxz

lmintnewb2

Re: UFW disabled after reboot

Postby lmintnewb2 » Tue Nov 07, 2017 7:20 pm

Mentioned limited and long ago experience with this software. Not sure what went wrong for you. Out of curiosity went ahead and installed it, quick google refresher course ... Then ran the following stuff in order "sudo ufw enable", then "sudo systemctl enable ufw", "sudo systemctl start ufw". Then set the defaults "sudo ufw default allow outgoing" and "sudo ufw default deny incoming", "sudo ufw logging off" google says the default for it is low. Went ahead with reload/restart afterwards "sudo ufw reload" and "sudo systemctl restart ufw".

Overall not getting it with or without logging, it's automatically running between reboots. After repeated reboots and checking the sucker with "sudo ufw status verbose". Only thing that's coming to mind is perhaps you missed the reload/restart between changes leaving it disabled again ? Nope ... turned logging off, reboot still running, then back on at low, still running w/o reload/restart necessary.

Missed the setting default steps ?

Mintnix
Level 1
Level 1
Posts: 44
Joined: Sat Oct 03, 2015 8:00 am

Re: UFW disabled after reboot

Postby Mintnix » Tue Nov 07, 2017 8:56 pm

when i installed LM 17.x and 18.1, all i had to do was enable ufw using the GUI (gufw i think it is) and nothing more - never had a problem with it - 18.2 is another story and, for me, has been buggier than .1

right now it's still working since i made the change to ufw.conf outlined in my previous post, so we'll see what happens and if it stays running i'll mark this solved

User avatar
minitux
Level 5
Level 5
Posts: 584
Joined: Tue Sep 12, 2017 10:05 am

Re: UFW disabled after reboot

Postby minitux » Wed Nov 08, 2017 3:31 am

how to activate ufw in autorun is what i told you before and on mint 18 i have no problem activating it so, without touching any configuration files.

Code: Select all

sudo systemctl enable ufw
and not as you wrote

sudo systemctl enable ufw.service

here is a command line guide for ufw
https://kaosx.us/docs/ufw/
Sorry for my English, is not my language

When you ask for support, put the output of inxi -Fxz

Mintnix
Level 1
Level 1
Posts: 44
Joined: Sat Oct 03, 2015 8:00 am

Re: UFW disabled after reboot

Postby Mintnix » Wed Nov 08, 2017 8:33 am

'sudo systemctl enable ufw'' doesn't work either - nor does my change to ufw.conf

again ufw was disabled after resuming from suspend

User avatar
minitux
Level 5
Level 5
Posts: 584
Joined: Tue Sep 12, 2017 10:05 am

Re: UFW disabled after reboot

Postby minitux » Wed Nov 08, 2017 8:43 am

where do you see it being disabled when you reboot?

did you use this to check the status?

Code: Select all

sudo ufw status
Sorry for my English, is not my language

When you ask for support, put the output of inxi -Fxz

Mintnix
Level 1
Level 1
Posts: 44
Joined: Sat Oct 03, 2015 8:00 am

Re: UFW disabled after reboot

Postby Mintnix » Wed Nov 08, 2017 8:46 am

no, i have just been running gufw (the GUI) to check status

next time i will check from the terminal

User avatar
minitux
Level 5
Level 5
Posts: 584
Joined: Tue Sep 12, 2017 10:05 am

Re: UFW disabled after reboot

Postby minitux » Wed Nov 08, 2017 8:57 am

yes, check by terminal ufw

Gufw is a graphical interface for ufw and the thing is different

see here
https://askubuntu.com/questions/256068/ ... ufw-is-off
Sorry for my English, is not my language

When you ask for support, put the output of inxi -Fxz

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: UFW disabled after reboot

Postby greerd » Wed Nov 08, 2017 9:19 am

Hi guys,

Also systemctl status ufw (no need for sudo) should tell you if ufw was started at boot and how long its been running.

Hope this helps a bit.
Image

Mintnix
Level 1
Level 1
Posts: 44
Joined: Sat Oct 03, 2015 8:00 am

Re: UFW disabled after reboot

Postby Mintnix » Wed Nov 08, 2017 9:26 am

thanks for that @greerd - according to that, ufw has been active for 16h - the resume from standby took place about an hour ago - if that's true, then gufw is reporting an incorrect status

i'll check ufw status from terminal and gufw repeatedly to try and verify that

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: UFW disabled after reboot

Postby greerd » Wed Nov 08, 2017 10:19 am

Just to be clear, active doesn't equal enabled, 'systemctl status ufw' only verifies the ufw process was started, not whether it's enabled on startup.

Another thing is iptables might be used instead by perhaps a VPN ? Usually if the VPN has a 'kill switch' or 'network lock' or similar.
Image

User avatar
minitux
Level 5
Level 5
Posts: 584
Joined: Tue Sep 12, 2017 10:05 am

Re: UFW disabled after reboot

Postby minitux » Wed Nov 08, 2017 10:47 am

I think it was just a misunderstanding for him, ufw is enabled and active at startup, if it set the rules from command line or gufw , he see the setting rules.

This has enable and acitive ufw for First time with default settings, block all incoming and allow all outgoing, but only for the current session.

Code: Select all

sudo ufw enable


And this enable and acitive ufw always on startup, ever with default settings

Code: Select all

sudo systemctl enable ufw


He only must set the rules from command line or Gufw.

For command line is all specifiied in the previous link that I had posted.
Sorry for my English, is not my language

When you ask for support, put the output of inxi -Fxz

greerd
Level 5
Level 5
Posts: 706
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: UFW disabled after reboot

Postby greerd » Wed Nov 08, 2017 11:16 am

minitux wrote:I think it was just a misunderstanding for him, ufw is enabled and active at startup, if it set the rules from command line or gufw , he see the setting rules.

OK, cool,
I'd assumed that when ufw was enabled at reboot it booted up disabled, when one would expect it to boot up enabled.
Sorry about that.
Image


Return to “Software & Applications”