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

WSL2 distro can access Internet but not local subnet or gateway #12363

Open
1 of 2 tasks
aflyhorse opened this issue Dec 10, 2024 · 1 comment
Open
1 of 2 tasks

WSL2 distro can access Internet but not local subnet or gateway #12363

aflyhorse opened this issue Dec 10, 2024 · 1 comment
Labels

Comments

@aflyhorse
Copy link

Windows Version

Microsoft Windows [Version 10.0.26100.2314]

WSL Version

2.3.26.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.167.4-1

Distro Version

Debian 12.8 / Ubuntu 24.04.1

Other Software

No response

Repro Steps

  1. .wslconfig:
[wsl2]
networkingMode=mirrored

[experimental]
autoMemoryReclaim=gradual
bestEffortDnsParsing=true
hostAddressLoopback=true
  1. Verify that host can connect to Internet, the Gateway and another host in the same subnet
C:\Users\aflyh>ipconfig
Ethernet adapter Ethernet:
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::abe7:8588:4ec5:4592%13
   IPv4 Address. . . . . . . . . . . : 172.16.12.149
   Subnet Mask . . . . . . . . . . . : 255.255.254.0
   IPv4 Address. . . . . . . . . . . : 192.168.0.101
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 172.16.12.1

C:\Users\aflyh>tracert -d 223.5.5.5
Tracing route to 223.5.5.5 over a maximum of 30 hops
  1     3 ms     5 ms     3 ms  172.16.12.1
  2     *        *        *     Request timed out.
  3     3 ms     1 ms     1 ms  101.95.152.145
  4     3 ms     3 ms     2 ms  101.95.89.65
  5     4 ms     *        *     101.95.89.66
  6     *        9 ms     *     101.95.206.10
  7     6 ms     *        5 ms  101.95.208.34
  8     4 ms     4 ms     3 ms  180.163.38.86
...

C:\Users\aflyh>ping 172.16.12.1
Pinging 172.16.12.1 with 32 bytes of data:
Reply from 172.16.12.1: bytes=32 time<1ms TTL=254
Reply from 172.16.12.1: bytes=32 time=1ms TTL=254

C:\Users\aflyh>ping 172.16.12.72
Pinging 172.16.12.72 with 32 bytes of data:
Reply from 172.16.12.72: bytes=32 time<1ms TTL=64
Reply from 172.16.12.72: bytes=32 time<1ms TTL=64
  1. Verify that WSL distro can connect to Internet via the same gateway
❯ ip a
5: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether c8:d9:d2:93:a4:7a brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.101/24 brd 192.168.0.255 scope global noprefixroute eth2
       valid_lft forever preferred_lft forever
    inet 172.16.12.149/23 brd 172.16.13.255 scope global noprefixroute eth2
       valid_lft forever preferred_lft forever
    inet6 fe80::abe7:8588:4ec5:4592/64 scope link nodad noprefixroute
       valid_lft forever preferred_lft forever

❯ traceroute -n 223.5.5.5
traceroute to 223.5.5.5 (223.5.5.5), 30 hops max, 60 byte packets
 1  172.16.12.1  3.981 ms  3.378 ms  3.272 ms
 2  * * *
 3  101.95.152.145  10.305 ms  3.403 ms  3.299 ms
 4  101.95.89.81  3.316 ms 101.95.89.93  3.271 ms 101.95.89.69  3.899 ms
 5  101.95.89.82  2.792 ms * *
 6  101.95.206.10  6.262 ms 101.95.206.22  5.120 ms 101.95.206.10  5.246 ms
 7  101.95.209.226  11.064 ms 101.95.208.42  4.955 ms 101.95.209.126  6.466 ms
 8  180.163.38.90  4.550 ms 180.163.38.86  4.456 ms 114.80.58.82  6.011 ms
...

❯ curl -vI http://www.microsoft.com
*   Trying 123.103.1.52:80...
* Connected to www.microsoft.com (123.103.1.52) port 80 (#0)
> HEAD / HTTP/1.1
> Host: www.microsoft.com
> User-Agent: curl/7.88.1
> Accept: */*
>
< HTTP/1.1 200 OK
HTTP/1.1 200 OK

Expected Behavior

WSL distro can also connect (ping) to the default gateway and other host in the same subnet.

Actual Behavior

❯ ping 172.16.12.1 -c 2
PING 172.16.12.1 (172.16.12.1) 56(84) bytes of data.

--- 172.16.12.1 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1156ms


❯ ping 172.16.12.72 -c 2
PING 172.16.12.72 (172.16.12.72) 56(84) bytes of data.

--- 172.16.12.72 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1081ms

Diagnostic Logs

Note that in the logs I have to turn on proxy for Windows since it is not possible to access GitHub directly in mainland China. It behaves the same without proxy and wsl --shutdown.

WslNetworkingLogs-2024-12-10_16-40-03.zip
WslLogs-2024-12-10_16-43-22.zip

Copy link

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Diagnostic information
Multiple log files found, using: https://github.com/user-attachments/files/18075808/WslNetworkingLogs-2024-12-10_16-40-03.zip
.wslconfig found
Detected appx version: 2.3.26.0
optional-components.txt not found

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

No branches or pull requests

2 participants