Disable firewall in CentOS 7.0
CentOS 7.0 uses firewall as the firewall by default. You must reset it when using iptables.
1. Directly disable the Firewall
Systemctl stop firewalld. service # stop firewall
Systemctl disable firewalld. service # disable firewall startup
2. Set iptables service
Yum-y install iptables-services
If you want to modify the firewall configuration, such as adding the firewall port 3306
Vi/etc/sysconfig/iptables
Add Rules
-A input-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT
Save and exit
Systemctl restart iptables. service # restart the firewall to make the configuration take effect.
Systemctl enable iptables. service # Set firewall startup
Restart the system to make the settings take effect.
For more iptables tutorials, see the following:
Disable the default firewall in CentOS 7.0 and enable the iptables firewall.
Iptables examples
Linux Firewall iptables
Basic use of iptables backup, recovery, and firewall scripts
Detailed description of firewall iptables usage rules in Linux
Iptables firewall settings in Linux
This article permanently updates the link address: