I have WSL2 installed on win 10. WSL is using ubuntu:
WSL version: 2.7.3.0
Kernel version: 6.6.114.1-1
WSLg version: 1.0.73
MSRDC version: 1.2.6676
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.19045.6456
I rarely use it (another distro is being used by docker). I wanted to run a simple bash script and tried to run curl, but saw it hangs forever. I tried pinging some ips and domains and they all work, so ping is okay and network connections "seems" to be okay. but both curl and wget are hanging forever:
~$ curl stackoverflow.com -v
>
or
~$ curl -v http://example.com
* Trying 104.20.23.154:80...
* Trying 2606:4700:10::ac42:93f3:80...
* Immediate connect fail for 2606:4700:10::ac42:93f3: Network is unreachable
* Trying 2606:4700:10::6814:179a:80...
* Immediate connect fail for 2606:4700:10::6814:179a: Network is unreachable
I tried almost everything. From checking adapters, reinstalling some, uninstalling ExpressVPN, removing Express drivers and other leftovers, numerous reboots and wsl --shutdowns, resetting windows network, netsh winsock reset, netcfg -d (I lost my ethernet connection and was able to set it up again but WSL is still acting annoyingly).
I even tried changing wsl config, but that didn't work either.
After step by step debugging with ChatGPT, it says everything is okay, but packets are getting lost somewhere.
Here's a tcpdump (ran on powershell, and did nc -vz 1.1.1.1 80 on WSL):
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes 22:08:43.176117
IP 172.25.28.166.46588 > 1.1.1.1.80: Flags [S], seq 3831296971, win 64240, options [mss 1460,sackOK,TS val 689053886 ecr 0,nop,wscale 7], length 0 22:08:44.205768
IP 172.25.28.166.46588 > 1.1.1.1.80: Flags [S], seq 3831296971, win 64240, options [mss 1460,sackOK,TS val 689054916 ecr 0,nop,wscale 7], length 0 22:08:45.229733
IP 172.25.28.166.46588 > 1.1.1.1.80: Flags [S], seq 3831296971, win 64240, options [mss 1460,sackOK,TS val 689055940 ecr 0,nop,wscale 7], length 0 22:08:46.253672
IP 172.25.28.166.46588 > 1.1.1.1.80: Flags [S], seq 3831296971, win 64240, options [mss 1460,sackOK,TS val 689056964 ecr 0,nop,wscale 7], length 0 22:08:47.277702
IP 172.25.28.166.46588 > 1.1.1.1.80: Flags [S], seq 3831296971, win 64240, options [mss 1460,sackOK,TS val 689057988 ecr 0,nop,wscale 7], length 0 22:08:48.301649
IP 172.25.28.166.46588 > 1.1.1.1.80: Flags [S], seq 3831296971, win 64240, options [mss 1460,sackOK,TS val 689059012 ecr 0,nop,wscale 7], length 0 22:08:50.317698
IP 172.25.28.166.46588 > 1.1.1.1.80: Flags [S], seq 3831296971, win 64240, options [mss 1460,sackOK,TS val 689061028 ecr 0,nop,wscale 7], length 0 22:08:54.381670
IP 172.25.28.166.46588 > 1.1.1.1.80: Flags [S], seq 3831296971, win 64240, options [mss 1460,sackOK,TS val 689065092 ecr 0,nop,wscale 7], length 0
^C
8 packets captured
8 packets received by filter
0 packets dropped by kernel
my WSl /etc/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.25.16.1
and /etc/wsl.conf doesn't exist.
I can share more debug info if needed.
Here are 3 suspicious things that I guess are causing this:
- I use v2rayN, and whenever I start it and set to system proxy, I get a notification from WSL telling me that http proxy changed and something needs to be restarted (I don't have the exact message now)
- I have openvpn and VMWare Workstation installed, so one of them might be interfering with the network
Get-NetNatreturns nothing
(Sorry if the question isn't ordered properly... I don't know how to frame this WSL issue in a correct way...)