0%

WSL 常见问题

windows 与 wsl 之间端口转发

1
2
3
4
5
6
netsh interface portproxy add v4tov4 listenport=3306 listenaddress=0.0.0.0 connectport=3306 connectaddress=172.25.193.202

netsh interface portproxy add v4tov4 listenport=3307 listenaddress=0.0.0.0 connectport=3307 connectaddress=172.25.193.202

netsh interface portproxy add v4tov4 listenport=80 listenaddress=0.0.0.0 connectport=80 connectaddress=172.25.193.202

查看已转发的端口

1
2
netsh interface portproxy show all

删除单条转发规则

1
2
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=88

重置转发规则(删除所有规则)

1
2
netsh interface portproxy reset