UFW is not starting for me on boot. My /etc/ufw/ufw.conf
file looks like this:
# /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
Please use the 'ufw' command to set the loglevel. Eg: 'ufw logging medium'.
See 'man ufw' for details.
LOGLEVEL=low
So it seems it should start ok. However straight after boot I always get this:
$ sudo ufw status
Status: inactive
Using the "service" script to start it does not seem to work:
$ sudo service ufw start
$ sudo ufw status
Status: inactive
If I force a reload it will work just fine:
$ sudo ufw reload
Firewall reloaded
$ sudo ufw status
Status: active
And after that the "service" script works just fine:
$ sudo ufw status
Status: active
$ sudo service ufw stop
$ sudo ufw status
Status: inactive
$ sudo service ufw start
$ sudo ufw status
Status: active
How do I get ufw to start on boot?
Edit:
I am using Ubuntu 18.04 so systemd is being used. systemctl is-enabled
reports as follows:
$ sudo ufw status verbose
Status: inactive
$ sudo systemctl is-enabled ufw.service
enabled
I also tried this:
$ sudo systemctl enable ufw
Synchronizing state of ufw.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ufw
$ sudo ufw status verbose
Status: inactive
And after a reboot it remains inactive. journalctl -p err
reports nothing interesting. journalctl -u ufw
reports:
$ journalctl -u ufw
...<snip>...
-- Reboot --
May 26 12:53:36 matt-laptop systemd[1]: Started Uncomplicated firewall.
So it certainly appears that it is attempting to start up ufw...it just seems that it doesn't actually do it!
ufw enable
? https://help.ubuntu.com/community/UFW – PerlDuck May 26 '18 at 09:52ufw enable
successfully starts the firewall and setsENABLED=yes
inufw.conf
(it if isn't already set to "yes"). But this makes no difference. After a reboot ufw is still inactive. – Matt Caswell May 26 '18 at 10:03