• 请不要在回答技术问题时复制粘贴 AI 生成的内容
awesomePower
V2EX  ›  程序员

有没有 iptables 的博客或者教程

  •  
  •   awesomePower · Oct 25, 2024 · 4068 views
    This topic created in 754 days ago, the information mentioned may be changed or developed.

    如题,谢谢各位

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

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

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