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?
3
Answers
Follow the below steps for the default installation of
firewalld
service in centos 7.First:
firewalld
is pre-installed in centos 7. Iffirewalld
is not installed, install it. To verify and install, issue the below commands.Second:
firewalld
mostly runs as a service. Check the service exists on the host.Third: Verify firewalld service is running and enabled.
First install and start firewalld service
Then start adding your rules with firewall-cmd command. Use –permanent flag to keep changes after system reboot.
You may have to open ssh service if using remote SSH access.
Then finally update firewalld with the new configuration
first check status of
firewalld
status by below command :if you get output
Active: active
so run the following command :but if you get output
Active: inactive (dead)
orLoaded: masked (/dev/null; bad)
follow the below commands :the output should indicate that the
symlink has been removed
.then run the below command :
after enabling the firewall, start the
firewalld
service:when the system executes the command, there is no output. Therefore, it is wise to verify whether the firewall has been activated successfully.
check firewall status with:
if you see the
Active: active (running)
message you can now do what you wanted to do.