CentOS 7 默认使用的是firewall作为防火墙
关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
systemctl restart iptables.service #最后重启防火墙使配置生效
systemctl enable iptables.service #设置防火墙开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)