Score:0

Can not connect Internet on WSL2 Ubuntu 20.04

fk flag
    $ ping google.com

>     ping: google.com: Temporary failure in name resolution

I am working on Ubuntu 20.04 LTS/WSL2. I using dns proxy server of 192.168.91.4. on Windows.

>ipconfig

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : xxxx::xxxx::xxxx::xxxx
   IPv4 Address. . . . . . . . . . . : 192.168.118.144
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.118.1

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : xxxx::xxxx
   IPv4 Address. . . . . . . . . . . : 172.28.224.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :

This is my ubuntu network config:

$ cat /etc/resolv.conf
nameserver 192.168.91.4
$ cat /etc/wsl.conf
[network]
generateResolvConf = false

$ ip addr show
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 6e:ef:08:01:8e:7a brd ff:ff:ff:ff:ff:ff
3: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 62:a9:e4:c3:86:f0 brd ff:ff:ff:ff:ff:ff
4: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
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
6: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:5d:cf:26:25 brd ff:ff:ff:ff:ff:ff
    inet 172.28.235.144/20 brd 172.28.239.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fecf:2625/64 scope link
       valid_lft forever preferred_lft forever

I guess the problem is

$ ping 192.168.91.4

is not working while on Windows ping to 192.168.91.4 works. 192.168.91.4 is DNS proxy server. Thanks in advance.

Terrance avatar
id flag
The nameserver that should be used in WSL2 should be the same as the WSL IP in Windows. `nameserver 172.28.224.1`
happygoose30 avatar
fk flag
Thanks for your reply. Still not working. Seems like > `$ ping 192.168.91.4 ` in wsl2 not connecting is the problem.
Terrance avatar
id flag
The issue would be with the Windows configuration not forwarding correctly. See: https://github.com/microsoft/WSL/issues/4150#issuecomment-504209723
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.