WSL2与windows网络不通

方式一:添加路由表

以管理员身份打开powershell
# New-NetFirewallRule -DisplayName "WSL" -Direction Inbound  -InterfaceAlias "vEthernet (WSL)"  -Action Allow


1.WSL
# ifconfig
inet 172.27.106.72

2.windows
# cat /etc/resolv.conf
nameserver 172.27.96.1

方式二、Windows关闭防火墙

猜你喜欢

转载自blog.csdn.net/u010164190/article/details/123523426