前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >10.20 firewalld的9个zone

10.20 firewalld的9个zone

作者头像
运维小白
发布2018-02-06 15:05:56
6640
发布2018-02-06 15:05:56
举报
文章被收录于专栏:运维小白运维小白

Linux防火墙-firewalld

  • 打开firewalld
  • systemctl disable iptables
  • systemctl stop iptables
  • systemctl enable firewalld
  • systemctl start firewalld
  • firewalld默认有9个zone
  • 默认zone为public
  • firewall-cmd --get-zones //查看所有zone
  • firewall-cmd --get-default-zone//查看默认zone

firewalld防火墙机制

  • 因为之前禁掉了firewalld,打开了iptables,所以现在需要 打开firewalld,禁掉iptables
打开firewalld

[root@hf-01 ~]# systemctl disable iptables
[root@hf-01 ~]# systemctl stop iptables
[root@hf-01 ~]# systemctl enable firewalld
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/basic.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
[root@hf-01 ~]# systemctl start firewalld
[root@hf-01 ~]# 

这时用iptables -nvL和iptables -t nat -nvL查看规则,会看到增加了很多的链
  • firewalld默认有9个zone,zone是firewalld的一个单位,默认使用public zone——>每个zone就好比一个规则集
    • 规则集就是zone里面自带一些规则,比如:这个zone放行了80端口,放行了22端口,关闭了某某端口,这就是一个规则集

firewalld中查看所有zone

  • firewall-cmd --get-zones //查看所有zone
[root@hf-01 ~]# firewall-cmd --get-zones    //查看所有zone
block dmz drop external home internal public trusted work
[root@hf-01 ~]# 

firewalld中查询默认的zone

  • firewall-cmd --get-default-zone //查看默认zone
[root@hf-01 ~]# firewall-cmd --get-default-zone    //查看默认zone
public
[root@hf-01 ~]# 

firewalld中9个zone的区别

输入图片说明
输入图片说明
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Linux防火墙-firewalld
    • firewalld防火墙机制
      • firewalld中查看所有zone
        • firewalld中查询默认的zone
          • firewalld中9个zone的区别
          领券
          问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档