端口转发
端口转发
# 在A服务器9082端口转发到B服务器8082端口:
netsh interface portproxy add v4tov4 listenport=9082 listenaddress=0.0.0.0 connectport=8082 connectaddress=10.1.0.8
# 查看所有转发规则
netsh interface portproxy show all
# 删除特定转发规则
netsh interface portproxy delete v4tov4 listenport=8082 listenaddress=0.0.0.0
# 删除所有转发规则
netsh interface portproxy reset
# 在A服务器配置出入站规则
netsh advfirewall firewall add rule name="Port 9082" dir=in action=allow protocol=TCP localport=9082
netsh advfirewall firewall add rule name="Port 9082" dir=out action=allow protocol=TCP localport=9082