UFW setup

UncomplicatedFirewall is an interface to iptables to simplify the process of configuring a firewall on Linux systems.

Quick start

  1. Check firewall status:
    sudo ufw status verbose
    
  2. Disable incoming traffic and enable outgoing
    sudo ufw default deny incoming
    sudo ufw default allow outgoing
    
  3. Allow usual connections
    sudo ufw allow ssh
    sudo ufw allow http
    sudo ufw allow https
    
  4. Enable firewall
    sudo ufw enable
    

Extra customizations

To allow specific port ranges:

sudo ufw allow 6000:6007/tcp
sudo ufw allow 6000:6007/udp

To allow specific IP Addresses:

sudo ufw allow from 15.15.15.51
sudo ufw allow from 15.15.15.51 to any port 22