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/Ubuntu] Can't connect to internet #6450

Closed
kidapu opened this issue Jan 20, 2021 · 4 comments
Closed

[WSL2/Ubuntu] Can't connect to internet #6450

kidapu opened this issue Jan 20, 2021 · 4 comments

Comments

@kidapu
Copy link

kidapu commented Jan 20, 2021

I read the following similar issues, but I guess my problem is different from them.

The following is a list of my situations.

(1) With WSL2, I can't ping with IP address.

$ ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
( No response)

The difference from other issues is that DNS seems to be working effectively in WSL2.

$ nslookup google.com
Server:         172.26.112.1
Address:        172.26.112.1#53

Non-authoritative answer:
Name:   google.com
Address: 172.217.161.78
Name:   google.com
Address: 2404:6800:4004:80b::200e

(2) Convert to WSL1, the ping will work

$ wsl --set-version Ubuntu 1
$ wsl 
$ ping 1.1.1.1

(3) Network status

In WSL2

~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 4a:32:3c:d5:e5:f7 brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 36:98:4e:e1:0e:af brd ff:ff:ff:ff:ff:ff
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:14:06:ba brd ff:ff:ff:ff:ff:ff
    inet 172.26.118.202/20 brd 172.26.127.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe14:6ba/64 scope link
       valid_lft forever preferred_lft forever
5: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0

In Windows 10

> ipconfig

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::e496:b8b7:52c6:74b0%44
   IPv4 Address. . . . . . . . . . . : 172.26.112.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

I tried setting of @ericc, but it's not work for me. #5286 (comment)


My environment is below.

  • Windows : 10.0.19042 Build 19042
  • Installed Ubuntu and Ubutnu 18.04 . Both had the same problems.
  • I'm not using VPN.
@asampadeh
Copy link

I never successful connect to
Failed to fetch http://archive.ubuntu.com/ubuntu/dists
if using WIFI at home (no VPN).

I have edited the /etc/wsl.conf and /etc/resolv.conf to contain same nameserver as my WIFI router box

@kidapu
Copy link
Author

kidapu commented Jan 21, 2021

@asampadeh
In my case, DNS is working.
But the network is not connected.
I think editing /etc/wsl.conf and /etc/resolv.conf does not work for me...

$ ping archive.ubuntu.com
PING archive.ubuntu.com (91.189.88.152) 56(84) bytes of data.

@kidapu
Copy link
Author

kidapu commented Jan 22, 2021

After running the commands in the comments below, my PC stopped connecting to WiFi, not just WSL2.

#4926 (comment)

I had to reinstall the drivers and no matter what I did, I could not get it fixed to the internet.

Therefore, I reinstalled Windows 10.

After that, I was able to connect to the Internet even with WSL2....

@kidapu kidapu closed this as completed Jan 22, 2021
@mrcaron
Copy link

mrcaron commented Jun 28, 2021

oh boy. I have confirmed that I can reach the internet using WSL1, but not WSL2. I performed the same steps in your description. I can't re-install windows as it's a company-controlled install so I get provided an "image" with pre-installed windows. :/

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

3 participants