当遇到在家休假,却需要远程处于公司内网服务器的场景时,我们可以通过内网穿透将本地端口映射到公网,使用所生成的公网地址来进行远程连接。
[En]
When we encounter a scenario where we are on vacation at home but need to be remotely located on the company's intranet server, we can map the local port to the public network through private network penetration, and use the generated public network address for remote connection.
这里推荐一款可以 永久免费使用
,还 不限制流量
的内网穿透工具————cpolar
,支持 http/https/tcp协议
,无需公网IP,也不需要设置路由器。
1. 远程桌面连接服务器
我们可以用Windows系统自带的微软远程桌面,通过cpolar映射3389端口,使用所生成的公网TCP端口地址,来进行远程桌面连接。
1.1 安装cpolar内网穿透
cpolar官网:https://www.cpolar.com/
windows系统可以在cpolar官网下载最新的安装包,然后解压默认安装即可。
cpolar安装后会默认安装两条样例隧道:
- 一个是Website隧道,指向http 8080端口
- 一个是远程桌面隧道(win系统),指向tcp 3389端口
因此,我们安装完成后,只需要启动远程桌面隧道服务,就可以获得公网地址。
[En]
Therefore, after the installation is completed, we only need to start the remote Desktop Tunnel service to obtain the public network address.