UFW – Uncomplicated Firewall

To turn on UFW,

sudo ufw allow 22
sudo ufw enable
sudo ufw status
sudo systemctl enable ufw
sudo systemctl start ufw

Adding exceptions

sudo ufw allow <port number or service name>
sudo ufw status numbered
sudo ufw reset
sudo ufw delete <number>

Specific Services

SSH

sudo ufw allow 22/tcp
# or
sudo ufw allow ssh

Samba

sudo ufw allow Samba

syncthing

sudo ufw allow syncthing
sudo ufw allow syncthing-gui

dnsmasq and dhclient

for enabling wifi bridging in ubuntu

sudo ufw allow to any port 53
sudo ufw allow to any port 67 proto udp
sudo ufw allow to any port 68 proto udp

Wireguard

sudo ufw allow 51820/udp

Unknown / Unused

sudo ufw allow 1701/tcp
sudo ufw allow 9901/tcp
sudo ufw allow 50000

External references