Are you looking for a solution to the error “firewall-cmd: command not found centos 7”? We can help you.
Last week, one of our customers came across the above error while trying to configure the firewall rules.
Here at Bobcares, we receive requests to fix such firewall-cmd errors as a part of our Server Management Services.
Today, let’s see the cause of this error and see how our Support Engineers fix it.
Why does firewall-cmd: command not found shows up?
The command not found error shows up if the firewalld tool is not enabled on the server. Also, we’ve seen sometimes if the path doesn’t contain /usr/bin then this error pops up.
Among the above, the error mostly occurs due to the missing firewalld tool. So, we simply fix it by installing the firewalld.
Let us discuss how our Support Engineers install firewalld and resolve the error.
How we fix the error firewall-cmd: command not found?
Having a decade of experience in managing servers, our Dedicated Engineers are familiar with the firewall-cmd errors. Now, let’s discuss how our Support Engineers fix this error.
Recently, one of our customers approached us with the below error message while trying to open port 80 in the firewall rules.
firewall-cmd: command not found
Our Support Engineers started troubleshooting the error by checking the status of the firewalld by running the command
systemctl status firewalld
And here is the result.
So, we installed the firewalld by running the command:
yum install firewalld
After that, we start the firewall using the command:
systemctl start firewalld
To enable the service to auto-start at boot time we use the command:
systemctl enable firewalld
Then, we checked for its status using the command:
systemctl status firewalld
Once we saw the status is enabled, now we can run the firewall-cmd to open a port 80
firewall-cmd --zone=public --add-port=80/tcp --permanent
Lastly, we reloaded it using the command
firewall-cmd --reload
Finally, this fixed the error.
[Need any assistance in fixing the firewall-cmd errors? – We’ll help you]
Conclusion
In short, the error firewall-cmd: command not found error occurs mainly if the firewalld command is not enabled in the server. Today, we saw how our Support Engineers fix the firewall-cmd error.
0 Comments