wsl2局域网内访问
1、添加转发,仅此命令即可
# 根据实际情况修改监听端口等参数值 netsh interface portproxy add v4tov4 listenport=80 listenaddress=* connectaddress=127.0.0.1 connectport=80 protocol=tcp # 注意防火墙放行 netsh advfirewall firewall add rule name="web-80" dir=in action=allow protocol=tcp localport=80
2、查看
netsh interface portproxy show all
3、删除全部
netsh interface portproxy reset