netsh interface portproxy reset
netsh interface portproxy show all
for /F %%i in ('wsl ifconfig eth0 ^| wsl grep "inet " ^| wsl awk '{ print $2}'') do (set wsleth0=%%i)
for %%i in (8500,9001,10001,10005) do netsh interface portproxy add v4tov4 listenport=%%i listenaddress=0.0.0.0 connectport=%%i connectaddress=%wsleth0%
netsh interface portproxy show all
pause
这段脚本主要涉及Windows系统的网络配置,包括使用netsh命令重置接口端口代理,展示所有端口代理设置,并将特定端口映射到WSL中Linux发行版的IP地址上,如8500、9001、10001和10005。此操作可能用于本地开发环境的跨系统服务通信。
2265

被折叠的 条评论
为什么被折叠?



