V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
jlz52z
V2EX  ›  问与答

[求助] clash for windows 开启 tun 模式后无法执行 apt update

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

    当我执行指令sudo apt update时,终端卡在这不动

    0% [Waiting for headers] [Waiting for headers]
    

    当我关闭 tun 模式,并且打开 clash 的系统代理时,指令被顺利地执行

    同样的问题也出现在 conda 指令中,当打开 tun 模式执行指令 conda install matplotlib 时,出现如下错误

    Channels:
     - defaults
    Platform: linux-64
    Collecting package metadata (repodata.json): \ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Read timed out. (read timeout=9.15)")': /pkgs/main/noarch/repodata.json.zst
    
    Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Read timed out. (read timeout=9.15)")': /pkgs/main/linux-64/repodata.json.zst
    
    failed
    
    CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/repodata.json>
    Elapsed: -
    
    An HTTP error occurred when trying to retrieve this URL.
    HTTP errors are often intermittent, and a simple retry will get you on your way.
    
    If your current network has https://repo.anaconda.com blocked, please file
    a support request with your network engineering team.
    
    'https//repo.anaconda.com/pkgs/main/linux-64'
    
    

    同样,关闭 tun ,开启系统代理时,指令也被很好地执行。

    repo.anaconda.comarchive.ubuntu.com/ubuntu 都能被 ping 通且延迟不到 1ms ,在浏览器里面也能直接访问这两个网址

    clash 设置页面截图如下

    tun 模式配置如下

    dns:
      enable: true
      ipv6: true
      enhanced-mode: fake-ip
      nameserver:
        - 114.114.114.114
        - 223.5.5.5
        - 8.8.8.8
      fallback: []
      nameserver-policy: {}
      fake-ip-filter:
        - +.stun.*.*
        - +.stun.*.*.*
        - +.stun.*.*.*.*
        - +.stun.*.*.*.*.*
        - "*.n.n.srv.nintendo.net"
        - +.stun.playstation.net
        - xbox.*.*.microsoft.com
        - "*.*.xboxlive.com"
        - "*.msftncsi.com"
        - "*.msftconnecttest.com"
        - WORKGROUP
    tun:
      enable: true
      stack: system
      auto-route: true
      auto-detect-interface: true
      dns-hijack:
        - any:53
        - 198.18.0.2:53
    

    clash 配置文件内容如下 系统版本为 windows11 22H2

    1 条回复    2024-03-10 18:24:15 +08:00
    totoro625
        1
    totoro625  
       282 天前 via iPhone
    不用 fakeip 试试
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4856 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 09:49 · PVG 17:49 · LAX 01:49 · JFK 04:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.