I need help on using UFW

Discussion in 'Server Operation' started by concept21, Sep 29, 2023.

Tags:
  1. concept21

    concept21 Active Member

    Dear Ubuntu Experts,
    I am switching from an Oracle Linux server to Ubuntu 22.04 server which provide more packages for desktop development and hardware development.

    Under Oracle Linux, I have the Gnome firewalld GUI which is every good and easy to use. However, Ubuntu 22.04 Gnome, I only have a simple UFW UI.

    Now, I am facing a problem. I do not know yet what is the difference between these commands:
    sudo ufw [option]
    sudo systemctl [option] ufw.service

    For instance, when I ran:
    sudo ufw disable
    ufw still started after a reboot.

    So it there a simple guide to use them? :rolleyes:
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I use systemctl. If it controls the service it should be used, and not directly the service commands.
     
    ahrasis likes this.
  3. concept21

    concept21 Active Member

    I found that if I issued ufw command, systemctl did not control ufw any more.
    I am still confused. :confused:
     
  4. RFC

    RFC New Member

    1. sudo ufw [option]:
      • sudo ufw enable: This command enables the UFW (Uncomplicated Firewall) and starts it.
      • sudo ufw disable: This command disables the UFW and stops it.
      • sudo ufw status: This command shows the current status and rules of the firewall.
      Note: Disabling UFW with sudo ufw disable should persist across reboots. If you are still facing issues after a reboot, there might be another factor causing it.

    2. sudo systemctl [option] ufw.service:
      • sudo systemctl start ufw.service: This starts the UFW service.
      • sudo systemctl stop ufw.service: This stops the UFW service.
      • sudo systemctl enable ufw.service: This enables the UFW service to start on boot.
      • sudo systemctl disable ufw.service: This disables the UFW service from starting on boot.
      Note: The systemctl commands are related to managing systemd services, and in this case, the UFW service.
    Now, if you're facing issues with the firewall not staying disabled after a reboot, you might want to check other services or configurations that could be interacting with the firewall.
     
    Last edited: Dec 14, 2023
    concept21, Th0m and ahrasis like this.

Share This Page