Firewalld is not running

Amin Baghiyat picture Amin Baghiyat · Jul 25, 2020 · Viewed 19k times · Source

When I try to add a port to FirewallsD, I get the following exception:

centos 7 answer FirewallD is not running

When I try to reload with

sudo firewall-cmd --reload

centos 7 answers FirewallD is not running when I try to start with

sudo firewall-cmd --start

centos 7 answers FirewallD is not running

What can I do?

Answer

Abhishek picture Abhishek · Jul 25, 2020

Follow the below steps for the default installation of firewalld service in centos 7.

First: firewalld is pre-installed in centos 7. If firewalld is not installed, install it. To verify and install, issue the below commands.

rpm -qa firewalld
# expected output: firewalld-0.6.3-2.el7_7.2.noarch

# if not installed, install it
yum install firewalld

Second: firewalld mostly runs as a service. Check the service exists on the host.

ll /usr/lib/systemd/system | grep firewalld
# expected output: -rw-r--r-. 1 root root 674 Jan 30 2018 firewalld.service
# OR
ll /etc/systemd/system | grep firewalld

Third: Verify firewalld service is running and enabled.

If the service is running and it's not enabled, every restart will bring it down. Use the below command.

# check the status of the service (running and enabled)
systemctl status firewalld

# if the service is not running, start it
systemctl start firewalld

# if the service has exited, restart it(check for error if any)
systemctl restart firewalld

# if the service is not enabled, enable it
systemctl enable firewalld