Article directory
In a few simple steps, you can remotely access the openWRT web management interface in a public network environment. Use cpolar intranet penetration to create a secure tunnel to map port 443 of the openWRT web interface panel. No public IP or router is required.
1.openWRT install cpolar
Operate openwrt through ssh connection and download the public key:
wget -O cpolar-public.key http://openwrt.cpolar.com/releases/public.key
Add the public key after the download is complete
opkg-key add cpolar-public.key
Add cpolar’s opkg warehouse source
echo "src/gz cpolar_packages http://openwrt.cpolar.com/releases/packages/$(. /etc/openwrt_release ; echo $DISTRIB_ARCH)" >> /etc/opkg/customfeeds.conf
Update repository
opkg update
Then start installing cpolar and execute the following three installation commands to install the three packages:
opkg install cpolar
opkg install luci-app-cpolar
opkg install luci-i18n-cpolar-zh-cn
After the installation is completed, openopenwrt Web管理界⾯
, we can see there is service
, you can see us belowcpolar内网穿透
After clicking in, you can see the cpolar interface, and then configure it.cpolar Authtoken
Log in to the cpolar official website. If you have not registered an account, you can register an account first, and then click on the left side验证
to view your authentication token.
cpolar官网:https://www.cpolar.com
After that, copy the token viewed on the official website to Auth Token
of the openwrt cpolar service interface, and click save
Save after setting.
After successful saving, click 打开Web-UI界面
in the interface to seecpolar web ui 管理界面
Use the account registered on our official website to log in. After logging in, you can manage the tunnel and the installation is complete.
2. Configure the remote access address
We click Tunnel Management - Create Tunnel on the left dashboard. The port of the openWRT web interface panel is443
, so we need to create an http tunnel pointing to port 443: < /span>
- Tunnel name: Customizable, be careful not to repeat it
- Protocol: http
- Local address: 443
- Domain name type: Choose a random domain name
- Region: Select China VIP
Click创建
After the creation is successful, open the online tunnel list and you can see the address for public network access. There are two public network address access methods, one is http and the other is https.
Then we use one of the https addresses to access it in the browser, and we can see our openWRT web interface. In this way, the remote access is configured, which is very simple.
3. Fixed public network address
When we created the tunnel earlier, we used a free random temporary address. The public network address it generates will change within 24 hours. In order to facilitate long-term and stable connections, we can fix the access address, which is called a fixed second-level subdomain name in cpolar, or You can also configure access using your own domain name. Here we take the cpolar subdomain name as an example
You need to upgrade to the basic package or above to support the configuration of second-level subdomain names.
Log incpolar official website backend, click 预留
on the left dashboard, find < a i=4>, reserve a second-level subdomain name for the http tunnel. 保留二级子域名
- Region: Select server region
- Name: Fill in the second-level subdomain name you want to reserve (can be customized)
- Description: Notes, which can be customized
This example reserves a second-level subdomain namedopenwrtweb
. After the subdomain name is successfully reserved, we copy the subdomain name and then configure it into the tunnel.
Open the cpolar web ui management interface. Click 隧道管理
——隧道列表
on the left dashboard, find the tunnel that needs to configure the second-level subdomain name, and click on the right编辑
Modify the tunnel information and configure the second-level subdomain name into the tunnel:
- Domain Type: Select instead
二级子域名
- Sub Domain: Fill in the second-level subdomain name we just reserved (in this case
openwrtweb
)
After modification is completed, click更新
After the tunnel is updated successfully, click 状态
——在线隧道列表
on the left dashboard. You can see that the public network address of the tunnel has been updated to 2 level subdomain name.
Then we use one of the https methods to access it in the browser, and we can see our openwrt interface. In this way, a fixed remote access openWRTweb interface is configured.