在windows上做系统开发时,有时会有端口转发的需求
添加端口映射
netsh interface portproxy add v4tov4 listenaddress=192.168.xxx.xxx listenport=6379 connectaddress=192.168.yyy.yyy connectport=6379
会把本机ip192.168.xxx.xxx,端口6379的数据请求转发到远程ip 192.168.yyy.yyy ,端口6379 上
删除端口映射
netsh interface portproxy delete v4tov4 listenaddress=192.168.xxx.xxx listenport=6379
查看端口映射
netsh interface portproxy show all
查看更多帮助
netsh help netsh interface portproxy help