Windows下用netsh命令实现端口转发(端口映射)
首先安装IPv6(XP下IPv6必须安装,否则端口转发不可用)
netsh interface ipv6 install
添加一个IPv4到IPv4的端口转发
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=0 connectaddress=0.0.0.0 connectport=0
删除端口转发
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=0
查看存在的转发
netsh interface portproxy show all