Clash Minimalist Routing Rules Configuration
This article provides an optimized Clash basic configuration file template, including DNS pollution prevention settings, Fake-IP mode optimization, and basic routing rules. You can modify your node information based on this template.
Configuration File Template
yaml
mixed-port: 7890
socks-port: 7891
redir-port: 7892
allow-lan: true
mode: global
log-level: info
external-controller: 127.0.0.1:9090
dns:
enable: true
use-hosts: true
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
default-nameserver:
- 1.1.1.1
- 8.8.8.8
nameserver:
- 1.1.1.1
- 8.8.8.8
fake-ip-filter:
- "*.lan"
- stun.*.*.*
- stun.*.*
- time.windows.com
- time.nist.gov
- time.apple.com
- time.asia.apple.com
- "*.openwrt.pool.ntp.org"
- pool.ntp.org
- ntp.ubuntu.com
- time1.apple.com
- time2.apple.com
- time3.apple.com
- time4.apple.com
- time5.apple.com
- time6.apple.com
- time7.apple.com
- time1.google.com
- time2.google.com
- time3.google.com
- time4.google.com
- api.joox.com
- joox.com
- "*.xiami.com"
- "*.msftconnecttest.com"
- "*.msftncsi.com"
- "+.xboxlive.com"
- "*.*.stun.playstation.net"
- xbox.*.*.microsoft.com
- "*.ipv6.microsoft.com"
- speedtest.cros.wr.pvp.net
proxies: # LEAVE THIS LINE!
proxy-groups:
- name: 🚀 Proxy Selection
type: select
include-all: true
proxies:
- ♻️ Auto Select
- name: ♻️ Auto Select
type: url-test
include-all: true
exclude-filter: (?i)GB|Traffic|Expire|Premium|Channel|Subscription|ISP|Traffic|Expire|Reset|User|Official
url: https://www.gstatic.com/generate_204
interval: 300
tolerance: 60
rules:
- GEOSITE,private,DIRECT
- GEOSITE,category-ir,DIRECT
- GEOSITE,cn,DIRECT
- GEOSITE,category-ru,DIRECT
- GEOIP,private,DIRECT,no-resolve
- GEOIP,ir,DIRECT,no-resolve
- GEOIP,cn,DIRECT,no-resolve
- GEOIP,ru,DIRECT,no-resolve
- MATCH,🚀 Proxy SelectionUsage Instructions
- Add Nodes: The
proxiesin this configuration file is empty (marked as# LEAVE THIS LINE!). You need to manually fill in theproxiesnode information, or use it with clients that supportinclude-allor even Providers. - Proxy Groups:
🚀 Proxy Selection: Main selection group, manually select a node or select "Auto Select".♻️ Auto Select: Automatically selects the node with the lowest latency (URL-Test), filtering out non-node items like expiry dates/traffic info.
- Rules:
- Uses
GEOSITEandGEOIPrulesets (requires standard rule library files). private/cn(China) /ir/rugo DIRECT (bypass proxy).- Others match
🚀 Proxy Selection(go through proxy).
- Uses
Note: This configuration relies on the client downloading
geoip.datandgeosite.datfiles correctly. If the launch fails, please check the log to see if the database files are missing.
