How to change Nginx firewall status to “active”

10,291

You need to run

sudo ufw enable

to enable the firewall.

You can get further help on ufw on help.ubuntu.com and man ufw.

Example

$ sudo ufw enable
Firewall is active and enabled on system startup
$ sudo ufw status
Status: active

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

$ sudo ufw disable
Firewall stopped and disabled on system startup
$ sudo ufw status
Status: inactive
Share:
10,291

Related videos on Youtube

Caesar
Author by

Caesar

Since half a year I started programming full time. Reading, searching and building my own projects. Diving into html5, css, javascript and PHP. Hope soon can bring support to others.

Updated on September 18, 2022

Comments

  • Caesar
    Caesar almost 2 years

    When I query the netfilter firewall status I get “inactive”:

    $ sudo ufw status
    Status: inactive
    

    I want to change it so I can see this:

    Output
    Status: active
    
    To                         Action      From
    --                         ------      ----
    OpenSSH                    ALLOW       Anywhere                  
    Nginx HTTP                 ALLOW       Anywhere                  
    OpenSSH (v6)               ALLOW       Anywhere (v6)             
    Nginx HTTP (v6)            ALLOW       Anywhere (v6)
    

    I have been looking but didn't find any info about how to set the status.