在Windows下使用Netsh配置端口转发
本文章部分内容参考微软官方文档:https://docs.microsoft.com/zh-cn/windows-server/networking/technologies/netsh/netsh-interface-portproxy
简介
利用Netsh,可以非常方便的在windows系统上建立端口转发。作为 IPv4 和 IPv6 网络与应用程序之间的跳板。
例子
此命令意义为:监听本地v6的5000端口的流量,映射到v4地址192.168.1.37:5000。
netsh interface portproxy add v6tov4 listenaddress=:: listenport=5000 connectaddress=192.168.1.37 connectport=5000
可以使用以下命令来检查
netsh interface portproxy show all
用法
可用的 netsh interface portproxy 命令包括
- add v4tov4
- add v4tov6
- add v6tov4
- add v6tov6
- delete v4tov4
- delete v4tov6
- delete v6tov6
- reset ipv4
- reset ipv6
- set v4tov4
- set v4tov6
- set v6tov4
- set v6tov6
- show all
- show v4tov4
- show v4tov6
- show v6tov4
- show v6tov6
语法
add v6tov4
add v6tov4 listenport= {Integer | ServiceName} [[connectaddress=] {IPv4Address | HostName} [[connectport=] {Integer | ServiceName}] [[listenaddress=] {IPv6Address | HostName} [[protocol=]tcp]
delete v6tov4
delete v6tov4 listenport= {Integer | ServiceName} [[listenaddress=] {IPv6Address | HostName} [[protocol=]tcp]
关联视频教程
使用windows netsh配置端口转发以达到只需要一台机器IPv6 DDNS便可访问局域网教程:待发布