28

WSL2 莫名其妙连不上网了

 3 years ago
source link: https://www.v2ex.com/t/797357
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  Linux

WSL2 莫名其妙连不上网了

  kinboy · 1 小时 47 分钟前 · 90 次点击

Host 主机网络

IPv4 地址 . . . . . . . . . . . . : 192.168.2.147
子网掩码  . . . . . . . . . . . . : 255.255.255.0
默认网关. . . . . . . . . . . . . : 192.168.2.2

vEthernet(WSL)

连接特定的 DNS 后缀 . . . . . . . :
IPv4 地址 . . . . . . . . . . . . : 172.28.16.1
子网掩码  . . . . . . . . . . . . : 255.255.240.0
默认网关. . . . . . . . . . . . . :

WSL2 Ubuntu ip addr

eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:20:c4:7d brd ff:ff:ff:ff:ff:ff
inet 172.28.18.225/20 brd 172.28.31.255 scope global eth0
   valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe20:c47d/64 scope link
   valid_lft forever preferred_lft forever
   
  • 1 、一开始是间歇性无法联网,无法连接外网,表现为 apt-get update 时请求失败,国内源
  • 2 、尝试 ping www.baidu.com等外网域名,超时,nslookup能够正常解析域名 IP,在 host 主机上也能够正常 ping 通域名
  • 3 、尝试 ping 192.168.2.147 host 主机及局域网 ip 地址,会出现在第一条 ping 响应消息之后就卡住不动了,也出现过卡在第三次之后不动
  • 4 、ping 172.28.16.1 vEthernet(WSL)网关正常
  • 5 、尝试了 host 主机上重置各种网络设置 netsh winsock reset,然后重启 WSL,无效

不知道有没有遇到和我一样问题的朋友,现在没有头绪应该怎么处理这个问题了,google 了一圈,好像没有类似的情况,虽然是 Windows 的子系统,还是发在 Linux 节点吧,麻烦大佬指教


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK