在旧版本的CentOS中,是使用 iptables 命令来设置防火墙的。但是,从CentOS7开始,默认就没有安装iptables,而是改用firewall来配置防火墙。但iptalbes的一些命令仍然可以使用。 使用firewall-cmd命令添加规则
firewall-cmd --add-port=80/tcp --permanent
使用iptables命令查看规则,新增的规则是在IN_public_allow这个链中,

在旧版本的CentOS中,是使用 iptables 命令来设置防火墙的。但是,从CentOS7开始,默认就没有安装iptables,而是改用firewall来配置防火墙。但iptalbes的一些命令仍然可以使用。 使用firewall-cmd命令添加规则
firewall-cmd --add-port=80/tcp --permanent
使用iptables命令查看规则,新增的规则是在IN_public_allow这个链中,