发新话题
打印

Windows下端口转发访问内网服务

Windows下端口转发访问内网服务

查询
代码:
netsh interface portproxy show all
netsh interface portproxy show v4tov4 | find "[IP]"
新增
代码:
netsh interface portproxy add v4tov4 listenaddress=[外网IP] listenport=[外网端口] connectaddress=[内网IP] connectport=[内网端口]
新增或修改(本机)
代码:
netsh interface portproxy set v4tov4 listenport=[外网端口] connectaddress=[内网IP] connectport=[内网端口]
删除(本机)
代码:
netsh interface portproxy delete v4tov4 listenport=[外网端口]
xp或2003系统需先安装ipv6
代码:
netsh interface ipv6 install
开放防火墙端口
代码:
netsh advfirewall firewall add rule name="[规则名]" protocol=TCP dir=in localip=[外网IP]  localport=[外网端口] action=allow

TOP

发新话题