banner
CG艺术实验室

CG艺术实验室

数字艺术 / 视觉设计 / 技术分享 / 知识管理
tg_channel
facebook
x
github
bilibili
zhihu
email

Use a router to achieve whole-house scientific internet access.

Main Course of the Week#

Before I begin, I apologize for the delay in writing for so many weeks. It's been a while, so this week I will write a tutorial.

Introduction#

Last year, I purchased a NAS, but my router still only had a single gigabit Ethernet port. I needed a gigabit router for internal network data exchange. So, I took advantage of a promotional offer and bought a Redmi AX6S router. Before buying it, I didn't read any guides or expect that a router priced at just over 200 yuan would have a killer feature hidden inside. Here, I will document the specific operation process. This process should theoretically work for various types of routers, provided that you can find the corresponding unlockable firmware and a method to calculate the root password. By 2023, I believe these won't be difficult problems anymore. I will use the Redmi AX6S as an example here.

Preparation#

Hardware: Router, Ethernet cable, PC/Mac with internet access

Software: Browser, download and install Termius, firmware file for unlocking

Knowledge: Experience with independent scientific internet access, basic understanding of airport and VPS server usage.

Unlocking SSH#

The steps are as follows:

  1. Flash the development version firmware

Download the installation version firmware in advance. The filename for my Redmi AX6S is miwifi_rb03_firmware_stable_1.2.7.

In the browser window, enter the router's backend. The default address for Xiaomi routers is: 192.168.31.1. Enter the backend administrator account and password. Each brand of router may be different.

Untitled.png

Click on the username in the upper right corner and select "System Upgrade".

Untitled 1.png

In the upgrade detection section, select manual upgrade, choose the firmware file downloaded on your computer, click start upgrade, and don't worry about bricking the router.

Untitled 2.png

Wait for the upgrade to complete and the router to restart, then reconnect to WiFi.

  1. Calculate the router's root password

Now the router's system actually has SSH functionality. We need to calculate the login password based on the router's unique SN number to obtain the highest level of system permissions.

The password calculation method can be done online or using a local HTML file. Common router models will have experts sharing methods on GitHub or related forums. Here, I used the local HTML method. You can directly download it: Xiaomi SN

Open the HTML file and enter the SN to calculate the password.

Untitled 3.png

  1. Use Termius to enable SSH

Termius is a well-known cross-platform SSH client that is beginner-friendly and offers all the features we need for free. Advanced users can use the computer terminal directly for this step.

Installation is not described here. This is the official website.

Termius - SSH platform for Mobile and Desktop

Open Termius, skip the beginner steps, select "Hosts" in the left column, and click "NEW HOST".

Other parameters are shown in the figure below. You can write your own label, fill in the router's IP address in the "Address" field, select "Telnet" as the connection method, and then click on the blank space on the left to save.

Untitled 4.png

Then double-click on the saved Host to establish a Telnet connection. (Telnet is also a network communication protocol)

  • login: root
  • password: paste the calculated root password here (it won't be displayed, just press enter)

Untitled 5.png

Copy the code below to enable the SSH function module.

nvram set ssh_en=1 & nvram set uart_en=1 & nvram set boot_wait=on & nvram set bootdelay=3 & nvram set flag_try_sys1_failed=0 & nvram set flag_try_sys2_failed=1
nvram set flag_boot_rootfs=0 & nvram set "boot_fw1=run boot_rd_img;bootm"
nvram set flag_boot_success=1 & nvram commit & /etc/init.d/dropbear enable & /etc/init.d/dropbear start

Untitled 6.png

  1. Login to SSH

Create a new Host

  • Fill in the Address: 192.168.31.1
  • Check SSH and disable Telnet
  • Fill in SSH username: root
  • Paste the previously calculated root password in the Password field

Click on the arrow in the upper right corner, then select the newly created Host and choose to connect using SSH.

If you see this interface, you are halfway to success!

Untitled 7.png

Installing and Configuring ShellClash#

ShellClash is a variant version of Clash that can run on various router systems and Linux environments. For specific information, see here:

ShellClash/README_CN.md at master · juewuy/ShellClash

Installation#

In the SSH Host, simply paste the following command to install ShellClash.

export url='https://raw.fastgit.org/juewuy/ShellClash/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
  • Select "2" for the stable version
  • Then enter "1" to confirm the installation (I won't overwrite the installation here)

Untitled 8.png

Configuring Clash#

After installation, continue by entering "Clash" in the SSH terminal and pressing enter.

  • Select 1 for host or side router
  • Select 1 to not proxy UDP

Untitled 9.png

To avoid having to open Termius every time you want to configure Clash, you need to install a software interface, which is the local Dashboard panel.

  • Select 1 to install the Dashboard panel
  • Select YACD panel (the number here may be different)
  • Select 1 to install in the /data/clash/ui directory

Untitled 10.png

After installation, select 1 to start the public access service

  • Select 1 to start importing
  • Select 1 to generate the configuration file online
  • Paste your subscription link (provided by your airport or VPS service provider)

3252BB1C-4A3B-45FC-AB27-530AC3C3DC37.png

If you've made it this far, I believe you also have some understanding of airports and VPS servers.

  • Select 1 to start generating the configuration file
  • Select 1 to start Clash service immediately
  • Select 0 to exit the script

If everything goes well, your ShellClash should be working properly now.

Open http://192.168.31.1:9999/ui in your browser to access the Clash backend on your router.

If you don't have any other requirements, I recommend disabling firmware updates on your router.

Untitled 11.png

Summary#

Now, as long as your devices connect to the internet through this router, your device will have a "scientific" connection. You can also switch between different nodes at any time using a browser on your phone or tablet. This is the most scientific way of accessing the internet that I have used so far.

Good luck!

Weekly Highlight#

This week, I started trying the TimeBlock time management method. I have read various introductions to time management online, and my impression has always been:

"Wow... Do I really need to go to such lengths?"

"It feels like living like a robot."

However, after experiencing frequent anxiety and restlessness due to my commercial projects and various life chores, I decided to give it a try, and it's really good. I followed this article for specific steps:

The Complete Guide to Time Blocking

I created my own version using iCloud Calendar based on my own situation and synced it to all my devices.

Of course, you can create your own version according to your habits. The tool you use doesn't matter. You can even start with the calendar on your phone.

Untitled 12.png

I forgot where I saw this sentence:

If you don't try to control your time, time will control you.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.