zoukankan      html  css  js  c++  java
  • firewall-cmd 笔记

    检查firewall是否运行

    # systemctl status firewalld
    firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled)
       Active: active (running) since Thu 2015-01-22 20:51:48 EST; 2h 15min ago
     Main PID: 564 (firewalld)
       CGroup: /system.slice/firewalld.service
               └─564 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid
    
    Jan 22 20:51:48 localhost.localdomain systemd[1]: Started firewalld - dynamic...
    Hint: Some lines were ellipsized, use -l to show in full.

    or

    # firewall-cmd --state
    running

    查看当前配置

    # firewall-cmd --get-default-zone
    internal
    # firewall-cmd --get-active-zones
    internal
      interfaces: enp0s3

    这里enp0s3是网卡的配置

     列出可用的zone

    # firewall-cmd --get-zones
    block dmz drop external home internal public trusted work

    修改默认的zone, 这种修改只是暂时(tempoary)的,重启之后会失效

    # firewall-cmd --set-default-zone=home
    success

    获得public zone的细节

    # firewall-cmd --zone=public --list-all
    public
      interfaces:
      sources:
      services: dhcpv6-client ssh
      ports:
      masquerade: no
      forward-ports:
      icmp-blocks:
      rich rules:

    注意:--list-all只显示永久(permanent, 重启后不会丢失)的配置

    Service的管理

    http服务permanently加入internal zone

    # firewall-cmd --permanent --zone=internal --add-service=http
    success
    # firewall-cmd --reload

     note: 使用 -remove-service=http 来禁止http service
     note: 必须使用 firewall-cmd --reload 命令来激活先前的改变

  • 相关阅读:
    谁是你随时可以说话的人
    我们在帝都这么拼,为的是什么?
    CVE-2016-4758: UXSS in Safari's showModalDialog
    JSON-SCHEMA
    JS城市data
    linux(centos )mongodb install
    python pip install
    基于chrome内核的UXSS
    Trying to hack Redis via HTTP requests
    Apache Solr 访问权限控制
  • 原文地址:https://www.cnblogs.com/jHenry/p/4243846.html
Copyright © 2011-2022 走看看