无法在 WSL2 Ubuntu 20.04 上连接互联网

无法在 WSL2 Ubuntu 20.04 上连接互联网
    $ ping google.com

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

我正在使用 Ubuntu 20.04 LTS/WSL2。我在 Windows 上使用 192.168.91.4 的 DNS 代理服务器。

>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 . . . . . . . . . :

这是我的 ubuntu 网络配置:

$ 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

我想问题是

$ ping 192.168.91.4

在 Windows 上 ping 192.168.91.4 时不起作用。192.168.91.4 是 DNS 代理服务器。提前致谢。

相关内容