Ubuntu wsl 2 suddenly can only pull from git ( both github and gitlab ) when I use a vpn ( any vpn, a commercial one like privatevpn or OpenVPN )

huangapple go评论59阅读模式
英文:

Ubuntu wsl 2 suddenly can only pull from git ( both github and gitlab ) when I use a vpn ( any vpn, a commercial one like privatevpn or OpenVPN )

问题

这真的很奇怪,我已经三天无法从任何git仓库中拉取代码。如果我使用git trace,我看到它卡住了:

> 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''''gitrepo.git''

但是ping命令可以工作:

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(与此仓库无关的另一家公司的VPN),如果我打开它们,一切都正常工作!我在西班牙,所以没有奇怪的过滤。

我的resolv.conf文件是:

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [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 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 * *

希望这些信息对你有帮助。

英文:

This is really weird, it's three days that I am not able to pull from any git repo.
If I use git trace I see that this hangs

> 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'''

but ping works

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

The weird thing is that if I am inside ANY vpn in windows, I have a commercial VPN and a company VPN ( for a different company, unrelated to this repo ) and if I turn them on, everything works!I am in Spain, so no strange filtering.

My resolv.conf is

# 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

and the ipconfig for the wsl is

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

any idea of what is happening? I tried to reset everything, uninstall everything, upgrade all packages, nothing changed

EDIT I also ran

❯ 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 * *

答案1

得分: 0

问题出在SSH上。

通过将以下内容添加到我的~/.ssh/config文件的顶部,我解决了每次Git和SSH操作的问题:

Host *
  IPQoS=none

感谢https://serverfault.com/questions/1101269/cant-connect-ssh-via-wireless-interface-but-t-works-using-eth0。

英文:

So the issue was with ssh.

By adding this into the top of my ~/.ssh/config file I got if fixed for every git and ssh operations:

Host *
  IPQoS=none

Credit to https://serverfault.com/questions/1101269/cant-connect-ssh-via-wireless-interface-but-t-works-using-eth0

huangapple
  • 本文由 发表于 2023年5月25日 18:14:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76331180.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定