Intranet penetration tutorial, data traffic forwarding through the public network IP server
Article directory
foreword
In order to access the local project on the public network, in addition to deploying it on the cloud server, it can also be achieved through intranet penetration, which avoids the cumbersome steps of re-deploying to the cloud server after the project has a problem and is modified. , and do not need public network IP and server.
Intranet traversal, in simple terms, is to forward data traffic through the public network IP server, so that projects that can only be accessed under the local LAN can be accessed normally in the public network environment through intranet traversal.
Here we recommend an intranet penetration tool —— cpolar
, free forever and unlimited traffic, supports http/https/tcp protocol, no public IP, no need to set up a router, easy to use.
Application scenario:
- Demo intranet web site outside
- WeChat official account interface local breakpoint debugging
- Remote PC, Raspberry Pi, NAS
- Build a private game server, such as "My World", etc.
- Remote access to OA, ERP, and BUF management systems of the company's intranet
- Build Git private warehouse, online documentation server, etc.
- Debug the WebHook interface of the AI robot platform, etc.
- …
cpolar intranet penetration tutorial
1. Install the cpolar intranet penetration tool
cpolar intranet penetration official website: https://www.cpolar.com/
You need to register a cpolar account first, which will be used later
1.1 Windows system
For windows system, you can download the latest installation package from the official website of cpolar, and then decompress and install it by default.
1.2 Linux system
The linux system supports one-click automatic installation scripts
1.2.1 Installation
- domestic use
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
- foreign use
curl -sL https://git.io/cpolar | sudo bash
1.2.2 Adding services to the system
sudo systemctl enable cpolar
1.2.3 Start the service
sudo systemctl start cpolar
1.2.4 View service status
sudo systemctl status cpolar
If it is displayed normally active
, it means that it has been started successfully.
2. Create a tunnel mapping intranet port
After cpolar is successfully installed, visit 127.0.0.1:9200 on the browser, and use the cpolar account to log in to the web UI management interface.
After successful login, enter the main interface
隧道管理
For example, if we need to publish the local web site under port 80 to the public network, we only need to click ——— on the left dashboard, 创建隧道
enter the tunnel information, and then click Create.
- Tunnel name: customizable, be careful not to repeat
- Protocol: Select
http
the protocol - Local address: fill in
80
the port - Domain Type: Select
随机域名
(free to use) - Region: select
China VIP
After the tunnel is successfully created, you can view the tunnel status in 隧道管理
——— 隧道列表
, if it is active
activated. Indicates that it has been started successfully.
cpolar will install two sample tunnels by default
- One is that the Website tunnel points to http port 8080
- One is ssh tunnel (Linux&macOS system)/remote desktop tunnel (win system), pointing to tcp 22 port/tcp 3389 port
3. Obtain the public network address
状态
Click ——— on the left dashboard 在线隧道列表
to find the tunnel we just created, and you can see that the corresponding public network URL address has been generated. There are two lines, one of which is the http tunnel and the other is the https tunnel.
Just copy the public network address to the browser for access, and realize remote access to intranet web sites from the public network.
Reprinted from the cpolar pole cloud article: [Quick Intranet Penetration Tutorial] ( Quick Intranet Penetration Tutorial - cpolar Pole Cloud )