wsl命令之子系统网络端口映射
查看端口映射
netsh interface portproxy show all
添加映射
# 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
# 根据ip及端口号删除
netsh interface portproxy delete v4tov4 listenaddress=192.168.100.1 listenport=8080 netsh interface portproxy delete v4tov4 listenport=8080
# 删除所有代理规则
netsh interface portproxy reset
查看wsl版本
wsl -l -v
设置版本
wsl --set-default-version 2