2

I am running Ubuntu Server 18.04

When I do:

sudo ufw enable

the output is:

Firewall is active and enabled on system startup

but when I do a reboot and run:

sudo ufw status verbose

the output is:

Status: inactive

I have checked /etc/ufw/ufw.conf:

ENABLED=yes

I have tried:

uninstalling and reinstalling ufw:

sudo ufw logging off

update-rc.d ufw defaults

sudo systemctl enable ufw

I have gone as far as I can go. Any help would be appreciated.

Edit: Hi steeldriver, thank you for your reply. Output is

systemctl status ufw.service
● ufw.service - Uncomplicated firewall
Loaded: loaded (/lib/systemd/system/ufw.service; enabled; vendor 
preset: enab
Active: active (exited) since Tue 2019-02-05 15:01:15 NZDT; 1h 49min 
ago
Docs: man:ufw(8)
Process: 456 ExecStart=/lib/ufw/ufw-init start quiet (code=exited, 
status=0/SU
Main PID: 456 (code=exited, status=0/SUCCESS)
1

I found the culprit. It was iredmail. There was a script in /etc/init.d/iptables that loaded iptables. This was conflicting with ufw preventing ufw from being enabled on boot. Once I stopped this script from running on boot my problem was solved. ufw is enabled on boot now.

  • Can you please guide on how did you removed this conflict. I removed the files "iptables" and "ip6tables" from /etc/init.d/iptables but still UFW gets disables on reboot. – Muhammad Ahmad Aug 15 '19 at 6:53
  • I have webmin installed on my computer. I went to System >> Bootup and Shutdown and there was an option to disable iptables on boot. You could try "sudo chkconfig iptables off". – Jedi Aug 16 '19 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.