UFW Essentials


UFW Essentials

Installing UFW

sudo apt update
sudo apt install ufw

Enable UFW

sudo ufw enable

Disable UFW

sudo ufw disable

Adding Rules

sudo ufw allow from 10.0.0.0/24 to any port 22:77 proto tcp comment 'Custom-FROM LAN10'
sudo ufw allow from 10.0.0.0/24 to any port 22:77,3389,8765 proto tcp comment 'Custom2-FROM LAN10'

Removing Rules

sudo ufw status numbered
sudo ufw delete 2

Checking Satus

sudo ufw status

Locations

/etc/ufw/

IPv4

/etc/ufw/user.rules

IPv6

/etc/ufw/user6.rules

  • https://docs.ansible.com/ansible/latest/modules/ufw_module.html
,