Files
Knowledge/1 使用/Windows/Windows 端口转发.md
T

20 lines
716 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Windows 自带的 `netsh` 命令是功能强大的网络配置工具,支持 IPv4/IPv6 端口转发,操作无需安装额外软件,适合快速配置。
**主要功能**:
1. **添加转发规则**
```
netsh interface portproxy add v4tov4 listenport=本地端口 connectaddress=目标IP connectport=目标端口
```
```
#示例:将本地8080转发到192.168.1.100的80端口
netsh interface portproxy add v4tov4 listenport=8080 connectaddress=192.168.1.100 connectport=80
```
2. **查看规则**:`netsh interface portproxy show all`
3. **删除规则**:`netsh interface portproxy delete v4tov4 listenport=端口`
4. **重置所有规则**:`netsh interface portproxy reset`