
wsl2启用局域网访问
WSL
Issues found on WSL
项目地址:https://gitcode.com/gh_mirrors/ws/WSL
·
1. 在wsl中运行
sudo ip addr del $(ip addr show eth0 | grep 'inet\b' | awk '{print $2}' | head -n 1) dev eth0
sudo ip addr add 192.168.10.100/23 broadcast 192.168.11.255 dev eth0
sudo ip route add 0.0.0.0/0 via 192.168.10.1 dev eth0
sudo systemctl start shh
echo "" > /etc/resolv.conf
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
2. 在宿主机powershell中运行
Set-VMSwitch WSL -NetAdapterName Ethernet
之后就可以愉快的局域网访问wsl了
Issues found on WSL
最近提交(Master分支:4 个月前 )
235561ef
3 天前
d367de62
3 天前
更多推荐




所有评论(0)