UFW stand for Uncomplicated Firewall. The UFW Firewall is the one of the simplest Firewall. The IPtables is the persistent firewall but it is so complicated to configure but in the case of UFW keeping simplicity in mind the UFW Firewall provides the easy configurations and tight security. It is so easy to configure so the newbie also integrate the UFW firewall on their respective Linux distro with ease. This guide provides how to setup the UFW firewall on you respective Linux Distributions.

Step-1 (Installing UFW firewall)

The UFW firewall comes pre installed with Ubuntu  but in the case it is missing you can install it.

$ sudo apt-get install ufw -y
Step-2 (Enabling the UFW firewall)

Enabling UFW firewall is so easy it can be done by typing given command

$ sudo ufw enable
Step-3 (Adding UFW Firewall Rules)

The UFW firewall rules is set according to the port numbers and additional port based rules.

For Enabling Firewall Rules on various default ports

On HTTP (80) Port

$ sudo ufw allow http

On HTTPS (443) Port

$ sudo ufw allow https

On SSH (22) Port

$ sudo ufw allow ssh
For Enabling Firewall Rules on various custom ports

On Custom port like 3360
For IPv4

$ sudo ufw allow 3360/tcp

For IPv6

$ sudo ufw allow 3360/tcp6
Step-4 (Remove the UFW firewall rules)

You can easily remove those already added rules by typing

To Remove Firewall Rules on various default ports

Remove default HTTPS Rules

$ sudo ufw delete allow https
To Remove Firewall Rules on various custom ports

Remove custom 3360 rules
For IPv4

$ sudo ufw delete allow 3360/tcp

For IPv6

$ sudo ufw delete allow 3360/tcp6
Step-5 (Check status of UFW firewall)

To check the UFW firewall whether it is running or not and which rules has been integrated to UFW firewall.

$ sudo ufw status
Step-6 (Reset all the UFW firewall rules)

If anything got wrong then you can reset the UFW firewall by typing

$ sudo ufw reset
Step-7 (Disable UFW firewall)

If you want to setup another firewall rather than UFW then to avoid conflicts between two firewall it is possibility to disable the UFW firewall first.

Note: After disabling UFW firewall it no longer works for you so think twice before doing this step. If you have another firewall ready to integrate on your distro then please proceed for further steps.

$ sudo ufw disable

Final Words

The UFW firewall is easy to integrate so you have to setup the UFW firewall on your respective distro with ease. If you have any additional queries or questions then go ahead and use the comment section below for help and support.

How to Extract tar.gz / tar.bz2 / tar.xz Files on Linux

Previous article

How to Backup MariaDB / MySQL Database on Ubuntu / CentOS

Next article

You may also like


Leave a reply

Your email address will not be published. Required fields are marked *

More in Linux