How to Install UFW Ubuntu Firewall on Debian Linux

UFW Ubuntu Firewall is Uncomplicated Firewall which is easy to Configure. Even though UFW mostly been used in Ubuntu Linux, UFW also available for the Debian Linux.

In this tutorial we are going to learn how to install UFW Firewall on Debian Linux and configure UFW as the Debian firewall.

Install UFW Firewall on Debian

We can install UFW on Debian Linux using apt-get install command. Open the Linux terminal and first update the apt source list, then install the UFW on Debian.

apt-get update

apt-get install ufw

Install UFW Ubuntu Firewall on Debian Linux

Enable UFW on Debian

After the installation is finished, we can start and enable the firewall on Debian using ufw enable command.

But before you enable the debian firewall, you should add a firewall rule to allow ssh connections to the server. This is because by default ufw block all incoming traffic to the server, which means if you activate the firewall without allowing ssh you won’t be able access your debian system from a remote computer.

ufw allow ssh/tcp

Now we can enable the debian ufw firewall using ufw enable command.

ufw enable

Once you enable the ufw, The firewall will also start at the system reboot.

Disable UFW Firewall on Debian

Using ufw disable command we can disable the debian ufw firewall.

ufw disable

Once you disable the UFW, Firewall will be stopped and will not start at the system reboot.

Firewall Rules Examples

ufw allow 53

Open port 53 (Both TCP and UDP Protocol) from the debian firewall.

ufw allow 21/tcp

Open TCP port 21 from the debian firewall.

ufw allow from 192.168.1.50 to any port 22 proto tcp

Open TCP port 22 for the IP Address 192.168.1.50

ufw allow from any to any port 80 proto tcp

Open TCP port 80(HTTP) for Everyone.

Delete Firewall Rule

The Firewall rules can delete by using either the original rule or the rule number. Ufw delete command use to remove firewall rules in UFW.

Example

For example, if the firewall rule is

ufw allow from 192.168.1.50 to any port 22 proto tcp

Then delete the rule as follows

ufw delte allow from 192.168.1.50 to any port 22 proto tcp

Click here to Learn more about deleting firewall rules in UFW Ubuntu Firewall.

Summary : Install UFW Debian Linux

In This tutorial we learned How to install and configure UFW on Debian Linux. First, we install ufw on Debian using apt-get install command, then enable the firewall using ufw enable command.

Go to Following URL www.configserverfirewall.com/ufw-ubuntu-firewall/ to learn more about Ubuntu Firewall.

submit to reddit