Skip to content

Ufw

linux commands


ufw

UFW (uncomplicated firewall) is a firewall configuration tool that runs on top of iptables, included by default within Ubuntu distributions. It provides a streamlined interface for configuring common firewall use cases via the command line.

Setting up ufw:

sudo apt install ufw
sudo ufw enable

Checking the service status:

sudo ufw status

Disable the service:

sudo ufw disable

You can also control and block ip addresses ports etc: https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands

Allow comms on a port via tcp:

sudo ufw allow 3306/tcp

Show added rules:

sudo ufw status numbered

Delete a specific rule:

sudo ufw delete 2

See also