UFW Not Starting After Reboot on Ubuntu (19.04 Tested)

Last Updated on

This seems like a bug / issue – but I could be mistaken.  The UFW (uncomplicated* firewall) service will start after a system reboot ie:  systemctl status ufw…..however, ufw status verbose will indicate that it is inactive.  Adding this line to your rc.local will enable UFW after “netfilter-persistent” thereby preventing its configuration from being overwritten during the boot process.

vi /etc/rc.local

1
2
echo y | ufw enable
exit 0

And the output of ufw status verbose now:

1
2
3
4
5
6
7
8
9
10
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), allow (routed)
New profiles: skip

To Action From
-- ------ ----
Anywhere ALLOW IN 192.168.2.0/24
22/tcp ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)

Enabling rc.local

Lima

About the author

Lima is the visual nautical indicator for "stop instantly."

Leave a Reply