Firewall Configuration
CentOS 7 uses firewall as a firewall by default, and this is iptables firewall instead.
Firewall Action:
# service FIREWALLD status; #查看防火墙状态
(disabled indicates that the start enable enabled is disabled and inactive indicates that the firewall shutdown status activated (running) is indicated as open)
# service FIREWALLD start; or #systemctl start firewalld.service; #开启防火墙
# service FIREWALLD stop; or #systemctl stop Firewalld.service; #关闭防火墙
# service FIREWALLD Restart; or #systemctl restart Firewalld.service; #重启防火墙
# systemctl Disable firewalld.service# prevent firewall from starting
# Systemctl Enable firewalld# set firewall boot
#yum Remove firewalld# Uninstall firewall
Install iptables Firewalls and operations:
Install iptables firewall #yum install iptables-services#
#vi/etc/sysconfig/iptables# Edit firewall configuration file, open 3306 Port add configuration:-A input-p tcp-m State--state new-m TCP--dport 3306-j ACCEPT
#systemctl Restart Iptables.service #最后重启防火墙使配置生效
#systemctl Enable Iptables.service #设置防火墙开机启动