zoukankan      html  css  js  c++  java
  • centos7防火墙命令

    CentOS7使用的是firewall防火墙,不再是原来的iptables

    1:查看firewall防火墙状态

            firewall-cmd --state

            或者

            systemctl status firewalld

    2:打开防火墙

            systemctl start firewalld

    3:关闭防火墙

            systemctl stop firewalld

    4:重启防火墙

            firewall-cmd --relaod

            或者

            systemctl reload firewalld

    5:开机自启动防火墙

            systemctl enable firewalld

    6:禁止开机启动防火墙

            systemctl disable firewalld

    6:查看已打开的端口

            firewall-cmd --list-ports

    7:打开端口  (依据本人踩坑经验实测,打开或者关闭端口后一定要重启防火墙,不然不生效)

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

            其中permanent表示永久生效,public表示作用域,8080/tcp表示端口和类型

    8:关闭端口  (依据本人踩坑经验实测,打开或者关闭端口后一定要重启防火墙,不然不生效)

            firewall-cmd --permanent --zone=public --remove-port=8080/tcp
    ————————————————
    版权声明:本文为CSDN博主「Andersen丶童话」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/xj19940904/article/details/80530781

  • 相关阅读:
    主流编程语言
    计算机语言
    IT(Information technology)
    设计模式-学习
    Java 执行顺序
    学习大纲
    Springboot注解整理 二《自定义注解》
    IntelliJ IDE 基础经验备案三
    IntelliJ IDE 基础经验备案二
    Mybatis使用经验归档
  • 原文地址:https://www.cnblogs.com/qiaoer1993/p/12101925.html
Copyright © 2011-2022 走看看