1. WSL命令之子系统网络端口映射
1 查看端口映射
在windows的CMD下运行
netsh interface portproxy show all
2 添加映射
# netsh interface portproxy add v4tov4 listenport=[win10端口] listenaddress=0.0.0.0 connectport=[虚拟机的端口] connectaddress=[虚拟机的ip]
netsh interface portproxy add v4tov4 listenport=80 listenaddress=0.0.0.0 connectport=80 connectaddress=172.29.41.233
3. 根据ip及端口号删除
netsh interface portproxy delete v4tov4 listenaddress=192.168.100.1 listenport=8080
netsh interface portproxy delete v4tov4 listenport=8080
4. 删除所有代理规则
netsh interface portproxy reset
5. 查看wsl版本
wsl -l -v
6. 设置版本
wsl --set-default-version 2