You are not logged in.

#1 2024-03-22 10:55:07

Jphillips
Member
Registered: 2019-08-23
Posts: 68

ufw.service enabled and active, but ufw disabled [SOLVED]

I have ufw.service enabled through systemd, and it loads on startup fine without any issues. But if I type sudo ufw status, it still says it's disabled. Is this normal behavior? If so, is there a way to check which ports are allows/disabled through ufw without having to start ufw manually?

EDIT: The solution was to stop/disable iptables.service, as clearly stated in the installation.

Last edited by Jphillips (2024-04-02 10:33:08)

Offline

#2 2024-03-22 11:08:37

NoSavvy
Member
From: Dorchester, Dorset, UK
Registered: 2013-01-23
Posts: 127

Re: ufw.service enabled and active, but ufw disabled [SOLVED]

Try "sudo ufw enable"  after you're sure that systemctl ufw is running.

Offline

#3 2024-03-22 11:15:46

Jphillips
Member
Registered: 2019-08-23
Posts: 68

Re: ufw.service enabled and active, but ufw disabled [SOLVED]

That enables it, but if it's already enabled through systemd, why can't I check on the port status without (re)enabling it through sudo ufw enable?

Last edited by Jphillips (2024-03-22 11:16:15)

Offline

#4 2024-03-22 11:19:47

Jphillips
Member
Registered: 2019-08-23
Posts: 68

Re: ufw.service enabled and active, but ufw disabled [SOLVED]

To be more specific, when I restart, here's the output of systemd:

$ sudo systemctl status ufw.service 
● ufw.service - CLI Netfilter Manager
     Loaded: loaded (/usr/lib/systemd/system/ufw.service; enabled; preset: disabled)
     Active: active (exited) since Fri 2024-03-22 11:12:01 GMT; 3min ago
    Process: 38840 ExecStart=/usr/lib/ufw/ufw-init start (code=exited, status=0/SUCCESS)
   Main PID: 38840 (code=exited, status=0/SUCCESS)
        CPU: 240ms

Mar 22 10:02:01 tee systemd[1]: Starting CLI Netfilter Manager...
Mar 22 10:02:01 tee systemd[1]: Finished CLI Netfilter Manager.

And here's the output of ufw:

$ sudo ufw status
Status: inactive

So to manage the ports for ufw I have to re-enable it. But this also makes me think it's not actually loaded at boot, despite what systemd says.

Offline

#5 2024-03-22 12:58:16

NoSavvy
Member
From: Dorchester, Dorset, UK
Registered: 2013-01-23
Posts: 127

Re: ufw.service enabled and active, but ufw disabled [SOLVED]

sudo systemctl enable --now ufw.service
Check with systemctl status ufw.   It should show enabled and 'preset' enabled
cat /etc/ufw/ufw.conf to check that it is enabled in that file. If not run sudo ufw enable
Reboot and and all should be OK.

Last edited by NoSavvy (2024-03-22 12:59:14)

Offline

#6 2024-04-02 09:57:50

Jphillips
Member
Registered: 2019-08-23
Posts: 68

Re: ufw.service enabled and active, but ufw disabled [SOLVED]

Running "sudo systemctl enable --now ufw.service" still shows the preset as disabled. /etc/ufw/ufw.conf shows ENABLED=yes

Offline

#7 2024-04-02 10:32:33

Jphillips
Member
Registered: 2019-08-23
Posts: 68

Re: ufw.service enabled and active, but ufw disabled [SOLVED]

This was stupid on my part -- I didn't disable iptables.service, as states in the first line of the wiki....

Offline

Board footer

Powered by FluxBB