banner
Shemol

Shemol

我好想伸出手,拥抱这个世界
pleroma
x
telegram
github

Configuring Clash on Ubuntu (Zorin)

Some files in the article are recommended to be downloaded in advance, otherwise they may not be downloaded due to network issues. It is recommended to read the full text first.

Reference article: http://jemlab.cn/?p=141

Download Clash and Configure#

  • Use the following command to download the latest version of Clash (Note: Currently, this GitHub repository has been deleted, so it is not possible to obtain it in this way. Please find another method)
wget https://github.com/Dreamacro/clash/releases/download/v1.18.0/clash-linux-amd64-v1.17.0.gz

Usually, when switching to a new system, you need to reconfigure these things. So it is recommended to download them in advance and store them on a USB drive or somewhere else, otherwise you can only rely on luck when downloading from GitHub later.

  • Enter the directory where the file is located and unzip it
gunzip clash-linux-amd64-v1.18.0.gz
  • Rename the clash-linux-amd64-v1.18.0 file to clash
mv clash-linux-amd64-v1.18.0 clash
  • Create a folder in this directory (note that using uppercase Clash here is just to distinguish it from clash)
mkdir Clash
  • Move the clash file to the Clash folder
mv clash ./Clash
  • Enter the Clash folder
cd Clash
  • Download the clash configuration file config.yaml (Note: this subscription link is your own, replace [subscription link], if it fails, it means there is a problem with the subscription link)
wget -O config.yaml [subscription link]

Note: If step 7 fails, it doesn't matter, just skip this step, it will be automatically downloaded later. You can also download it from the website Country.mmdb.
Note: It is also recommended to download it in advance, otherwise it may not be downloaded successfully due to network issues later.

  • Start Clash
chmod +x clash
./clash -d .
  • Open system settings, click on Network, find System Proxy, and select Manual

HTTP Proxy: 127.0.0.1:7890
HTTPS Proxy: 127.0.0.1:7890
SOCKS Proxy: 127.0.0.1:7891

This will start the system proxy
clash

  • Visit http://clash.razord.top/. It is recommended to select Rule as the proxy mode
    I remember that there is no need to enter HOST, port, and key. Just click Save and OK. You can switch nodes directly on the panel.

Configure Auto-Start on Boot#

Some may require administrator privileges, I can't remember. If Permission denied appears, add sudo before it.

  • Create the service file
touch /etc/systemd/system/clash.service
  • Edit the service file
vim /etc/systemd/system/clash.service
  • Edit the following text (search for how to use vim by yourself)
Description=clash daemon 
[Service] 
Type=simple 
User=root 
ExecStart=/home/username/Downloads/Clash/clash -d /home/username/Downloads/Clash/ Restart=on-failure 
[Install] 
WantedBy=multi-user.target

In ExecStart, the address is the specific location of clash, modify it according to your own Clash folder.

  • Set the startup option for Clash, check the status, after the service starts successfully, set the proxy protocol type and port for your own client based on the information (enter them one by one)
sudo systemctl daemon-reload 
sudo systemctl enable clash 
sudo systemctl start clash 
sudo systemctl status clash
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.