An introduction to Uncomplicated Firewall (UFW)
UFW stands for an uncomplicated firewall. This program comes with a command-line interface and a Netfilter (iptables) firewall management framework.
The UFW firewall tool runs on hosts or servers and is designed to protect data. Depending on its configuration, it allows or blocks outgoing and incoming connections on a server. Using UFW, you can block specific ports, IP addresses, or entire subnetworks. This is not as flexible as iptables, but it is much simpler to use for basic operations. Ubuntu 8.04 LTS and newer installations come with Ubuntu UFW by default.
In this tutorial, we will go over a few utilities and techniques for debugging the UFW.
Step 1: Enable UFW
The UFW will be enabled with a default set of rules when the following commands entered,
sudo ufw enable
You can check the status of the server firewall by running this command,
sudo ufw status
Here are some possible results,
1) UFW is not installed.
2) UFW is installed, but not configured.
3) UFW is running.
1) sudo ufw status ufw: command not found ======================= 2) sudo ufw status Status: inactive ======================= 3) sudo ufw status Status: active To Action From -- ------ ---- 1194 ALLOW Anywhere 80 ALLOW Anywhere 443(v6) ALLOW Anywhere
Step 2: Disable UFW
Enter this command to disable,
sudo ufw disable
Step 3: Reset UFW to default
Enter this command to reset the configuration back to default,
sudo ufw reset
We’re going to demonstrate one operation with the UFW, enabling Only SSH and denying everything else,
In this example, inbound traffic is blocked except for SSH (port 22).
sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow ssh sudo ufw enable sudo ufw reload
However, we haven’t discussed all of the useful commands here, so be sure to investigate them as well.
VPSie is looking forward to embarking on a new journey with you!.
Get the most out of learning with VPSie.com