You are not logged in.

#1 2021-12-16 12:07:42

jal
Member
Registered: 2015-04-23
Posts: 37

[SOLVED] UFW not enabled on boot

Hello,

I have an openvpn service that runs on boot just fine, but I'd like to have my UFW running on boot as a killswitch also.

Enabling either via

$ systemctl enable ufw.service
or
$ ufw enable

does not persist at boot.

Following the advice here:
https://bbs.archlinux.org/viewtopic.php?id=169846

iptables.service and ip6tables.service are disabled (did not resolve issue).

$ systemd-analyze blame | grep ufw
returns a blank.

$ cat /etc/systemd/system/multi-user.target.wants/ufw.service

[Unit]
Description=CLI Netfilter Manager
DefaultDependencies=no
After=systemd-sysctl.service
After=syslog.target network.target openvpn-client@myvpnputhere.service 
Before=sysinit.target
ConditionPathExists=|/etc/ufw/ufw.conf
ConditionDirectoryNotEmpty=|/usr/lib/ufw

[Service]
Type=oneshot
ExecStart=/usr/lib/ufw/ufw-init start
ExecStop=/usr/lib/ufw/ufw-init stop
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Would anyone have any suggestions / requests for further info?

Cheers

Last edited by jal (2021-12-16 12:12:40)

Offline

#2 2021-12-16 12:12:08

jal
Member
Registered: 2015-04-23
Posts: 37

Re: [SOLVED] UFW not enabled on boot

OK - this is solved by me by commenting out

#After=syslog.target network.target openvpn-client@myvpnputhere.service 

in /etc/systemd/system/multi-user.target.wants/ufw.service

I have

myvpnsIP 1194/udp   ALLOW OUT   Anywhere 

in my firewall, so it doesn't need to be ordered anyhow. I'll leave this up in case of use - Mods, delete if you think best.

Offline

Board footer

Powered by FluxBB