centos换的默认防火墙firewalld
centos7默认的防火墙是firewalld,需要关闭firewalld,使用iptables
1、关闭firewall:
-
停止firewall
systemctl stop firewalld.service
-
禁止firewall开机启动
systemctl disable firewalld.service
-
查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
firewall-cmd --state
2.安装iptables-services
yum install iptables-services
3.修改防火墙配置文件
vi /etc/sysconfig/iptables
4.重新启动
systemctl restart iptables
5.添加端口
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
0 Comments