CentOS 7防火墙配置

CentOS 7防火墙配置

木子李 282 2021-11-01
  1. 查看防火墙状态
    systemctl status firewalld

  2. 开启防火墙
    systemctl start firewalld

  3. 关闭防火墙
    systemctl stop firewalld

  4. 设置防火墙开机自动启动
    systemctl enable firewalld

  5. 关闭防火墙开机自启
    systemctl disable firewalld

  6. 查看防火墙已开放的端口
    firewall-cmd --zone=public --list-ports

  7. 防火墙开放指定端口80(添加后刷新防火墙,执行指令8)
    firewall-cmd --zone=public --add-port=80/tcp --permanent

  8. 刷新防火墙
    firewall-cmd --reload