ufw not starting on boot

ufw
6,791

Solution 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.

Solution 2

For me, this was a conflict with firewalld, and was resolved with:

sudo systemctl disable firewalld
Share:
6,791

Related videos on Youtube

Jedi
Author by

Jedi

Updated on September 18, 2022

Comments

  • Jedi
    Jedi over 1 year

    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)
    
    • steeldriver
      steeldriver about 5 years
      Have you looked at systemctl status ufw.service ?
    • Jedi
      Jedi about 5 years
    • Jedi
      Jedi about 5 years
      Is there any way to check if you have another firewall manager installed?
  • Muhammad Ahmad
    Muhammad Ahmad over 4 years
    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.