V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
HelloAmadeus
V2EX  ›  Linux

一个 iptables 的问题,求助下

  •  
  •   HelloAmadeus · 28 天前 · 1124 次点击

    发现群晖的 iptables filter 表的规则是下面这样的(删了不相关的 chain),按 archiwiki 来说,QUICKCONNECT_RELAY 最后一条 drop 后,后续的 rule 和 chain 都不会执行了,怎么一个群晖的 https 请求还能通过 QUICKCONNECT_RELAY 后继续执行 INPUT_FIREWALL ?

    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    QUICKCONNECT_RELAY  all  --  anywhere             anywhere
    INPUT_FIREWALL  all  --  anywhere             anywhere
    
    Chain INPUT_FIREWALL (1 references)
    target     prot opt source               destination
    ACCEPT     all  --  anywhere             anywhere
    ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
    RETURN     udp  --  anywhere             anywhere             udp spt:41641
    RETURN     tcp  --  anywhere             anywhere             multiport dports DSM-https,6690
    RETURN     udp  --  anywhere             anywhere             udp dpt:41641
    DROP       all  --  anywhere             anywhere
    DROP       all  --  anywhere             anywhere
    
    Chain QUICKCONNECT_RELAY (1 references)
    target     prot opt source               destination
    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:6690
    ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:DSM-https
    ACCEPT     icmp --  anywhere             anywhere
    DROP       all  --  anywhere             anywhere
    
    第 1 条附言  ·  26 天前

    iptables -nvL 看,QUICKCONNECT_RELAY 最后的 drop 规则确实有网卡限制。

    Chain QUICKCONNECT_RELAY (1 references)
     pkts bytes target     prot opt in     out     source               destination
    43542   31M ACCEPT     tcp  --  tun1000 *       0.0.0.0/0            0.0.0.0/0            tcp dpt:6690
    22127 3997K ACCEPT     tcp  --  tun1000 *       0.0.0.0/0            0.0.0.0/0            tcp dpt:5001
      424 15264 ACCEPT     icmp --  tun1000 *       0.0.0.0/0            0.0.0.0/0
     2952  487K DROP       all  --  tun1000 *       0.0.0.0/0            0.0.0.0/0
    
    4 条回复    2024-04-02 10:14:19 +08:00
    kkk9
        1
    kkk9  
       28 天前
    你查看的信息缺失了一些不好判断,用 iptables -nvL 再看一下,drop all 和 accept all 并不一定是冲突的,比如 in 、out 、网卡什么的不一样

    om2mo
        2
    om2mo  
       27 天前
    iptables -A QUICKCONNECT_RELAY -j DROP
    iptables -A QUICKCONNECT_RELAY -j RETURN
    lrh3321
        3
    lrh3321  
       27 天前
    iptables -S 看看完整的吧,QUICKCONNECT_RELAY 最后一条的 DROP 应该有条件的,要不然你已有的 TCP 连接应该都被它 Drop 了。
    kkkbbb
        4
    kkkbbb  
       27 天前
    QUICKCONNECT_RELAY 的规则前面的满足后面的就不会执行了,继续判断下一个 chain 了吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   962 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 20:10 · PVG 04:10 · LAX 13:10 · JFK 16:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.