CentOS6关闭防火墙

  1. # service iptables stop //临时关闭
  2. # chkconfig iptables off //禁止开机启动

CentOS7关闭防火墙

# systemctl stop firewalld       //临时关闭
# systemctl disable firewalld    //禁止开机启动

安装了iptables-service

# yum install -y iptables-services
# service iptables stop        //关闭防火墙
# service iptables status      //检查防火墙状态

系统没有安装则

# yum install firewalld //安装firewalld 防火墙

开启服务

# systemctl start firewalld.service

关闭防火墙

# systemctl stop firewalld.service

开机自动启动

# systemctl enable firewalld.service

关闭开机制动启动

# systemctl disable firewalld.service

查看状态

# systemctl status firewalld