Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network works only after more than 40s since upgrade from Windows 10 version 21H1 to 21H2 #176

Open
philippe-granet opened this issue Dec 28, 2022 · 10 comments

Comments

@philippe-granet
Copy link

philippe-granet commented Dec 28, 2022

Since upgrade from Windows 10 version 21H1 to 21H2, it takes about 40s in order network works correctly with wsl-vpnkit.
Before Windows upgrade, it takes only a few seconds.

I launch this command: wsl.exe -d wsl-vpnkit --cd /app /usr/sbin/wsl-vpnkit

[2022-12-28 17:29:18] wsl-vpnkit
[2022-12-28 17:29:18] up iptables...
ip: RTNETLINK answers: File exists
[2022-12-28 17:29:18] cleanup done
[2022-12-28 17:29:18] WSL 2 ip route...
[2022-12-28 17:29:18] WSL 2 ip route
[2022-12-28 17:29:18] exists at /distro/wsl-vpnkit/wsl-gvproxy.exe
[2022-12-28 17:29:18] gvproxy at /distro/wsl-vpnkit/wsl-gvproxy.exe...
[2022-12-28 17:29:18] gvproxy
[2022-12-28 17:29:18] for dhcp...
time="2022-12-28T16:29:18Z" level=info msg="waiting for packets..."
udhcpc: started, v1.35.0
udhcpc: broadcasting discover
time="2022-12-28T17:29:20+01:00" level=info msg="new connection from remote to 16536"
udhcpc: broadcasting select for 192.168.67.3, server 192.168.67.1
udhcpc: lease of 192.168.67.3 obtained from 192.168.67.1, lease time 3600
[2022-12-28 17:29:20] via 192.168.67.1 dev eth1 metric 247 dhcp completed
[2022-12-28 17:29:20] WSL 2 ip route...
[2022-12-28 17:29:20] WSL 2 ip route
[2022-12-28 17:29:20] rules to iptables...
[2022-12-28 17:29:20] done
[2022-12-28 17:29:20] ✔️ ping success to IPv4 WSL 2 gateway / Windows host (172.31.96.1)
[2022-12-28 17:29:20] ✔️ ping success to IPv4 Windows host (192.168.67.2)
[2022-12-28 17:29:20] ✔️ ping success to IPv4 gateway (192.168.67.1)
[2022-12-28 17:29:20] ✔️ nslookup success for internal.corporate.server A using 192.168.67.1
[2022-12-28 17:29:20] ✔️ nslookup success for internal.corporate.server A using 192.168.67.1
[2022-12-28 17:29:20] ✔️ nslookup success for internal.corporate.server A using 172.31.96.1
[2022-12-28 17:29:25] ❌ nslookup fail for internal.corporate.server A using 1.1.1.1
[2022-12-28 17:29:25] ✔️ ping success to IPv4 external host (internal.corporate.server)
[2022-12-28 17:29:25] ✔️ nslookup success for internal.corporate.server AAAA using 192.168.67.1
[2022-12-28 17:29:25] ✔️ nslookup success for internal.corporate.server AAAA using 192.168.67.1
[2022-12-28 17:29:25] ✔️ nslookup success for internal.corporate.server AAAA using 172.31.96.1
ping: bad address 'internal.corporate.server'
[2022-12-28 17:29:30] ❌ nslookup fail for internal.corporate.server AAAA using 1.1.1.1
[2022-12-28 17:29:30] ➖ ping fail to IPv6 external host (internal.corporate.server)
wget: can't connect to remote host (x.x.x.x): Connection refused
[2022-12-28 17:29:51] ❌ wget fail for https://internal.corporate.server

And in parallel this one: date && curl --insecure --fail --connect-timeout 5 --max-time 5 --retry 50 --retry-connrefused --retry-delay 5 --include https://internal.corporate.server/artifactory/api/system/ping && date

mer. 28 déc. 2022 17:29:19 CET
curl: (6) Could not resolve host: internal.corporate.server
Warning: Problem : timeout. Will retry in 5 seconds. 50 retries left.
curl: (6) Could not resolve host: internal.corporate.server
Warning: Problem : timeout. Will retry in 5 seconds. 49 retries left.
curl: (6) Could not resolve host: internal.corporate.server
Warning: Problem : timeout. Will retry in 5 seconds. 48 retries left.
curl: (6) Could not resolve host: internal.corporate.server
Warning: Problem : timeout. Will retry in 5 seconds. 47 retries left.
curl: (6) Could not resolve host: internal.corporate.server
Warning: Problem : timeout. Will retry in 5 seconds. 46 retries left.
curl: (6) Could not resolve host: internal.corporate.server
Warning: Problem : timeout. Will retry in 5 seconds. 45 retries left.
HTTP/1.1 200 OK
Date: Wed, 28 Dec 2022 16:30:01 GMT
Server: Apache
Content-Type: text/plain

Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked

OK
mer. 28 déc. 2022 17:30:01 CET

It takes 42s ( mer. 28 déc. 2022 17:29:19 => mer. 28 déc. 2022 17:30:01 ) before we can reach our server.
Have you got an idea about this delay?

@sakai135
Copy link
Owner

sakai135 commented Jan 4, 2023

I'm not sure. If you do nslookup or dig instead of curl, does the IP for internal.corporate.server change around that 40s mark?

@josesa-xx
Copy link
Contributor

josesa-xx commented Jan 7, 2023

I also have windows Version 21H2 (OS Build 19044.2364)

Here is a more generic test to see how long it takes to get DNS to work:

wsl.exe -d wsl-vpnkit --cd /app service wsl-vpnkit stop
wsl.exe -d wsl-vpnkit --cd /app service wsl-vpnkit status
wsl.exe -d wsl-vpnkit --cd /app service wsl-vpnkit start
wsl.exe -d wsl-vpnkit --cd /app service wsl-vpnkit status
time while ! nslookup -timeout=1 example.com; do sleep 0.1; done

In my case it took approximately 3 seconds, here is the output:

Service wsl-vpnkit is not running
Service wsl-vpnkit is running
;; connection timed out; no servers could be reached


Server:         172.10.123.4
Address:        172.10.123.4#53

Non-authoritative answer:
Name:   example.com
Address: 93.184.216.34


real    0m3.116s
user    0m0.017s
sys     0m0.005s

It depends on your system and how fast it can launch the processes and setup the tunnel with gvproxy on windows side.

@jaycenet
Copy link

Hello, we have the same problem since upgrade to 21H2

@josesa-xx
Copy link
Contributor

Can you send the output of the commands I've given in #176 (comment) ?

@philippe-granet
Copy link
Author

@josesa-xx

Service wsl-vpnkit is not running
Service wsl-vpnkit is running
;; connection timed out; no servers could be reached


;; connection timed out; no servers could be reached


;; connection timed out; no servers could be reached


;; connection timed out; no servers could be reached


;; connection timed out; no servers could be reached


;; connection timed out; no servers could be reached


Server:         130.98.194.189
Address:        130.98.194.189#53

Non-authoritative answer:
Name:   example.com
Address: 93.184.216.34
Name:   example.com
Address: 2606:2800:220:1:248:1893:25c8:1946


real    0m36,871s
user    0m0,094s
sys     0m0,073s

@ThePhoenix53
Copy link

Is there an update on this issue? I have the same problem now as well.

@sakai135
Copy link
Owner

sakai135 commented Mar 27, 2023

@ThePhoenix53 Is your issue also:

  • ping and nslookup also succeeds but the wget at the end fails
  • wget/curl succeeds after a while

Did your problem also start with an upgrade from Windows 10 21H1 to 21H2? What is your wsl.exe --version?

@philippe-granet
Copy link
Author

I upgrade from 0.3.8 to 0.4.1.
Before upgrade: curl succeeds after about 40s
After upgrade: curl succeeds after about 75s

@sakai135
Copy link
Owner

@philippe-granet Can you try running it in the foreground like this and see if any step is taking a long time?

wsl.exe -d wsl-vpnkit --cd /app DEBUG=1 wsl-vpnkit 2>&1 | ts '[%Y-%m-%d %H:%M:%S]'

@philippe-granet
Copy link
Author

@sakai135 I have updated to latest WSL and kernel version, the problem is still here.
Then I try to execute wsl-gvproxy.exe in Windows (and not from WSL):
sudo VMEXEC_PATH=$(pwd)/wsl-vm GVPROXY_PATH=/mnt/c/wsl-gvproxy.exe ./wsl-vpnkit
=> all works instantly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants