A soft router is a router implemented on a general computing device using software. With a soft router, you can achieve scientific Internet access (over the wall) for all devices in your home. Use cases include devices like Apple TV, Steam DECK, which are not convenient to install wall-climbing software, or situations like the initial Google account activation for overseas Android phones.
NanoPi R2S (hereinafter referred to as R2S) is the latest open-source development board launched by FriendlyElec.
NanoPi R2S uses the RK3328 CPU, has two gigabit networks, 1G DDR4 memory, and FriendlyElec has specifically ported the OpenWrt system for NanoPi R2S, which supports Docker CE and is completely open-source. It is used for secondary development of enterprise IoT, personal custom NAS, etc.
OpenClash is a Clash client that can run on OpenWrt.
NanoPi R2S official wiki: wiki.friendlyelec.com
OpenClash project address: https://github.com/vernesong/OpenClash
Preparation:#
- NanoPi R2S
- SD card (recommended SanDisk, poor card quality may not start)
- Type-C power supply
- SD card firmware writing tool
The above devices can be purchased on Taobao.
Note: The Type-C power supply needs to be selected with a standard voltage of 5V. It is not recommended to use a fast charging charger. If the voltage protocol does not match, it may cause damage to NanoPi R2S. Search directly on Taobao for "standard voltage 5V charger" and select a charger with an output of only 5V2A (some standard voltage 5V chargers may also claim to be fast charging chargers, you need to check the output in the specifications to confirm).
Firmware flashing and OpenClash installation steps:#
1. Download the firmware#
- R2S official firmware download address: https://github.com/friendlyarm/Actions-FriendlyWrt/releases
Download the latest official firmware: R2S-R2C-Series-FriendlyWrt-23.05.img.gz
2. Install the SD card firmware writing tool etcher#
Download and install etcher at https://etcher.balena.io/#download-etcher, supports Windows, MacOS, Linux
3. Use etcher to write the firmware to the SD card#
Insert the SD card into the card reader and connect it to the computer. Follow the software prompts to select the firmware file downloaded just now (no need to decompress), and then select the SD card as the target, click Flash.
4. Insert the SD card and start R2S#
Insert the SD card and connect the power supply to R2S. The sys indicator light flashes to indicate that the system is starting normally. Connect the computer to the LAN port with a network cable, and open the browser to 192.168.2.1 with the password as password.
5. Install OpenClash#
-
Enter the backend of the soft router, go to System -> Software, click Update lists, and wait for the update to complete.
-
Go to Services -> Terminal, enter the username root and password password.
-
Execute the following OpenClash dependency installation command:
opkg install coreutils-nohup bash iptables dnsmasq-full curl ca-certificates ipset ip-full iptables-mod-tproxy iptables-mod-extra libcap libcap-bin ruby ruby-yaml kmod-tun kmod-inet-diag unzip luci-compat luci luci-base
opkg install coreutils-nohup bash dnsmasq-full curl ca-certificates ipset ip-full libcap libcap-bin ruby ruby-yaml kmod-tun kmod-inet-diag unzip kmod-nft-tproxy luci-compat luci luci-base
-
Download the ipk file luci-app-openclash_x.xx.xxx-beta_all.ipk in OpenClash Assets.
-
Go to System -> Software, click Upload package to upload the downloaded ipk file, and then click Install.
-
After the installation is complete, restart and go to Services -> OpenClash.
The first time you open OpenClash, you need to download the kernel. You can choose any CDN domain name that can be connected.
Airport subscription usage#
-
Enable meta kernel
Services -> OpenClash -> Plugin Settings -> Mode Settings check Use Meta Kernel and click Save Configuration
-
Add subscription
Go to Configuration Subscription
Turn on automatic update, then click Add
Fill in the subscription address with the Clash subscription address copied from the airport background, then save and update the configuration.
After updating the subscription, go back to Running Status and click Start OpenClash
-
Node selection and configuration
Go to Dashboard Control Panel to select nodes
Note: If the browser has enabled DNS Over HTTPS, it needs to be turned off to use it normally.
Soft router security configuration#
- System -> Administration -> Router Password to change the login password
- System -> Administration -> SSH Access to modify the interface, select lan, and save and apply
Recommended airport: Small Airport