This repository is a tutorial that shares how to configure Clash for the Olares system.
guide.mp4
You can remotely connect to the Olares host via SSH command or access it through the control panel.
Ensure your device and the Olares host are on the same local network, then use the following command to connect:
ssh hostname@host_IP
# For example: ssh olares@192.168.x.x
Enter the password when prompted to access remotely.
Open the control panel in Olares, click on Terminal > Olares in the left panel.
- Execute the following command to download the tool:
wget https://github.com/BBBigDan/Clash-tutorial-for-Olares/releases/download/v0.1.0/clash-setup-linux-amd64 - Add execution permission to clash-setup-linux-amd64:
chmod +x clash-setup-linux-amd64
Execute the following command to install:
./clash-setup-linux-amd64 install
When connecting via SSH, add sudo before the command:
sudo ./clash-setup-linux-amd64 install
After successful installation, the command line will prompt you to select a node configuration method:
Example using protocol link (URL) import:
- Select configuration method 2:
Please select configuration method (1/2/3): 2 - Enter the proxy URL:
Please enter proxy URL: vmess://
The result will look like:
- Select a default proxy based on available proxies:
Please select default proxy (enter number): 1
The result will look like:
-
Use the following command to check service status:
./clash-setup-linux-amd64 statusWhen connecting via SSH, add sudo before the command:
sudo ./clash-setup-linux-amd64 statusCheck the status - "running" means success, other statuses indicate failure.
Press q to exit if there's an error status.
-
Check if you can access the internet:
curl https://www.google.comIf a webpage is returned, the service is working properly.
To manage nodes, execute the following command:
./clash-setup-linux-amd64 proxy
When connecting via SSH, add sudo before the command:
sudo ./clash-setup-linux-amd64 proxy
Follow the prompts to complete the corresponding operations.
First, we need to install Clash on the device. Since we want to enable TUN mode, we will choose clash-premium. Use the clash-premium-installer, which is an installer for clash-premium. This installer also requires clash-core to function, and you can use the backup repository Kuingsmile/clash-core (the original author of Clash has unfortunately left ヽ( ຶ▮ ຶ)ノ!!!).
-
Make sure to choose the premium version of clash-core, premium version, premium version (important things should be repeated three times).
-
Modify the script
installer.shin clash-premium-installer. Change the github repo address fromDreamacro/clashtoKuingsmile/clash-coresed -i 's/Dreamacro\/clash/Kuingsmile\/clash-core/g' installer.sh -
Modify the script
scripts/setup-tun.sh, add two rules to the nftable configuration.... chain local-dns-redirect { type nat hook output priority 0; policy accept; ip protocol != { tcp, udp } accept meta cgroup $BYPASS_CGROUP_CLASSID accept ip daddr 127.0.0.0/8 accept ip daddr 10.0.0.0/8 accept udp dport 53 dnat $FORWARD_DNS_REDIRECT tcp dport 53 dnat $FORWARD_DNS_REDIRECT } ... chain forward-dns-redirect { type nat hook prerouting priority 0; policy accept; ip protocol != { tcp, udp } accept ip daddr 10.0.0.0/8 accept udp dport 53 dnat $FORWARD_DNS_REDIRECT tcp dport 53 dnat $FORWARD_DNS_REDIRECT } ... -
Now you can install the premium version clash
./installer.sh install -
The default path for the configuration file is /srv/clash/config.yaml.
-
The Country.mmdb file will be automatically downloaded when Clash starts, but it may not download successfully (you know the reason; otherwise, why would you need a VPN? Sigh, what a strange dependency—starting a VPN requires having a working VPN ヽ( ຶ▮ ຶ)ノ!!!). In such cases, you'll need to manually download Country.mmdb and copy it to the corresponding directory. You can find the download link in the logs after Clash starts, and the storage directory can also be found in the logs. If you can't find it, the default paths are
~/.config/clash/Country.mmdbor/root/.config/clash/Country.mmdb. -
Enabling TUN mode may require configuring the
/etc/systemd/resolved.conffile, which should look something like this 👇DNS=127.0.0.1 FallbackDNS=114.114.114.114 DNSStubListener=no






