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

72 天前
 jlz52z

当我执行指令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

691 次点击
所在节点    问与答
1 条回复
totoro625
72 天前
不用 fakeip 试试

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1022307

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX