如果WSL2连接网络时,出现了超时,ping www.baidu.com也连接不上的时候
首先在ubuntu中输入以下命令
$ ip route
会得到
default via 172.24.64.1 dev eth0
172.24.64.0/20 dev eth0 proto kernel scope link src 172.24.66.230
在输入
$ cat /etc/resolv.conf
查看 resolv.conf里面的nameserver,如果不是172.24.64.1修改resolv.conf
$ sudo gedit /etc/resolv.conf
在文件里输入
nameserver 172.24.64.1
修改完之后WSL2就可以连接网络了
最后
以上就是伶俐网络最近收集整理的关于WSL2/Ubunu连不上网的全部内容,更多相关WSL2/Ubunu连不上网内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复