美文网首页
CentOS 7 防火墙命令

CentOS 7 防火墙命令

作者: changhr2013 | 来源:发表于2018-03-22 23:27 被阅读0次

systemctl是CentOS 7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。

  1. 启动: systemctl start firewalld.service
  2. 停止: systemctl stop firewalld.service
  3. 重启: systemctl restart firewalld.service
  4. 查看状态: systemctl status firewalld.service
  5. 开机启用: systemctl enable firewalld.service
  6. 开机禁用: systemctl disable firewalld.service
  7. 查看是否开机启动: systemctl is-enabled firewalld.service
  8. 查看已启动的服务列表: systemctl list-unit-files | grep enabled
  9. 查看启动失败的服务列表: systemctl --failed

配置firewall-cmd

  1. 查看版本: firewall-cmd --version
  2. 查看帮助: firewall-cmd --help
  3. 显示状态: firewall-cmd --state
  4. 查看所有打开的端口: firewall-cmd --zone=public --list-ports
  5. 查看区域信息: firewall-cmd --get-active-zones
  6. 查看指定接口所属区域:firewall-cmd --get-zone-of-interface=eth0
  7. 拒绝所有包: firewall-cmd --panic-on
  8. 取消拒绝状态: firewall-cmd --panic-off
  9. 查看是否拒绝: firewall-cmd --query-panic

端口操作

  1. 添加一个端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
//--permanent 永久生效,没有此参数配置将在重启后失效。
  1. 查看端口状态
firewall-cmd --zone=public --query-port=80/tcp
  1. 移除添加的端口
firewall-cmd --zone=public --remove-port=80/tcp --permanent
  1. 重载,更新防火墙规则
firewall-cmd --reload

相关文章

  • Linux防火墙配置

    Centos 7和 Centos 6开放查看端口 防火墙关闭打开 Centos 7 firewall 命令: 查看...

  • Linux命令

    CentOS7 防火墙命令 JAVA启动命令 解压命令 开机启动

  • linux服务器常用

    Centos7 打开80端口防火墙命令

  • linux防火墙设置

    CentOS7防火墙命令操作 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables...

  • Centos 7 开放查看端口

    Centos 7 开放查看端口 防火墙关闭打开 Centos 7 firewall 命令: 查看已经开放的端口: ...

  • centos7关闭防火墙

    centos7 默认防火墙是firewalld 所以查看防火墙状态命令:systemctl status ...

  • Linux基本命令介绍

    本文命令都是基于CentOS7系统 一、防火墙相关命令 临时关闭防火墙 禁止防火墙开机启动 开启防火墙 查看防火墙...

  • Centos7(Firewall)防火墙命令

    Centos7(Firewall)防火墙开启常见端口命令 Centos7默认安装了firewalld,如果没有安装...

  • Centos7 查看防火墙相关常用命令

    Centos7查看防火墙相关操作常用命令 一、防火墙的开启、关闭、禁用命令 (1)启动防火墙:systemctl ...

  • Linux开放指定端口

    以下命令只适用于centos7。开放端口命令 保存 重启防火墙

网友评论

      本文标题:CentOS 7 防火墙命令

      本文链接:https://www.haomeiwen.com/subject/bnozqftx.html