# IRouter-OpenVPN-NAT-Port-Mapping

**URL:** <https://community.inhand.com.cn/t/irouter-openvpn-nat-port-mapping/286>\
**Category:** InRouter\
**Tags:** IRouter, InConnet-Client, NAT, IR611S, IR615S\
**Created:** [2018 年1 月 27 日 07:11 UTC](https://community.inhand.com.cn/t/irouter-openvpn-nat-port-mapping/286 "2018-01-27T07:11:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

作者： ![Sunzd](https://community.inhand.com.cn/letter_avatar_proxy/v4/letter/s/13edae/32.png) [@Sunzd](https://community.inhand.com.cn/u/Sunzd)\
发布日期： [2018 年1 月 27 日 07:11 UTC](https://community.inhand.com.cn/t/irouter-openvpn-nat-port-mapping/286/1 "2018-01-27T07:11:21Z")

</div>

1. 新建OpenVPN Clinet，OpenVPN 隧道命名为：OpenVPN\_T\_1 （名称为自定义，但后面的NAT映射需要用到此隧道名，因为OpenVPN服务开启之后，会生成一个此名称的虚拟接口)。
  
[![openvpn-config.PNG](https://community.inhand.com.cn/storage/article/20180127/99f39393c1cd792e4b8cec4b97983e33.PNG "openvpn-config.PNG")](https://community.inhand.com.cn/storage/article/20180127/99f39393c1cd792e4b8cec4b97983e33.PNG)

1. OpenVPN Client 建立成功。

[![openvpn-clinet-status.PNG](https://community.inhand.com.cn/storage/article/20180127/a0f62f2e3409c5805a2af1285b9a8db1.PNG "openvpn-clinet-status.PNG")](https://community.inhand.com.cn/storage/article/20180127/a0f62f2e3409c5805a2af1285b9a8db1.PNG)

1. 将路由器下端设备192.168.2.2:8080&5002 端口映射到虚拟接口“OpenVPN\_T\_1”

[![openvpn-interface-portmaping.PNG](https://community.inhand.com.cn/storage/article/20180127/a660aecf32f36e7bc1b30c67bd9b7a59.PNG "openvpn-interface-portmaping.PNG")](https://community.inhand.com.cn/storage/article/20180127/a660aecf32f36e7bc1b30c67bd9b7a59.PNG)

4.下端设备192.168.2.2 建立TCP Server 8080&5002

[![LAN-PC-TCP-Server-Port-config.PNG](https://community.inhand.com.cn/storage/article/20180127/f58d7f14c818eb376f640df872930ad4.PNG "LAN-PC-TCP-Server-Port-config.PNG")](https://community.inhand.com.cn/storage/article/20180127/f58d7f14c818eb376f640df872930ad4.PNG)

5.OpenVPN Server访问Client OpenVPN\_T\_1 接口IP 192.168.100.26:8080

[![test-8080.PNG](https://community.inhand.com.cn/storage/article/20180127/4c576d667aaa2998edfcf6df59409cac.PNG "test-8080.PNG")](https://community.inhand.com.cn/storage/article/20180127/4c576d667aaa2998edfcf6df59409cac.PNG)

与下端设备192.168.2.2:8080 成功建立TCP链接

[![test-8080-connected.PNG](https://community.inhand.com.cn/storage/article/20180127/93932aeef77bac1acfa1833f159a7e3c.PNG "test-8080-connected.PNG")](https://community.inhand.com.cn/storage/article/20180127/93932aeef77bac1acfa1833f159a7e3c.PNG)

OpenVPN Server访问Client OpenVPN\_T\_1 接口IP 192.168.100.26:5002（图片后面的CMD命令框）

[![test-5002.PNG](https://community.inhand.com.cn/storage/article/20180127/a7ee696f507345a0a2f011be7d5d4d2c.PNG "test-5002.PNG")](https://community.inhand.com.cn/storage/article/20180127/a7ee696f507345a0a2f011be7d5d4d2c.PNG)

与下端设备192.168.2.2:5002 成功建立TCP链接

[![test-5002-connected.PNG](https://community.inhand.com.cn/storage/article/20180127/4807d92ddac45679873e04e426287176.PNG "test-5002-connected.PNG")](https://community.inhand.com.cn/storage/article/20180127/4807d92ddac45679873e04e426287176.PNG)
