Xiaomi AX9000 installs Docker and Docker application installation

Original link: https://yf-ch.com/archives/1991.html

yf-ch.com

Recently, the broadband speed at home has been increased to Gigabit, so I bought Xiaomi’s AX9000 WIFI6 router.

Xiaomi officially provides a development version of ax9000. Docker can be installed now.

Installing Docker can meet basically all the functional requirements of everyone, and because Docker itself is similar to a sandbox, even messing around will not cause problems with the machine and Xiaomi’s system, so it is strongly recommended that users who just want to add functions to the router directly use Docker instead. Not cracking SSH.

Preparation

1. One AX9000 router, and upgrade to the official development version firmware.

2. A USB flash drive or mobile hard disk with more than 32GB available space, which needs to be plugged into the router for a long time. (You can prepare a large hard disk box and directly use docker to build a nas system. Xiaomi did not support remote downloads before. All can be achieved)

Tools you may need:

Firmware miwifi_ra70_all_develop_1.0.140

Partition tool DiskGenius

There are download links in the tutorial, all of which are free

First upgrade the router to the development version of Ax9000, the firmware download address: official download

After downloading the firmware, open 192.168.31.1 or http://miwifi.com to enter the router background

In the common settings system status, select manual upgrade and then select the miwifi_ra70_all_develop_1.0.140.bin firmware. After the upgrade is completed, the system will become the developer version, the version number is 1.0.140

Next, modify the U disk or mobile hard disk to the Linux partition format ext4
It is to format the U disk or mobile hard disk in ext4 format. Windows does not support ext4 format formatting by default, so we need to download a partition tool. Here we recommend using the free version of DiskGenius. Of course, you have other partition tools that support ext4. OK. Download

We insert the U disk into the computer, and then run the DiskGenius software. Right-click the disk, and the right-click menu pops up, and select Format the current partition. Then, as shown in the figure, select the file system Ext4, and then click Format.

Then insert the ext4 format U disk into the router, log in to the background 192.168.31.1 again, and you will find that there is an extra DOCKER in the advanced settings, click it.

Just choose to install Docker directly, then the router will download and install Docker by itself, and Docker will have an independent WEB background.

When the installation is successful, click OK.

Then click to install third-party management, because Xiaomi does not provide ssh, so if you don’t install third-party management, you can’t actually use this Docker. That is, users who have not obtained root can only use third-party management, that is, this Portainer Panel, to use and manage.


After installing the third-party management, click Manage Docker, or visit 192.168.31.1:9001

To log in to Portainer to manage Docker and add applications

The default account password is admin

After entering, select the first Mange the local Docker environment, that is, run portainer in stand-alone mode, and then all default settings come to the main interface.

Add functionality via +Add container

The Chinese translation here is a trap. If you use the Chinese translation, it should be called adding a container.

All the images in the figure are actually images, which you can understand as a packaged Docker application environment.

Docker itself is a sandbox-like system. The purpose of the invention is to directly package the application and the environment, so that users can copy the image and use it directly, without having to reconfigure various operating environments. Speaking of people is the solution, why? It can be used on some computers, but not on some computers. Therefore, even if you mess around with Docker, it will not affect the ax9000 itself. The default portainer container is the underlying container. Every time you add a container, the new container The environment will be based on the previous container. For example, if the portainer has installed the golang environment, then all subsequent containers will have the golang environment. In human terms, it is layer upon layer of nesting dolls.

So the actual Docker is very simple to play, so easy. Just click to add a container, and that’s it. If you want to use some images you downloaded yourself.

Then click on Images on the left, the Chinese translation is a picture (wrong translation), here you can upload a custom image. Then use +Add container to add a container to run it.

+Add container The interface for adding a container is as follows

There are only 3 things to note here

First of all, you can write the Name yourself. Then for Image, you need to fill in the real name of the image in http://hub.docker.com , most of which are titles, and a few are different. You can click Search on the far right of Image. ,Visit http://hub.docker.com to view all applications (mirrors), or open this URL in the browser.

Then find the image you want, such as ad blocking (I will open it directly with a browser as an example)

After opening, you can directly enter the content in the red box to view the warehouse without registration. The advantage of registration is that you can download the mirror image unlimited times a day. If you don’t register, 100 times a day is completely enough.

Here I take ad blocking as an example, just search for adguard

Then you need to remember that the Xiaomi ax9000 system is a custom system based on openwrt, which belongs to Linux, and Qualcomm’s CPU is an arm64 architecture.

Therefore, there must be applications (mirrors) of the two labels of Linux and arm64 in order to be used normally.

We click on the first adguardhome, and then as shown below

The yellow box in the figure is its real name. It is the part after docker pull.

We copy this and paste it into the image of the new container

Because it is someone else’s picture, so the picture is for demonstration only.

Then always pull the image option (translation is called always pull the image), if you do not have this mirror locally, please select it, it will automatically pull the latest version from the warehouse. If you already have this mirror locally, or The image you uploaded locally, then do not select it, so that the local version is used

The key point is that the option of Pulish all exposed network prots to random host ports is disabled by default and must be enabled.

Because Xiaomi AX9000 does not support vlan, and the installed applications default to the network segment of 172.17.0.0/32, it is necessary to randomly map the external port to the local port through this to realize its access.

For example, adguardhome opens port 3000 by default to install and manage it, and the default application IP is 172, so its management address will be 172.17.0.5:3000, and the host IP of AX9000’s Docker is 192.168.31.1. There is a way to access 172.17.0.5, so this function is needed to randomly assign a port to 192.168.31.1, such as 37111, and then accessing 192.168.31.1:37111 is equivalent to accessing 172.17.0.5:3000

Other settings are generally ignored (some applications need to assign mount points, similar to disk locations, just follow the tutorial configuration)

Click Deploy the container at the bottom (create mirror) and wait, it will download itself, then install and run.

Then, your Container list (container) interface will have a new container, and now running is running (Chinese translation is running)

My picture here is someone else’s. But it doesn’t affect the explanation

In the red box, the port mapping displayed is in the format of native port: mapped port

You can roughly understand that you can access the mapped port corresponding to the application by accessing 192.168.31.1: local port, such as 8001:8000

That is, visiting 192.168.31.1:8001 is actually visiting 172.17.0.1:8000 visiting 192.168.31.1:9001 is actually visiting 172.17.0.1:9000

All ip in Docker start with virtual 172.17

So if you install any application, you can see where it is managed here.

If he has a bunch of ports, then you can check the logs

Click on this chart to view the log.

If adguard is installed, the log will be like this:

Here it means that his management background is 172.17.0.5:3000, so we only need to find out which port 3000 is mapped by the router, and then access it.

This concludes the tutorial, I wish you all a happy game.

Because of policy reasons, I know that everyone is curious about some applications and wants to go to the outside world to see. If you can’t find the application, you can search for it by referring to the service name of openwrt. As long as there is a linux arm64 label, it can be used.

Then, as for the scientific exploration staircase application starting with a certain C, Baidu also has a special docker installation tutorial.

Search for “docker install c full name”, that’s it. Generally, the docker of NAS is compatible with the docker of other routers and Xiaomi.

If it is also a Qualcomm processor, it can be used directly!

This article is transferred from: https://yf-ch.com/archives/1991.html
This site is only for collection, and the copyright belongs to the original author.