该命令的常用参数如下:
netstat -ano | find listenport
查看是否启动成功netsh interface portproxy show all
显示系统中的转发规则列表netsh interface portproxy dump
查看portproxy设置netsh interface portproxy delete v4tov4 listenport=localport listenaddress=localaddress
netsh interface portproxy reset
清除所有端口转发规则
参数意义
listenaddress
– 等待连接的本地ip地址listenport
– 本地监听的TCP端口(待转发)connectaddress
– 被转发端口的本地或者远程主机的ip地址connectport
– 被转发的端口
添加转发命令:
netsh interface portproxy add v4tov4 listenaddress=172.16.0.4 listenport=8080 connectaddress=104.104.104.104 connectport=9999
删除转发命令:
netsh interface portproxy delete v4tov4 listenaddress=172.16.0.4 listenport=8080