How to Install & Configure Uncomplicated Firewall(UFW) on ubuntu 20.04 LTS.

UFW, or Uncomplicated Firewall, is a front-end to iptables. It provides to make managing  firewall drop-dead simple and to provide an easy-to-use interface.Using UFW,we can enable or disable many ports.It uses a command-line interface consisting of a small number of simple commands, and uses iptables for configuration.

UFW is available by default in all Ubuntu installations after 8.04 LTS.

If we want to install UFW on ubuntu20.04.Run the Following command.

Install the required packages.

apt-get update
apt-get install ufw

Enable or Disable Services

ufw allow ssh
or
ufw delete allow ssh
ufw allow http
or
ufw allow 'HTTP'
ufw allow 80/tcp
or 
ufw deny 80/tcp

Enable or disable using port numbers

ufw allow 22
or
ufw deny 22
ufw allow 80
ufw allow 1725/udp

We can also allow or deny IP address

ufw allow from ip-address
ufw allow from ip-address to any port 22 proto tcp

Here is the command output.

Fig 2

Check UFW Status

ufw status

Here is the command output.

Fig 1

List the UFW  applications.

ufw app list

Here is the command output.

Fig. 4

Enable UFW

ufw enable

Here is the command output.

Fig. 5

Information of UFW  applcations

ufw app info 'OpenSSH'

Here is the command output.

Fig. 6

Using IPv6 with UFW.Open the UFW configuration with this command:

vim /etc/default/ufw

IPv6 is set to “yes”

Fig. 7

 

Leave a Reply

Your email address will not be published.