This tutorial will help you to stop and disable Firewalld on CentOS 7 system.

FirewallD is a firewall management tool which is available on CentOS 7 servers by default. You can manage and configure network connections which traffic is allowed or disallowed to and from the system.
With the release of CentOS 7, FirewallD taken place of iptables as the default firewall management tool. For the security purpose it is recommended to keep enabled Firewalld service.
Prerequisites
Before starting with this tutorial, ensure that you are logged in non-root user account with sudo privileges.
If you have not yet set up FirewallD or having any troubles in configuring it you can check this guide How to setup a firewall with firewalld on CentOS 7.
Check FirewallD Status
You can view the current status of the Firewalld service by using the firewall-cmd
command:
sudo firewall-cmd --state
You will get output as below and if FirewallD service is running on your CentOS system then it will print running message:
Output
running
Stop FirewallD
If you want to stop firewall service temporarily, you can do it by running below command:
sudo systemctl stop firewalld
This change will be valid for the current runtime session only.
Disable FirewallD
Once you will disable the firewall it will stop permanently. To disable the firewall on your CentOS 7 system follow below steps:
First, you need to stop FirewallD service by issuing below command:
sudo systemctl stop firewalld
Now you can disable FirewallD by typing:
sudo systemctl disable firewalld
This will disable Firewalld permanently but there are chances that it can be started by other service. To prevent that firewall being started by other services you need to Mask FirewallD by run below command:
sudo systemctl mask --now firewalld
It will print message like below:
Output
Created symlink from /etc/systemd/system/firewalld.service to /dev/null.
Manage FirewallD Services
If you have disabled FirewallD services and want to start it again then following command will be helpful.
To unmask your FirewallD service on your system execute command:
sudo systemctl unmask --now firewalld
It will show output as below:
Output
Removed symlink /etc/systemd/system/firewalld.service.
You can enable FirewallD running following command:
sudo systemctl enable firewalld
Output will be as following:
Output
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
After enabling FirewallD service you have need to start it by run below command:
sudo systemctl start firewalld
Conclusion
Finally, you have learned how to stop and disable FirewallD on your CentOS 7 system.
If you have any question or suggestion you can leave comment below.
Leave a Reply