Clash Configuration Reference

Provider layout, global settings, TUN, DNS, proxy groups, rules, and subscription validation are separated into technical sections. The purpose is structural reference, field interpretation, and configuration-side review rather than direct copy-and-run use.

Structure and scope

Configuration work in Clash is mainly a matter of structure rather than volume. Providers, global fields, TUN behavior, DNS mode, proxy groups, and rules each serve a different layer of the routing model. A stable configuration usually depends less on adding more entries and more on keeping naming, grouping, update rhythm, and rule order understandable over time.

Multi-provider setups are useful when node sources, update schedules, or route priorities differ, but they also increase maintenance complexity. Prefixes, provider paths, group layout, and rule priorities should therefore be treated as organization tools rather than decorative additions. DNS and TUN settings require extra care because they affect traffic interception, system-level behavior, and platform-specific compatibility.

The examples on this page are intended as reference patterns. They are suitable for checking field relationships, reviewing structure, and understanding how sections connect, but they are not universal defaults for every environment. System version, platform behavior, provider quality, and routing goals still need to be considered before a configuration is adopted unchanged.

Provider layout

Provider definitions usually determine source separation, local cache paths, update intervals, and naming consistency. Prefixes are often the simplest way to keep merged subscriptions readable later.

proxy-providers:
  provider-a:
    type: http
    path: ./proxy_provider/provider-a.yaml
    url: https://example.com/provider-a
    interval: 21600
    override:
      additional-prefix: "A |"
  provider-b:
    type: http
    path: ./proxy_provider/provider-b.yaml
    url: https://example.com/provider-b
    interval: 21600
    override:
      additional-prefix: "B |"
  • Prefixes help separate merged sources when nodes are filtered or grouped later.
  • Update intervals should match provider maintenance behavior rather than arbitrary refresh frequency.
Example group icon used to distinguish proxy groups in the Clash interface
Group icons can make large configurations easier to scan and maintain.
icon: https://cdn.example.com/icons/group.svg

Global settings

mixed-port: 7897
allow-lan: true
mode: rule
global-ua: clash-verge/v2.2.3
geodata-mode: true
geodata-loader: standard
unified-delay: true
log-level: warning
ipv6: true
external-controller: 127.0.0.1:9090
tcp-concurrent: true
enable-process: true
find-process-mode: strict
global-client-fingerprint: chrome
keep-alive-interval: 15
geo-auto-update: true
geo-update-interval: 24
geox-url:
  geoip: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
  geosite: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"
  mmdb: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/country.mmdb"
  asn: "https://cdn.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/GeoLite2-ASN.mmdb"
profile:
  store-selected: true
  store-fake-ip: true

TUN settings

tun:
  enable: false
  device: ClashVergeREV
  stack: mixed
  mtu: 1500
  dns-hijack:
    - "any:53"
    - "tcp://any:53"
  auto-route: true
  auto-detect-interface: true
  • TUN is more relevant when traffic must be captured outside normal system proxy behavior.
  • Firewall, security software, permissions, and service state should be checked before treating TUN issues as rule problems.

DNS configuration

dns:
  enable: true
  ipv6: true
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  use-hosts: true
  nameserver:
    - https://doh.pub/dns-query
    - https://dns.alidns.com/dns-query
    - 114.114.114.114
    - system
  fake-ip-filter:
    - "*"
    - "+.lan"
    - "connect.rom.miui.com"
    - "+.miwifi.com"
    - "+.ntp.org"
    - "+.u-tools.cn"
    - "+.mediatek.com"
    - "+.cfprefer1.xyz"
    - "+.wetab.link"
    - "+.tyasaka.xyz"
    - "localhost.ptlogin2.qq.com"
    - "localhost.sec.qq.com"
    - "localhost.work.weixin.qq.com"
    - "+.weixin.qq.com"
    - "+.wechat.com"
    - "time.windows.com"
    - "+.msftconnecttest.com"
    - "+.msftncsi.com"
    - "+.wpsmail.net"
    - "+.henzanapp.com"
    - "+.pconline.com.cn"

Proxy groups and rules

proxy-groups:
  - name: Manual Select
    type: select
    proxies: [DIRECT,Auto Select]
    url: "https://www.gstatic.com/generate_204"
    interval: 300
    max-failed-times: 5
    include-all: true
  - name: Auto Select
    type: url-test
    proxies: [DIRECT]
    url: "https://www.gstatic.com/generate_204"
    interval: 300
    max-failed-times: 5
    include-all: true
rules:
  - GEOSITE,CN,DIRECT
  - GEOIP,CN,DIRECT
  - MATCH,Manual Select
Example icon assigned to proxy groups for faster visual identification
Icons, naming, and group structure affect readability and maintenance quality.
  • Manual groups are useful as fallback or for temporary control.
  • Automatic groups depend on the probe target, interval, and node health assumptions behind them.

Validation methods

PowerShell
$sub='paste subscription url in single quotes'
Invoke-RestMethod -UserAgent 'clash-verge/v2.4.0' -Method get -FollowRelLink -uri $sub
curl
curl -A clash-verge/v2.4.0 'paste-subscription-url'

Usage notes

  • Prefixes, naming, and provider separation often improve long-term maintenance more than adding more groups.
  • Rule quality depends on order, scope, and group behavior rather than rule count alone.
  • YAML errors usually come from indentation, quoting, or list structure.
  • TUN and DNS changes should be evaluated together with platform behavior, not in isolation.
  • Bandwidth-sensitive workloads and latency-sensitive workloads should not be judged by the same metric.
  • Configuration stability depends on how easily the layout can be reviewed and updated later.