Windows netsh 使用

Windows netsh 使用

  • 查看所有的端口转发规则
netsh interface portproxy show all

  • 增加一条端口转发规则
netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=3389 connectaddress=25.63.54.89 connectport=3389


netsh interface portproxy add v4tov4 listenaddress=127.0.0.1 listenport=80 connectaddress=frp.weihongbin.com connectport=7008
  • 删除一条端口转发规则
netsh interface portproxy delete v4tov4 listenaddress=127.0.0.1 listenport=3389
  • 将已存在的端口转发规则进行输出
netsh interface portproxy dump
  • 重置所有的端口转发规则
netsh interface portproxy reset
  • 添加DNS
 netsh.exe interface ip add dns name="WLAN"  add=192.168.1.60 index=2