Centos7 turn off firewall

CentOS 7.0 uses firewall as the firewall by default, and iptables must be reset

1. Turn off the firewall directly

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #Prohibit firewall from starting

2. Set iptables service

yum -y install iptables-services

If you want to modify the firewall configuration, such as adding firewall port 3306

vi /etc/sysconfig/iptables 

add rules

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

After saving and exiting

systemctl restart iptables.service #Restart the firewall to make the configuration take effect

systemctl enable iptables.service #Set the firewall to start at boot

Finally, restart the system for the settings to take effect.

 

https://www.cnblogs.com/silent2012/archive/2015/07/28/4682770.html

CentOS 7.0 uses firewall as the firewall by default, and iptables must be reset

1. Turn off the firewall directly

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #Prohibit firewall from starting

2. Set iptables service

yum -y install iptables-services

If you want to modify the firewall configuration, such as adding firewall port 3306

vi /etc/sysconfig/iptables 

add rules

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

After saving and exiting

systemctl restart iptables.service #Restart the firewall to make the configuration take effect

systemctl enable iptables.service #Set the firewall to start at boot

Finally, restart the system for the settings to take effect.

 

https://www.cnblogs.com/silent2012/archive/2015/07/28/4682770.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324774248&siteId=291194637