zoukankan      html  css  js  c++  java
  • 使用Windows的NAT功能

    使用管理员权限打开命令行控制台。

    端口映射相关命令

    查看当前机器的端口代理表:

    netsh interface portproxy show all

    C:WINDOWSsystem32>netsh interface portproxy show all

    侦听 ipv4:                 连接到 ipv4:

    地址            端口        地址            端口

    --------------- ----------  --------------- ----------

    172.16.11.68    1883        192.168.11.50   1883

    172.16.11.68    80          192.168.11.12   80

    添加端口映射:

    netsh interface portproxy add v4tov4 listenaddress=192.168.11.68 listenport=1883 connectaddress=192.168.11.50 connectport=1883

    删除端口映射:

    netsh interface portproxy delete v4tov4 listenaddress=192.168.11.68 listenport=1883

    以上命令在我的开发机器上被使用,系统是win8升级后的win10。其他windows版本没有试过。

  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/shijiaqi1066/p/5138583.html
Copyright © 2011-2022 走看看