Synology installs OpenWrt (iStoreOS) build bypass route to configure OpenClash

Some time ago, [ Synology Docker installs and runs Clash and automatically updates the subscription ] to achieve scientific Internet access. When connecting to WiFi , fill in the proxy address to achieve it. Quest2 VR and common mobile phones and other common devices support it. This method is relatively simple. . However, not all devices support network proxy, such as Apple TV does not support it, so you can consider using a bypass router, you can install OpenClash in the bypass router, and configure the subscription address to implement it.

Note: This article does not involve how to purchase a subscription address, please solve it yourself.

Principle of soft routing

Regular network as well as soft-routing and bypass-routing networking topologies:

soft routing

Soft routing is to install OpenWrt open source router firmware on computers, NAS , or special soft routing hardware devices, and then connect to the optical modem through soft routing.

The soft router is relatively intrusive. It needs to replace the existing router for networking, and then connect the existing router to the soft router, that is, at least two network ports are needed to realize it, one connected to the optical modem and one connected to the router.

The bypass router (bypass gateway) is another way to use the soft router. It does not change the existing network layout and is less intrusive. The bypass router is connected to the main router as a common network device. After configuration, you only need to point the gateway address to Bypass router address (can be set uniformly in the main router, or can be set separately in the required device).

Note: Although the DS920+ I use here has two network ports, the bypass router only needs one network port, and does not need two network cables and two ports.

download firmware

At present, there are many firmwares. There are official firmwares, and you can also compile them yourself. There are also compiled firmwares. KOOLCENTER provides compiled firmwares and directly provides images (installed disk images). There are KoolShare and iStoreOS , etc. Compared with iStoreOS New, the update frequency is high, and the interface is more beautiful, it is recommended to choose a newer firmware, the compatibility will be better.

Address: https://fw.koolcenter.com/iStoreOS/x86_64/

Actual selected firmware address: https://fw.koolcenter.com/iStoreOS/x86_64/istoreos-21.02.3-2022121613-x86-64-squashfs-combined.img.gz

Synology Install OpenWrt

First you need to install the virtual machine suite, and then install the OpenWrt system in the virtual machine suite

Install the virtual machine kit

First find and install the virtual machine suite Virtual Machine Manager in the Synology suite, and then open the virtual machine suite

image-20230108133738800

Configure storage, if you have used it before, it should have been configured here

image-20230108134137418

Upload the firmware image

First, unzip the OpenWrt firmware just downloaded, and get a file ending in img , which can be uploaded to the Synology system, or placed locally first, and select the image in [Select Installation File]:

image-20230108135120952

Add the OpenWrt image to it.

image-20230108200529168

Go to the next step and finish.

image-20230108200705900

import virtual machine

Click [Virtual Machine], and then select [Import] the virtual machine image just added in [Add]

image-20230108135526759

Go to the next step, configure CPU和内存使用等,根据自己的硬件能力配置,据说比较老的固件需要点那个齿轮,配置CPU`compatibility mode. The latest version does not need it.

image-20230108135937551

Next select the uploaded image

image-20230108201004057

The next step is to select the network, the default is fine

image-20230108140238984

Configure autostart

image-20230108140347689

Select an administrative user, and then complete the next step. So far, it has been installed, and some configurations will be done later.

image-20230108140453243

Note: Because it is a virtual machine, you can take a snapshot. If there are some difficult problems, you can roll back to the snapshot

Configure the OpenWrt system

After the import is complete, turn it on, and then you can connect to enter a new web terminal. The system of iStoreOS is relatively large, and the startup is slow. You may need to wait a while to enter the terminal.

image-20230108140726886

After pressing Enter, you can enter a terminal similar to Linux

image-20230108201141085

Configure IP address

The router needs to be configured in the same network segment as the main route. The default IP is 192.168.100.1 . I am using a AX6 router here, so it is in the 192.168.31.* network segment. You can go to the router to see what has been used Network address, and choose an IP address that is not in use. I use 192.168.31.2 here

 vim /etc/config/network

Press the i key to enter the editing mode, find 192.168.100.1 and modify it to 192.168.31.2 , then Esc to exit the editing mode, and then enter :wq to save (basic vim operation)

image-20230108201747747

then reboot

 reboot

Login to OpenWrt

After the restart is complete, you can access the OpenWrt background in the browser, the address: http://192.168.31.2, the default password is password .

image-20230108201838378

Modify the default password [System] – [Administration Rights]:

image-20230108201919109

By default, OpenWrt automatically assigns IP functions by DHCP , that is, there are two DHCP servers in the LAN. Generally, as a bypass router, the DHCP function of the bypass router will be turned off. The current version can automatically implement related configurations.

Configure bypass

After logging in to the OpenWrt background, enter the [Network Wizard], there is a fool-like guidance function [configure as a bypass route], of course, you can also use the [advanced mode] to configure it yourself

image-20230108202039210

Configure the IP address ( 192.168.31.2 ) and gateway, etc., the gateway is set to the IP address of the main route

image-20230108202215494

The configuration is complete.

test bypass

You can use a computer to configure an IP address to test it. As long as you can access the Internet, it means success. The main thing is to point the gateway and DNS to the fixed IP:192.168.31.2 .

image-20230108145029185

Apple TV configuration

image-20230108213223144

Install the OpenClash plugin

The OpenWrt [Service] provided by iStoreOS already has several plug-ins, which can be manually turned off if not needed.

Some common plug-ins can be installed under the iStore menu, which is more convenient

Note: There are certain risks in installing the plug-in. You can take a snapshot of the virtual machine first, and you can quickly roll back in case the system crashes.

Download OpenClash

To install OpenClash at present, it is best to upgrade the kernel, otherwise an error may be reported

https://downloads.openwrt.org/snapshots/targets/x86/64/packages/

Download the latest kernel: https://downloads.openwrt.org/snapshots/targets/x86/64/packages/kernel_5.15.86-1-9f9e11a5e946333b83ba37f6864e5c49_x86_64.ipk

Download OpenClash :

Download address: https://github.com/vernesong/OpenClash/releases

Actual download file: https://ghproxy.com/https://github.com/vernesong/OpenClash/releases/download/v0.45.78-beta/luci-app-openclash_0.45.78-beta_all.ipk

upload and install

Upload to OpenWrt first, and upload the downloaded two files to the /tmp/upload directory in [System]-[File Transfer]:

image-20230108202846679

The ipk of the kernel can be installed on the interface, but OpenClash can only be installed after the dependencies are installed, and can be installed with commands on the terminal.

Enter the terminal (the default account is root/password , if you have changed the password, use your own modified password), follow the OpenClash documentation to install dependencies

image-20230108203727981

 # 升级核心,不升级可能会提示pkg_hash_check_unresolved: cannot find dependency kernel opkg install /tmp/upload/kernel_5.15.86-1-9f9e11a5e946333b83ba37f6864e5c49_x86_64.ipk # 升级opkg update # 安装依赖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 # 安装OpenClash opkg install /tmp/upload/luci-app-openclash_0.45.78-beta_all.ipk

After the installation is successful, there will be [ OpenClash ] in [Services].

Configure OpenClash

In the configuration file subscription, add your own subscription address

image-20230108204553741

After starting OpenClash , you can see that the website accessibility check is normal

image-20230108210500374

You can try to visit https://google.com on your computer. If it succeeds, it means the configuration is complete.

This article is transferred from https://fugary.com/?p=419
This site is only for collection, and the copyright belongs to the original author.