Check the Firewall Status
To view the current status of the FirewallD service you can use the
firewall-cmd command:sudo firewall-cmd --stateIf the FirewallD service is running on your CentOS system the command above will print the following message:
runningDisable Firewall
You can temporarily stop the FirewallD service with the following command:
sudo systemctl stop firewalldHowever this change will be valid for the current runtime session only.
To permanently disable the firewall on your CentOS 7 system, follow the steps below:
First, stop the FirewallD service with:
sudo systemctl stop firewalldDisable the FirewallD service to start automatically on system boot:
sudo systemctl disable firewalldThe output from the command above will look something like this:
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.Mask the FirewallD service which will prevent the firewall from being started by other services:
sudo systemctl mask --now firewalldAs you can see from the output the mask command simply creates a symlink from the firewalld service to
/dev/nullCreated symlink from /etc/systemd/system/firewalld.service to /dev/null.Conclusion
In this tutorial, you learned how to stop and permanently disable the firewall on a CentOS 7 machine.
From: https://linuxize.com/post/how-to-stop-and-disable-firewalld-on-centos-7/