zoukankan      html  css  js  c++  java
  • 查看Linux防火墙状态



    环境:VMware、CentOS8

    从centos7开始使用systemctl.firewalld来管理服务和程序,包括了service和chkconfig。

    防火墙状态:systemctl status firewalld.service

    Active: inactive (dead)/active(running)

    关闭firewall:systemctl stop firewalld.service

    重启:systemctl restart firewalld.service

    启动:systemctl start firewalld.service

    禁止firewall开机启动:systemctl disable firewalld.service

    设置开机启用:systemctl enable firewalld.service

    查看服务是否开机启动:systemctl is-enabled firewalld.service;echo

    查看已启动的服务列表:systemctl list-unit-files|grep enabled

    查看已经开放的端口:firewall-cmd --list-ports

    开启端口:firewall-cmd --zone=public --add-port=80/tcp --permanent

    命令含义:

    –zone #作用域

    –add-port=80/tcp #添加端口,格式为:端口/通讯协议

    –permanent #永久生效,没有此参数重启后失效

  • 相关阅读:
    第一次热身赛和正式比赛感想
    简明解释算法中的大O符号
    poj 3045
    poj 3104
    poj 3273
    poj 3258
    poj 2456
    二分法小结
    Poj 2718 Smallest Difference
    GCJ——Crazy Rows (2009 Round 2 A)
  • 原文地址:https://www.cnblogs.com/lcword/p/14365830.html
Copyright © 2011-2022 走看看