zoukankan      html  css  js  c++  java
  • CentOS-7防火墙配置信息(firewalld)

    firewalld官网:https://firewalld.org/

    firewalld命令手册:https://firewalld.org/documentation/man-pages/firewalld.service.html

    以下是firewalld常用命令

    任务 centos-6 centos-7
    使某服务自动启动 chkconfig --level   3 httpd on systemctl enable httpd.service
    使某服务不自动启动 chkconfig --level   3 httpd off systemctl disable   httpd.service
    检查服务状态 service httpd   status systemctl   status httpd.service
    显示所有已启动的服务 chkconfig --list systemctl   list-units --type=service
    启动某服务 service httpd   start systemctl start   httpd.service
    停止某服务 service httpd   stop systemctl stop   httpd.service
    重启某服务 service httpd   restart systemctl restart   httpd.service
     

    firewalld基本命令使用

    启动 systemctl start firewalld.service
    查看状态 systemctl status firewalld.service
    开机自启 systemctl enable firewalld.service
    关闭开机自启 systemctl disable firewalld.service
    停止运行 systemctl stop firewalld.service

    firewall-cmd基本使用

    查看版本 firewall-cmd --version
    查看帮助 firewall-cmd --help
    查看所有打开的端口 firewall-cmd --zone=public --list-ports
    刷新防火墙规则  firewall-cmd --reload
    查看区域信息 firewall-cmd --get-active-zones
    查看指定接口所属区域 firewall-cmd --get-zone-of-interface=eth0
    拒绝所有包 firewall-cmd --panic-on
    取消拒绝状态 firewall-cmd --panic-off
    查看是否拒绝 firewall-cmd --query-panic
    开启一个端口

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

    (--permanent永久生效,没有此参数重启后失效)

    关闭一个端口 firewall-cmd --zone= public --remove-port=8080/tcp --permanent

     

  • 相关阅读:
    PHP 小方法之 算生日
    PHP 小方法之 随机生成几位字符串
    PHP 小方法之 过滤参数
    PHP 小方法之 计算两个时间戳之间相差的日时分秒
    PHP 小方法之 仿百度蜘蛛采集
    PHP 小方法之 显示 今天 昨天 上周 上月 近三月 的时间
    PHP保留两位小数的几种方法
    mysql 常用命令(一)
    PHP数据库页面增删查
    PHP数据库登陆注册简单做法
  • 原文地址:https://www.cnblogs.com/51wansheng/p/9195269.html
Copyright © 2011-2022 走看看