zoukankan      html  css  js  c++  java
  • Linux系统:CentOS防火墙的各种命令使用

    一、命令整理

      1、安装防火墙

    yum install firewalld firewalld-config

      2、开启防火墙(启动防火墙服务):

    systemctl start firewalld.service

      3、禁用防火墙(终止防火墙服务):

    systemctl stop firewalld

      4、重启防火墙服务:

    service firewalld restart

      5、重载防火墙配置(刷新规则):

    firewall-cmd --reload

      在修改规则后,重新加载配置,使修改生效(在开放或关闭端口后常用)。

      6、查看端口列表:

    firewall-cmd --permanent --list-port

      7、开启端口:

    firewall-cmd --zone=public--add-port=xxxx/tcp --permanent

      命令中的xxxx为要开放的端口号。

      8、批量开启区间端口:

    firewall-cmd --zone=public--add-port=xxxx-yyyy/udp --permanent

      命令中的xxxxyyyy分别为要批量开启的端口区间的最小值和最大值

      9、关闭端口:

    firewall-cmd --zone=public--remove-port=xxxx/tcp --permanent

      命令中的xxxx为要关闭的端口号。

      10、查看防火墙的状态:

    systemctl status firewalld

      或者

    firewall-cmd --state

      11、设置开机自启:

    systemctl enable firewalld

      12、禁用开机自启:

    sytemctl disable firewalld

      

  • 相关阅读:
    django 使用form组件提交数据之form表单提交
    django from验证组件
    django中间件
    gin中http重复解析body数据失败
    go 常用工具链
    git 提交规范
    go简单实现heap
    Go优雅实现选传参数
    [已解决]protoc-gen-go: unable to determine Go import path for "xxx.proto"
    Go编译工具命令
  • 原文地址:https://www.cnblogs.com/guobin-/p/13895707.html
Copyright © 2011-2022 走看看