当前位置:首页 > 编程笔记 > 正文
已解决

win10端口转发

来自网友在路上 175875提问 提问时间:2023-11-06 11:35:12阅读次数: 75

最佳答案 问答题库758位专家为你答疑解惑

1. 写在前面

核心命令 netsh, 此工具在win10下,支持大量网络相关配置,可参考:netsh官方文档

2. 命令行批模式

在CMD或PowerShell中,执行以下命令, 可能会提示需要管理员权限执行

# 添加转发规则,本地3306端口转192.168.1.168:3306
netsh interface portproxy add v4tov4 listenport=3306 connectaddress=192.168.1.168 connectport=3306
# 删除规则
netsh interface portproxy delete v4tov4 listenport=3306
# 查看规则
netsh interface portproxy show all

3. 命令行交互模式

在CMD或PowerShell中,执行以下命令, 可能会提示需要管理员权限执行

PS C:\Users\Administrator> netsh
netsh>interface
netsh interface>portproxy
netsh interface portproxy>add v4tov4 listenport=3306 connectaddress=192.168.1.168 connectport=3306
netsh interface portproxy>show all
netsh interface portproxy>delete v4tov4 listenport=3306# 回退到上一级
netsh interface portproxy>..
netsh interface>..# 显示帮助信息
netsh>?下列指令有效:此上下文中的命令:
..             - 移到上一层上下文级。
?              - 显示命令列表。
abort          - 丢弃在脱机模式下所做的更改。
add            - 在项目列表上添加一个配置项目。
advfirewall    - 更改到 `netsh advfirewall' 上下文。
alias          - 添加一个别名
branchcache    - 更改到 `netsh branchcache' 上下文。
bridge         - 更改到 `netsh bridge' 上下文。
bye            - 退出程序。
commit         - 提交在脱机模式中所做的更改。
delete         - 在项目列表上删除一个配置项目。
dhcpclient     - 更改到 `netsh dhcpclient' 上下文。
dnsclient      - 更改到 `netsh dnsclient' 上下文。
dump           - 显示一个配置脚本。
exec           - 运行一个脚本文件。
exit           - 退出程序。
firewall       - 更改到 `netsh firewall' 上下文。
help           - 显示命令列表。
http           - 更改到 `netsh http' 上下文。
interface      - 更改到 `netsh interface' 上下文。
ipsec          - 更改到 `netsh ipsec' 上下文。
lan            - 更改到 `netsh lan' 上下文。

查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"win10端口转发":http://eshow365.cn/6-33583-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!