Linux Mint

How to open a firewall on Linux Mint

A firewall secures a network by allowing or blocking incoming and outgoing data packets based on security rules. An effective firewall analyzes incoming traffic using pre-established rules and avoids attacks by filtering suspicious or unsecured traffic. Firewalls protect computer traffic at ports, where external devices exchange information with a computer. Using such a firewall, you can block malicious traffic like viruses and hackers from entering your internal network from external sources. So, in this article, we will explain what a UFW firewall is and how you can open a firewall port on Linux Mint.

What is UFW (Uncomplicated Firewall) in Linux Mint

UFW (Uncomplicated Firewall) is an easy-to-use and dependable firewall interface that provides a command-line interface for interacting with the firewall. Furthermore, if you prefer not to use the command line, UFW provides several graphical user interface (GUI) features that make dealing with the system a breeze. So to install UFW using a terminal, you need to type:

$ sudo apt install ufw

After its installation, you can verify if UFW is enabled or not by typing.

$ sudo systemctl status ufw

There are two possibilities when you execute this command on the terminal; either you will get the active status or inactive status:

As you can see, the UFW is active and running; the next step is to allow any application or a port with this firewall.

How to open firewall ports on Linux Mint

Many utilities in Linux use ports for communication and SSH is one of them. If you want to open the port of the OpenSSH for incoming and outgoing communication, you need to type:

$ sudo ufw allow openSSH

The firewall may block the communication because of the port permission and if you are interested in opening the port for this purpose, then you can type:

$ sudo ufw allow 22/tcp

22 is the port used by SSH, you can verify if these rules have been implemented or not by typing again.

$ sudo ufw status verbose

You can also stop or disable any specific port for communication, and for that, you can type.

$ sudo ufw deny 22/tcp

And after the verification, you will get the status mentioned below.

Conclusion

A firewall secures a network by monitoring incoming and outgoing data packets, allowing, or blocking them based on security rules. According to a set of security rules, firewalls monitor inbound and outbound network traffic and decide whether or not to allow data packets. This article shows you how you can open any specific port for communication using the UFW firewall in Linux Mint.

About the author

Taimoor Mohsin