You are not logged in.

#1 2024-02-13 00:31:58

spinynorman
Member
Registered: 2024-02-12
Posts: 2

[SOLVED - PEBCAK] ufw not starting on boot

Hi,

I thought I'd check to see if my firewall was active, ufw status said it was not. Surprising as I was sure (or so I thought) I configured it to start automatically.

I have ran :
# ufw enable   // after first install, but also again when I noticed ufw was inactive
systemctl start ufw // Does activate it but then its inactive after reboot

checked the config file :

# /etc/ufw/ufw.conf
#

# Set to yes to start on boot. If setting this remotely, be sure to add a rule
# to allow your remote connection before starting ufw. Eg: 'ufw allow 22/tcp'
ENABLED=yes

I found a tip to add "After=netfilter-persistent.service" to /lib/systemd/system/ufw.service from https://forums.raspberrypi.com/viewtopic.php?t=131125 , but after reboot the ufw is inactive again. I don't have firewalld or any other firewall running. I do have fail2ban running.

I would rather not script it unless I absolutely have to. Have I missed something obvious?


thanks

Last edited by spinynorman (2024-02-13 18:43:32)

Offline

#2 2024-02-13 03:19:52

sammiev
Member
Registered: 2018-12-22
Posts: 84

Re: [SOLVED - PEBCAK] ufw not starting on boot

Just simply run the following command as root or with sudo:
systemctl enable ufw.service

Offline

#3 2024-02-13 18:38:54

spinynorman
Member
Registered: 2024-02-12
Posts: 2

Re: [SOLVED - PEBCAK] ufw not starting on boot

Ah so I had missed possibly the most obvious thing by confusing start and enable for systemctl. Thank you, it starts on boot now!

Offline

#4 2024-02-13 21:13:59

sammiev
Member
Registered: 2018-12-22
Posts: 84

Re: [SOLVED - PEBCAK] ufw not starting on boot

Glad you have it working.

Offline

Board footer

Powered by FluxBB