Windows下给虚拟机的端口代理
新建一个.bat文件,然后复制下面的内容保存后双击运行
netsh interface portproxy delete v4tov4 listenaddress=本机IP listenport=本机端口
netsh interface portproxy add v4tov4 listenaddress=本机IP listenport=本机端口 connectaddress=其他机器ip connectport=其他机器端口
上面可以多行复制
netsh interface portproxy show all
pause
例子:
netsh interface portproxy delete v4tov4 listenaddress=192.168.100.115 listenport=8051
netsh interface portproxy add v4tov4 listenaddress=192.168.100.115 listenport=8051 connectaddress=192.168.195.129 connectport=8051
netsh interface portproxy delete v4tov4 listenaddress=192.168.100.115 listenport=8052
netsh interface portproxy add v4tov4 listenaddress=192.168.100.115 listenport=8052 connectaddress=192.168.195.129 connectport=8052
netsh interface portproxy show all
pause
Windows下给虚拟机的端口代理
https://qiil.github.io/2022/08/12/Windows下给虚拟机的端口代理/