Ubuntu Disable Firewall
Ubuntu comes with a tool of firewall configuration which is known as UFW (means Uncomplicated Firewall). This tool is front-end and user-friendly to manage the rules of the iptables firewall and the primary objective of this tool is to enable handling the rules of the firewall easier or as its name defines uncomplicated.
It is suggested for keeping the firewall enabled. But, in some cases, like, testing we might need to disable or stop the firewall in our system. In this article, we will illustrate how to stop or disable the firewall on Ubuntu systems.
Before going deep into explanation, let's understand what is UFW.
What is UFW?
UFW (Uncomplicated Firewall) is a program to manage the Netfilter firewall developed to be easily used. It applies the command line interface composed of a small number of general commands and applies iptables for a configuration process. By default, this Netfilter firewall exists in each installation of Ubuntu after the 8.04 LTS version.
UFW in Ubuntu
The 8.04 version of Ubuntu introduced UFW. By default, it is available in each installations of Ubuntu.
GUIs for UFW
GUI for GFW is intended to be an intuitive, easy, graphical user interface to manage an Uncomplicated firewall. Also, it supports basic tasks like blocking or allowing preconfigured, individual, or common P2P ports. Gufw has been developed for Ubuntu. However, it is available in the Arch Linux and Debian-based distros as well; anywhere GTK, Python, and UFW exist.
Advanced Functionality of UFW
The UFW application can do anything that an iptables could do. It is achieved via using various rule file sets. These files are nothing more as compared to the compatible text file, i.e., iptables-restore. Fine tuning UFW or/and adding other iptables commands are not offered by the UFW command:
Ensure that we are logged in as root users along with the sudo privileges.
Check the Status of the Firewall
To check the latest UFW firewall status, we can use the following command:
By default, the UFW firewall is not enabled. If we have never started UFW before, then the result will look like the below:
Besides, if the firewall has been enabled, then we will see something like the below:
Disable the Firewall
We can use the following command for disabling the UFW firewall in our Ubuntu system:
The result will look like below:
The above command will disable or stop the firewall. However, it will not remove the rules of the firewall. Whenever we wish to enable this firewall, then similar rules would be loaded.
Delete the Firewall Rules
If we wish to stop the firewall and remove each rule of the firewall, then we can use the following command:
We will be asked whether we wish to proceed with the operation.
It is helpful to reset the UFW firewall when we wish to revert each of our modifications and begin fresh.
Enable the Firewall
Ensure that an SSH port is open for any connection before going to enable the firewall.
We can run the following command for enabling the firewall:
If prompted, enter y to proceed with the operation.