V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
DeanThompson
V2EX  ›  Linux

请教 CentOS 7 的 Firewalld 配置

  •  
  •   DeanThompson ·
    DeanThompson · May 10, 2018 · 2855 views
    This topic created in 2911 days ago, the information mentioned may be changed or developed.

    有些服务绑定到 0.0.0.0,所以直接暴露到公网了。现在想用 firewalld 把这些公网端口保护起来。

    我想使用 “默认开放所有端口,选择性保护指定端口” 的策略,所以尝试用了 trusted zone,但是发现不知道怎么关闭来自公网端口的请求。

    我自己能想到方案

    • 用 public zone,然后 --add-port 来开放端口;因为机器上还有其他服务,所以这种方式需要把所有要开放的端口都配置一遍。

    • 应该可以用 iptables 实现,但是使用起来没有 firewalld 方便;优先使用 firewalld

    请教大家,有什么好的解决方案呢?

    1 replies    2018-05-11 22:38:47 +08:00
    plko345
        1
    plko345  
       May 11, 2018
    可以用富规则实现,但对 firewalld 也不太熟悉,正准备花些时间学习下,感觉还是挺不错的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4283 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 04:06 · PVG 12:06 · LAX 21:06 · JFK 00:06
    ♥ Do have faith in what you're doing.