How to Setup a Firewall in Linux
Nicholas Mutsaerts
????System Administrator | Microsoft 365 Administrator | IT Support Specialist | Technical Writer | Linux Enthusiast
Why Set Up a Firewall?
Setting of a firewall for Linux lies in three primary reasons:
Steps to Set Up UFW in Ubuntu
The Uncomplicated Firewall (UFW) is a simple firewall application that is included with Ubuntu and can be installed on other distributions of Linux. By default, UFW is disabled.
In order to see the status of UFW, open Terminal and type in the following command line: sudo ufw status
To enable UFW, enter the following command: sudo ufw enable
By default, ALL incoming traffic is blocked. Here are a few command lines to allow UFW. Proceed to allow for SSH, HTTP and HTTPS.
?
To find out the status of the UFW, type in the following command line: sudo ufw status
sudo ufw status verbose – Shows all Rules currently configured for ufw
Additional useful UFW commands
sudo ufw status numbered – Shows rules in numbered order so that you can delete specific rules.
sudo ufw delete 1 – Deletes rule based on number.
sudo ufw disable – Disables ufw
sudo ufw reset – Deletes all rules and disables ufw
The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user-friendly way to create an IPv4 or IPv6 host-based firewall. By default, UFW is disabled. Gufw is a GUI that is available as a frontend.