Sunday, July 16, 2017

Ubuntu Server 16.04 firewall UFW configure

Ubuntu using UFW, I found it is easy to config for most of the people.

Here is my basic example configure:

First install ufw:
apt-get install ufw

Which also installed the iptables package.

Then check the status:

ufw status

Shout be disabled for fresh setup.

Next all my configure and enable ufw at the END:
ufw default deny incoming
ufw default allow outgoing
ufw allow 80
ufw allow 443
ufw allow from
ufw enable

Final status should looks like this:
# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
80                         ALLOW IN    Anywhere
443                        ALLOW IN    Anywhere
Anywhere                   ALLOW IN
80 (v6)                    ALLOW IN    Anywhere (v6)
443 (v6)                   ALLOW IN    Anywhere (v6)

No comments:

Post a Comment