V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ovear
V2EX  ›  问与答

iptables ttl 过滤失效 求解

  •  
  •   ovear · Oct 24, 2016 · 2530 views
    This topic created in 3482 days ago, the information mentioned may be changed or developed.
    接上一贴
    https://www.v2ex.com/t/302993

    昨天升级了小米路由之后发现规则失效,一查询,自定义的规则已经被清空了。
    于是我重新加入相同的记录,但是奇怪的依然无效。
    iptables -I FORWARD -p tcp --sport 80 -m ttl --ttl 127 -j DROP


    然后就改变了规则,采用 u32 的方式来过滤。依然无效。
    iptables -I FORWARD -p tcp --sport 80 -m u32 --u32 "5&0xFF=0x7F" -j DROP

    但是奇怪的是,如果是非劫持的包,这时候 u32 却可以正常过滤,请问各位遇到过这种问题嘛?

    以下是路由的全部规则
    https://pastebin.ubuntu.com/23374568/
    1 replies    2016-10-24 22:45:10 +08:00
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5812 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 02:38 · PVG 10:38 · LAX 19:38 · JFK 22:38
    ♥ Do have faith in what you're doing.