Disable firewalld firewall in CentOS 7First, stop the firewalld service and enter the following command:
1
$ Sudo systemctl stop firewalld. service
Disable the firewalld service from automatically starting when the system starts. Enter the following command:
1
$ Sudo systemctl disable firewalld. server
If you will not use the firewalld service in the future, you can directly uninstall it and use the following command:
1
$ Sudo yum remove firewalld-y
Install iptables firewall in CentOS 7To install the iptables package, run the following command:
1
$ Sudo yum install iptables-services
Set the iptables Firewall Service to automatically start when it starts up. Enter the following command:
1
$ Sudo systemctl enable iptables
If you want to use/etc/init. d/iptables save command to save the modified firewall policy. Enter the following command to save iptables. the init script overwrites the script after iptables is installed. Enter the following command:
1
$ Sudo/usr/libexec/iptables. init/etc/init. d/iptables
In this case, you can run the/etc/init. d/iptables save command.
1
$ Sudo/etc/init. d/iptables save