How to Install and Configure UFW – An Un-complicated FireWall in Debian/Ubuntu
Since computers are connected to each other, services are growing fast. Email, Social Media, Online Shop, Chat until Web Conferencing are services that used by user. But on the other side this connectivity just likes a double-side knife. It’s also possible to send bad messages to those computers like Virus, malware, trojan-apps are one of them.
Install UFW Firewall
The Internet, as the biggest computer network is not always fill with good people. In order to make sure our computers / servers are safe, we need to protect it.
One of the must have component on your computer / servers is Firewall. From Wikipedia, a definition is:
In computing, a firewall is a software or hardware-based network security system that controls the incoming and outgoing network traffic by analysing the data packets and determining whether they should be allowed through or not, based on applied rule set.
Iptables is one of the firewall that widely used by servers. It is a program used to manage incoming and outgoing traffic in the server based on a set of rules. Generally, only trusted connection is allowed to enter the server. But IPTables is running at console mode and it’s complicated. Those who’re familiar with iptables rules and commands, they can read the following article that describes how to use iptables firewall.
Installation of UFW Firewall in Debian/Ubuntu
To reduce the complexity of how-to setting IPTables, there is a lot of fronted. If you’re running Ubuntu Linux, you will find ufw as a default firewall tool. Lets start to explore about ufw firewall.
What is ufw
The ufw (Uncomplicated Firewall) is an frontend for most widely used iptables firewall and it is well comfortable for host-based firewalls. ufw gives a framework for managing netfilter, as well as provides a command-line interface for controlling the firewall. It provides user friendly and easy to use interface for Linux newbies who are not much familiar with firewall concepts.
While, on the other side same complicated commands helps administrators it set complicated rules using command line interface. The ufw is an upstream for other distributions such as Debian, Ubuntu and Linux Mint.
Basic Usage ufw
First, check if ufw is installed using following command.
$ sudo dpkg --get-selections | grep ufw ufw install
If it’s not installed, you can install it using apt command as shown below.
$ sudo apt-get install ufw
Before you use, you should check whether ufw is running or not. Use the following command to check it.
$ sudo ufw status
If you found Status: inactive, it mean it’s not active or disable.
NEW! An indispensable ebook for every Linux administrator!
Enabling / Disabling ufw
To enable it, you just need to type the following command at the terminal.
$ sudo ufw enable Firewall is active and enabled on system startup
To disable it, just type.
$ sudo ufw disable
List the current ufw rules
After the firewall is activated you can add your rules into it. If you want to see what are the default rules, you can type.
$ sudo ufw status verbose
Sample Output
Status: active Logging: on (low) Default: deny (incoming), allow (outgoing) New profiles: skip $