Uncomplicated Firewall (ufw) on Ubuntu

The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user-friendly way to create an IPv4 or IPv6 host-based firewall.

ufw by default is initially disabled.

First, ufw needs to be enabled. From a terminal prompt enter:

sudo ufw enable

To open a port (SSH in this example):

sudo ufw allow 22

Similarly, to close an opened port:

sudo ufw deny 22

To remove a rule, use delete followed by the rule:

sudo ufw delete allow 22

Uncomplicated Firewall (ufw) on Ubuntu

You May Also Like