Using OpenClash

Original link: https://blog.forecho.com/use-openclash.html

introduction

Recently, there is a need to allow e-book devices to also access websites such as Google. Due to the limited functions of e-book devices, it is not possible to install circumvention software, so the Internet can only be connected to the Internet scientifically through routers or soft routing.

The Xiaomi router at home does not support over-the-wall plug-ins, so it can only be achieved through soft routing. It happens that there is a NAS at home, which can be used as a soft router.

OpenWrt

The main steps of soft routing are to install an OpenWrt through the virtual machine function in my black group, and then install OpenClash on OpenWrt.

Follow up the architecture of your own device and download the corresponding system firmware. For example, mine is the x86_64 architecture, so I download the firmware of the soft routing device such as x86_64 . If you don’t want to toss, choose the plus version directly, which has integrated OpenClash.

Download img.gz file and unzip it into an img file.

virtual machine

To create a virtual machine in Virtual Machine Manager (VMM) on Synology, the steps are as follows:

映像-> 新增-> 从PC 上传文件,找到之前解压的img文件that was unzipped before

Then install OpenWrt, click the virtual machine in VMM, then click Add-新增->导入, select Import从硬盘映像导入, then select the img file just now, and then click Next:

  • Give 2C CPU, 2G memory
  • In the place where the number of CPU cores is selected, there is a small gear on the right, open it, and check to enable CPU compatibility
  • Other defaults.

Then click connect, ready to modify the network (the default is 192.168.1.1):

vim /etc/config/network

Find the option ipaddr xxxx and change it to the IP address you want, for example 192.169.31.99 .

Finally reboot:

 1 2 3 
 /etc/init.d/network restart # or reboot

Then visit http://192.168.31.99/ to see the OpenWrt interface. The default account password is root / password .

Modify LEDE network to full duplex

  • Go to VMM and turn off LEDE
  • Network – Modify the network to e1000 , save, power on

Soft Routing Network Configuration

Modify network into LEDE Network – Interface – Edit LAN:

  • Add IPv4 gateway as router address,
  • Add DNS server in “Advanced Settings”, for example:
 1 2 3 
 1.1.1.1 8.8.8.8 144.144.144.144
  • Check “Ignore this interface” in “DHCP Server”

Then “Save”, then “Save and Apply”

OpenClash

The OpenWrt firmware I recommended above has integrated OpenClash, so you can find OpenClash in the installed OpenWrt service.

Digression: OpenWrt firmware is very important. I used a simple version of the firmware at first, in which I had to install OpenClash myself, and then there were various problems. OpenClash’s firmware saves time.

Confirm version

First go to the “Global Settings” – “Version Update” page to confirm the configuration and see if there is a red one. It is best to make sure that all prompts are green.

Configure Clash Profile

OpenClash has two ways to configure Clash configuration files, one is “configuration file subscription”, the other is “configuration file management”. Whatever is convenient for you, you can.

After the configuration is complete, click “Apply Configuration” and you are done.

Configure OpenClash

Open the “Global Configuration” of OpenClash, and configure the mode first. I chose “Fake-IP (Enhanced) Mode”. After the configuration is complete, click “Apply Configuration” and that’s it.

“Basic configuration” I basically did not change.

“DNS Settings” as above. Nothing else has changed.

how to use

The default home page of OpenClash is the “Running Status” page, which is very convenient to see the current status. There are two ways to use OpenClash:

Manual mode [recommended]

This method is recommended. It is more convenient and reliable to do it manually. The network situation at home is more complicated. This mode is convenient.

This mode is to manually configure the device that you need to go through the proxy, usually in the Wi-Fi configuration, change the gateway and DNS of the device to the address of the soft route, and then you can.

automatic mode

This is to open the DHCP server of the soft route, check the mandatory function, and then close the DHCP of the router, so that all devices can go through the proxy. This method is relatively simple and rude, but sometimes there are some problems. . Let’s say I have a problem with a few services on the NAS.

In addition, after I use this method, the mobile app can access the Internet, but the browser cannot. I don’t know why.

at last

That’s all for this tutorial. Recording these is to let everyone step on some pits and save time. I hope it will be useful to you.

refer to

This article is reprinted from: https://blog.forecho.com/use-openclash.html
This site is for inclusion only, and the copyright belongs to the original author.