eolas/zk/UFW_firewall_management.md

939 B

tags created
servers
procedural
linux
firewalls
Sunday, February 16, 2025

UFW firewall management

ufw (Uncomplicated Firewall) simplifies the process of setting up firewalls on your server, without directly using iptables.

sudo apt install ufw

First we deny all incoming requests as the default:

ufw default deny incoming

And allow all outgoing requests as the default:

ufw default allow outgoing

Next we need to allow certain requests based on their port:

Port Service Rule
22 SSH allow
80 HTTP allow
443 HTTPS allow
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Enable:

ufw enable

Verify rules:

ufw status --verbose

Command for allowing access to a port on the Docker bridge network

sudo ufw allow from 172.18.0.0/16 to any port 8006