# Win

# netsh命令

查看转发规则

netsh interface portproxy show all
1

端口转发规则包含(本机本地侦听IP192.168.3.6和侦听端口2405)+(远端服务器IP112.11.36.130+端口10010)的对应关系,不写listenaddress 代表监听本地所有ip

netsh interface portproxy add v4tov4 listenport=2405 listenaddress=192.168.3.6 connectport=10010 connectaddress=112.11.36.130 protocol=tcp
netsh interface portproxy add v4tov4 listenport=2405 connectport=10010 connectaddress=112.11.36.130 protocol=tcp
1
2

删除转发规则

netsh interface portproxy delete v4tov4 listenport=2405 listenaddress=192.168.3.6
1

清空转发规则

netsh interface portproxy reset
1
Last Updated: 2/29/2024, 9:57:27 PM