I tried to diagnose this problem for a few weeks from now, tried everything I could do (except disabling ufw) but to no avail.
System: Kubuntu 21.04 with kubuntu-ppa/backports
What I tried to do: Enable UFW through sudo ufw enable
What happened: Whenever I enabled UFW, the system may get stuck when booting / rebooting. There is no indication where the system got stuck. Entered tty on boot, found systemd-hostnamed loaded but failed to activate. Reason was timeout.
What I tried to do:
Disable networkmanager-wait-online.service
Disable NetworkManager's connectivity check
Attempting to start and save UFW rules with the dispatcher script from https://help.ubuntu.com/community/IptablesHowTo#Solution_.233_iptables-persistent
Error messages: https://imgur.com/K5FWGAK
Now this is frustrating, because I did set WatchdogSec=1min
and DefaultStartTimeout=10s
and DefaultStopTimeout=10s
, none of it seemed to affect service timeout during boot.
It seems that UFW is conflicting with NetworkManager / systemd-hostnamed / DNS service. Of course, disabling ufw solves the problem, but not an option. This never happened to me on Ubuntu with the same set of applications installed, so I doubt it is VPN or other network services affecting this.
Edit #1: sudo ufw status verbose
output:
karsten@karsten-kbt-pc:~ (・∀・)> sudo ufw status verbose
[sudo] password for karsten:
Status: active
Logging: on (low)
Default: reject (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
80/tcp ALLOW IN Anywhere
443 ALLOW IN Anywhere
53 ALLOW IN Anywhere
6881 ALLOW IN Anywhere
8881/udp ALLOW IN Anywhere
1401/tcp ALLOW IN Anywhere
1194:1197/udp ALLOW IN Anywhere
1300:1303/udp ALLOW IN Anywhere
1400/udp ALLOW IN Anywhere
51820 ALLOW IN Anywhere
80/tcp (v6) ALLOW IN Anywhere (v6)
443 (v6) ALLOW IN Anywhere (v6)
53 (v6) ALLOW IN Anywhere (v6)
6881 (v6) ALLOW IN Anywhere (v6)
8881/udp (v6) ALLOW IN Anywhere (v6)
1401/tcp (v6) ALLOW IN Anywhere (v6)
1194:1197/udp (v6) ALLOW IN Anywhere (v6)
1300:1303/udp (v6) ALLOW IN Anywhere (v6)
1400/udp (v6) ALLOW IN Anywhere (v6)
51820 (v6) ALLOW IN Anywhere (v6)