===Centos6 防火墙===
#查看防火墙状态:
service iptables status
#关闭防火墙:
service iptables stop
#打开防火墙:
service iptables start
===Centos7 防火墙===
#启动:
systemctl start firewalld
#关闭:
systemctl stop firewalld
#查看状态:
systemctl status firewalld
#开机禁用 :
systemctl disable firewalld
#开机启用 :
systemctl enable firewalld
#防火墙中开启80端口 firewall-cmd --permanent --zone=public --add-port=80/tcp #重新加载防火墙配置 firewall-cmd --reload #查看是否生效 firewall-cmd --zone=public --query-port=80/tcp