You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu WSL2仅在VPN开启时才能拉取Git仓库问题求助

Git拉取代码异常排查求助

问题现象

  • 连续三天无法从GitHub、GitLab等Git仓库拉取代码
  • 通过Git trace排查,进程卡在以下SSH命令:

    12:08:48.904172 run-command.c:655 trace: run_command: unset GIT_PREFIX; GIT_PROTOCOL=version=2 ssh -o SendEnv=GIT_PROTOCOL git@gitlab.com 'git-upload-pack '''gitrepo.git'''

  • Ping gitlab.com正常,结果如下:
    PING gitlab.com (172.65.251.78) 56(84) bytes of data. 64 bytes from
    172.65.251.78 (172.65.251.78): icmp_seq=1 ttl=57 time=18.8 ms 64 bytes from 172.65.251.78 (172.65.251.78): icmp_seq=2 ttl=57 time=18.3 ms
    
  • 开启Windows系统中任意VPN(商用VPN或第三方企业VPN)后,拉取操作完全正常;本人位于西班牙,无特殊网络过滤

已收集的网络信息

resolv.conf配置

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /># [network]
# generateResolvConf = false
nameserver 172.17.0.1

WSL ipconfig信息

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter
   Physical Address. . . . . . . . . : 00-15-5D-DD-4A-24
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::de80:6bf6:d24f:9a71%39(Preferred)
   IPv4 Address. . . . . . . . . . . : 172.17.0.1(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :
   DHCPv6 IAID . . . . . . . . . . . : 654316893
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-28-6A-8F-DC-90-2E-16-33-0A-7D
   NetBIOS over Tcpip. . . . . . . . : Enabled

tcptraceroute结果

❯ tcptraceroute gitlab.com 22
Selected device eth0, address 172.17.8.220, port 37791 for outgoing packets
Tracing the path to gitlab.com (172.65.251.78) on TCP port 22 (ssh), 30 hops max
 1  172.17.0.1  0.189 ms  0.170 ms  0.156 ms
 2  192.168.3.1  1.300 ms  1.349 ms  1.539 ms
 3  192.168.1.1  2.249 ms  2.463 ms  2.001 ms
 4  * * *
 5  10.14.7.33  46.475 ms  24.116 ms  129.060 ms
 6  10.0.12.33  50.541 ms  19.351 ms  17.170 ms
 7  * * *
 8  * * *
 9  * * *
10  172.65.251.78 [open]  23.881 ms * *

已尝试的无效操作

  • 重置系统
  • 卸载重装相关组件
  • 升级所有软件包

恳请提供排查思路或解决方案。

内容的提问来源于stack exchange,提问作者Nicola Peluchetti

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 21:12:28