V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
awesomePower
V2EX  ›  程序员

有没有 iptables 的博客或者教程

  •  
  •   awesomePower · 1 天前 · 1614 次点击

    如题,谢谢各位

    16 条回复    2024-10-26 09:21:31 +08:00
    pomelo11
        1
    pomelo11  
       1 天前
    蹲一下
    zhoudaiyu
        2
    zhoudaiyu  
       1 天前   ❤️ 2
    ho121
        3
    ho121  
       1 天前
    GoNewEra
        4
    GoNewEra  
       1 天前   ❤️ 1
    用 nftables 吧
    mylovesaber
        5
    mylovesaber  
       1 天前   ❤️ 3
    建议楼主不是极端自定义需求且极端守旧的话直接抛弃 iptables 吧,linux 下 iptables 是过时的东西,它的替代品是 nftables ,从 centos8 开始就正式弃用 iptables 了( iptables 相关命令是指向 nftables 的软链接)。

    iptables 和 nftables 都可以简单理解为是后端程序,而前端操作这俩的工具除了他俩自带的工具外,还有一个 firewall-cmd ,这个东西在 centos7 时代作为默认启用功能且有自己的 systemd 服务,centos7 开始就正式不启用 iptables 的服务了,firewall-cmd 可以覆盖绝大部分常规场景。也是红帽主推的功能。

    如果 linux 系统是 sm 专用版的话,一般防火墙在融合二中配置,你直接改 iptables 是完全不生效的,通用系统的话,iptables 也没有存在的必要性。
    catamaran
        6
    catamaran  
       1 天前
    @zhoudaiyu 看个开头,感觉不错,收藏了。虽然现在 linux 大多不用 iptables 了,但是我们封装系统还是用这个当防火墙,因为有一些配套的脚本都是基于 iptables 命令的。
    awesomePower
        7
    awesomePower  
    OP
       1 天前
    @GoNewEra
    @mylovesaber 谢谢建议,我去了解下 nftables 和 firewall-cmd
    awesomePower
        8
    awesomePower  
    OP
       1 天前
    @zhoudaiyu 谢谢分享
    tomemi
        9
    tomemi  
       1 天前
    netfilter 可以做很多事情的
    guanzhangzhang
        10
    guanzhangzhang  
       1 天前   ❤️ 1
    朱双印的 iptables ,其他一些基础网络知识的话可以看我 gitbook https://github.com/zhangguanzhang/simple-container-network-book/blob/master/eBook/directory.md
    donaldturinglee
        11
    donaldturinglee  
       1 天前
    很多系统都逐渐迁移到 nftables 了,直接学 ntfables ,比 iptables 更容易理解。
    caola
        12
    caola  
       1 天前
    用 nftables 吧,我感觉写 nftables 的配置比 iptables 容易很多
    care
        13
    care  
       1 天前
    @mylovesaber 大佬,请问下 nftables 有没有什么办法兼容 docker ?
    billytom
        14
    billytom  
       1 天前
    现在都潮流 nftables 了,最好的老师是 chatgpt
    jinliming2
        15
    jinliming2  
       1 天前 via iPhone
    nftables ,官方文档看完就差不多了,都是示例
    infinet
        16
    infinet  
       22 小时 1 分钟前 via Android   ❤️ 1
    Netfilter 网站上有教程,有个图介绍 packet 在内核里的流程对理解 iptables 很有帮助。
    现在都推 nftables ,但个人认为它远不如 iptables 直观,有人说它的目标之一是方便机器处理。
    iptables 支持第三方的内核模块,比如 xtables-addons ,我找不到让 nftables 和这些内核模块交互的文档,多半不支持。因为这个问题,日常使用 nftables 能干的 iptables 也能干,而 iptables 能干的 nftables 替代不了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1052 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 23:23 · PVG 07:23 · LAX 16:23 · JFK 19:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.