WSL: Can't communicate with the Internet when using a cellular network(WWAN).

Environment

Windows build number: 10.0.20170.1000
Your Distribution version: Ubuntu 20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce

  • Disconnect from Wi-Fi
  • Connect to cellular network (WWAN)
  • Launch WSL 2
  • Communicate something over the Internet (curl, wget, npm, …)

Expected behavior

The Linux processes should be able to communicate with the Internet without problems.

Actual behavior

Can’t communicate to the internet from WSL2 when using a cellular network (WWAN).

I’m having the problem with the Surface Pro X’s LTE communication (Wi-Fi is already disconnected).

For example, the curl command gives me the following error.

$ ping www.example.com
PING www.example.com (93.184.216.34) 56(84) bytes of data.
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=1 ttl=54 time=278 ms
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=2 ttl=54 time=135 ms
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=3 ttl=54 time=134 ms
^C
--- www.example.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2389ms
rtt min/avg/max/mdev = 133.909/182.238/277.921/67.658 ms

$ curl www.example.com
curl: (7) Failed to connect to www.example.com port 80: Connection timed out

However, DNS resolution and pinging responds normally, perhaps because it goes through the host.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 15
  • Comments: 20 (1 by maintainers)

Most upvoted comments

Add the following to your .wslconfig file if you are running Windows 11 Insider

[experimental]
networkingMode=mirrored

This will expose all network adapters to WSL.

https://learn.microsoft.com/en-us/windows/wsl/wsl-config

I’m facing a same problem on cellular. (No problems on wireless connection.) Is there any other solutions for this?

I tried the above solution and couldn’t get it to work, but the one thing that does work for me is connecting to a VPN. On my Surface Pro X I use viscosity for a vpn client because it’s a native ARM application. Certain phone carriers like sprint block VPNs for their tablet plans, but I’ve discovered Verizon’s prepaid plans do not.

When on LTE, I can connect to a vpn and I have full connectivity on WSL.

Forgot to mention in my previous post that I eventually fixed my issue with a little bit of Powershell magic. I’ll post later my steps.