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

求助, Cloudflared Tunnel 频繁超时断开连接

  •  
  •   matony · 62 天前 · 1294 次点击
    这是一个创建于 62 天前的主题,其中的信息可能已经有所发展或是发生改变。

    一直使用 Cloudflare Tunnel 作为家里服务器的访问入口,但是从春节开始,周期性出现无法访问,可用性一度为 0 ;查看日志发现是连接断开了

    WRN Serve tunnel error error="connection with edge closed" connIndex=2 event=0 ip=198.41.192.67
    INF Retrying connection in up to 1s connIndex=2 event=0 ip=198.41.192.67
    INF Unregistered tunnel connection connIndex=2 event=0 ip=198.41.192.67
    WRN Connection terminated error="connection with edge closed" connIndex=2
    

    尝试

    1. 将 quic 协议替换为 http2, 问题依旧
    2. ping region1.v2.argotunnel.com 发现大量超时
    3. 使用 clash 代理 argotunnel.com 所在的网段,198.41.192.0/24 和 198.41.200.0/24 ,依然超时
    4. 使用 https://www.itdog.cn/ping/region1.v2.argotunnel.com 持续 ping 检测,发现电信基本正常,移动、联通不少超时

    问题

    1. 如何恢复可用性,clash 没有生效是代理的问题吗
    2. 是 GFW 导致的吗,大家有遇到类似的吗
    7 条回复    2024-02-26 11:54:16 +08:00
    yaott2020
        1
    yaott2020  
       62 天前 via Android
    试试 IPv6
    matony
        2
    matony  
    OP
       62 天前
    @yaott2020 IPV6 开启之后很多网站访问特别慢
    goodman111
        3
    goodman111  
       62 天前
    @matony 你开 ipv6 不意味着访问别的网站是通过 ipv6 ,只是和 cloud flare 时间连接是 v6 的。
    应该稳定并且快一点的。
    fantastM
        4
    fantastM  
       62 天前
    春节期间遇到同样的问题,我做了下面操作之后,tunnel 状态几乎都是 healthy 了。。

    1. cloudflared 启动参数里加 --protocol http2
    2. clash 分流规则里添加 - DOMAIN-SUFFIX,argotunnel.com ,需要确保 tunnel 的连接是经过 clash 代理的

    totoro625
        5
    totoro625  
       62 天前
    检查 clash 日志是否有 argotunnel.com 的连接,实在不会就直接用 ShellClash ,或者起一个 openwrt 虚拟机,在下面挂一个 vm 跑 Cloudflared Tunnel (我用的这个方案)
    matony
        6
    matony  
    OP
       62 天前
    @fantastM @totoro625
    用的是路由器上的 shellclash, 规则里添加了 `- DOMAIN-SUFFIX,argotunnel.com,🔰 节点选择`,查看 clash 面板,使用 curl 请求 region1.v2.argotunnel.com ,确认 region1.v2.argotunnel.comupdate.argotunnel.com 走了代理,但是连接依然在断开,clash 没有发现连接一直在保持,请问是 clash 配置的不对吗;




    cloudflared 部署在 docker 容器中,启动命令 `tunnel --loglevel info --metrics 0.0.0.0:19991 --protocol http2 run --token ${TOKEN}`
    fantastM
        7
    fantastM  
       61 天前
    @matony #6 我的配置规则是自己维护的,你可以参考一下 https://github.com/fantasticmao/clash-rules/blob/main/common.yaml

    另外,我确认了一下我这边和 tunnel 的连接,已经建立两天多了。。属实稳定
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1469 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 79ms · UTC 17:03 · PVG 01:03 · LAX 10:03 · JFK 13:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.