disable stop firewalld in centos, redhat linux

How to Disable/Stop Firewalld in CentOS, Redhat

Firewalld is a dynamic firewall manager that allows you to easily setup network zones to dynamically regulate incoming and outgoing traffic. It is the default firewall for CentOS systems. But sometimes you may need to turn of firewalld in your Linux system. In this article, we will look at how to disable/stop firewalld in CentOS, Redhat, Fedora Linux systems.


How to Disable/Stop Firewalld in CentOS, Redhat

Here are the steps to stop or turn off firewalld in CentOS, Redhat Linux. You will need to be logged in a user with sudo or root privileges.


1. Check firewalld status

Firewalld is enabled by default on every CentOS system. So open terminal and run the following command to verify its status.

sudo systemctl status firewalld

If the firewall is running then you will see the following line in output

...
Active: active (running)
...


2. Disable firewalld

There are two ways to disable or turn off firewalld in CentOS, Redhat – temporarily or permanently.


Turn off firewalld temporarily

Open terminal and run the following command to temporarily stop firewalld.

sudo systemctl stop firewalld

Now if you check the firewalld service status, you will see the following line

...
Active : inactive(stopped)
...

If firewalld is disabled successfully, you will not see any message in the output. If there is any error, only then you will see any message.

So run the following command to verify that firewalld is stopped.

sudo systemctl status firewalld

You will see the following line in the output

...
Active: inactive(dead)
...

Please note, this will only disable firewall till system reboot. When your session ends or system reboots, firewalld will start again. If you want to permanently disable firewalld please follow the steps below.


Stop firewalld permanently

To permanently disable firewalld, we need to stop the service first with the following command.

sudo systemctl stop firewalld

Now if you check the firewalld service status, it will show

...
Active : inactive(stopped)
...

Run the following command to permanently disable firewalld.

sudo systemctl disable firewalld

This will permanently disable firewalld and it will not restart on system reboot.

But there may be other services on your system that may activate firewalld. To prevent this from happening, run the following command.

sudo systemctl mask --now firewalld

This will mask your firewalld service by creating a symlink with /dev/null, and prevent it from being activated accidentally.

You will see the following output.

Output
Created symlink from /etc/systemd/system/firewalld.service to /dev/null.

To reactivate firewalld, you need to unmask it first.

sudo systemctl unmask --now firewalld

In this article, we have learnt how to disable or turn off firewalld on CentOS, Redhat Linux systems.

Firewalld is a powerful dynamic firewall manager that allows system administrators to monitor inbound and outgoing traffic using network zones and rules. It is easy to use and feature-rich but sometimes you may need to temporarily or permanently disable it to avoid conflicts with other software on your system. You can follow the above steps to turn off firewalld as per your requirement.

Also read:

How to Export PostgreSQL Table to CSV
How to Add Minutes to Datetime in Python
How to Disable Iptables in Ubuntu
How to Create Swap Space in CentOS, Redhat
How to Install RPM Package in Redhat, CentOS

Leave a Reply

Your email address will not be published. Required fields are marked *