Mastering Clash: A Comprehensive Guide to Subscription Setup, Proxy Groups, and Rule Management

2/20/2026 · 3 min

1. Subscription Setup: Streamlining Proxy Access

Clash automates proxy node retrieval via subscription links, simplifying initial configuration. Users can define proxies or leverage proxy-providers to fetch node lists from remote URLs.

1.1 Basic Subscription Configuration

  • Subscription URL: Specify the url parameter in proxy-providers, e.g., url: https://example.com/sub.
  • Update Interval: Set interval for automatic refresh (in seconds); 86400 (24 hours) is recommended.
  • Health Check: Enable health-check to periodically test node availability, ensuring proxy quality.

1.2 Managing Multiple Subscriptions

Clash supports loading multiple subscription sources simultaneously. Use the path field to define local cache files, avoiding redundant downloads. Example:

proxy-providers:
  provider1:
    type: http
    url: "https://sub1.example.com"
    interval: 86400
    path: ./provider1.yaml
    health-check:
      enable: true
      url: http://www.gstatic.com/generate_204
      interval: 300

2. Proxy Groups: Intelligent Routing and Load Balancing

Proxy groups are the core of Clash, defining how nodes are selected for traffic. Common types include:

2.1 Key Proxy Group Types

  • url-test: Automatically selects the node with the lowest latency, ideal for speed-sensitive tasks.
  • fallback: Uses nodes by priority; switches to backup nodes when the primary fails.
  • load-balance: Distributes traffic across multiple nodes to improve overall throughput.
  • select: Allows manual node selection, offering maximum flexibility.

2.2 Proxy Group Configuration Example

proxy-groups:
  - name: "Auto"
    type: url-test
    proxies:
      - "HK-01"
      - "JP-01"
      - "US-01"
    url: "http://www.gstatic.com/generate_204"
    interval: 300

3. Rule Management: Granular Traffic Control

Rules determine how traffic is matched to proxies or direct connections. Clash supports multiple rule types, evaluated in order.

3.1 Rule Types and Priority

  • DOMAIN-SUFFIX: Matches domain suffixes, e.g., DOMAIN-SUFFIX,google.com,Proxy.
  • DOMAIN-KEYWORD: Matches domain keywords, e.g., DOMAIN-KEYWORD,ad,REJECT.
  • GEOIP: Matches based on IP geolocation, e.g., GEOIP,CN,DIRECT.
  • MATCH: Catch-all rule for unmatched traffic.

3.2 Rule Optimization Tips

  • Place frequently used direct rules (e.g., domestic sites) at the top to reduce proxy evaluation overhead.
  • Use RULE-SET to reference external rule files for easier maintenance.
  • Limit total rules to under 200 to avoid performance degradation.

4. Performance Optimization and Debugging

4.1 Memory and CPU Optimization

  • Enable sniff-tls-sni under experimental to improve TLS identification efficiency.
  • Adjust keep-alive-interval to reduce connection re-establishment overhead.

4.2 Logging and Debugging

  • Set log-level: info to view connection logs and troubleshoot rule matching.
  • Enable external-controller to access the RESTful API for real-time monitoring via a dashboard.

By properly configuring subscriptions, proxy groups, and rules, Clash can significantly enhance your network experience.

Related reading

Related articles

VLESS Deployment Guide: From Server Setup to Client Optimization
This article provides a step-by-step guide for deploying VLESS protocol, covering server installation, client configuration, performance optimization, and troubleshooting common issues.
Read more
Building Your Own VPN Node: From VPS Selection to WireGuard Deployment
This article provides a comprehensive guide to building your own VPN node, covering VPS selection, OS choice, WireGuard deployment, and configuration optimization for a secure and high-performance private VPN service.
Read more
VPN Packet Loss Deep Dive: Causes, Diagnosis, and Optimization Strategies
This article provides an in-depth analysis of the root causes of VPN packet loss, including network congestion, protocol overhead, server performance, and misconfiguration. It offers systematic diagnostic methods and optimization strategies to help users effectively reduce packet loss and improve VPN connection stability and transmission efficiency.
Read more
Gaming Acceleration and Privacy Protection: A Practical Guide to VPNs on Steam and Consoles in 2026
In 2026, gamers face challenges like lag, DDoS attacks, and geo-restrictions. This article provides an in-depth analysis of how VPNs can simultaneously achieve gaming acceleration and privacy protection, covering best practices for Steam, PlayStation, and Xbox, protocol selection, and configuration tips.
Read more
Deep Dive into VPN Split Routing: Practical Configuration of Geo-Rules Based on Domain and IP
This article provides an in-depth analysis of VPN split routing strategies, focusing on practical configuration of geo-rules based on domain and IP, including rule principles, configuration steps, and optimization tips for efficient and precise traffic splitting.
Read more
VPN Speed Test Guide: Interpreting Metrics from Theory to Practice
This article systematically explains key VPN speed test metrics including latency, throughput, jitter, and packet loss, offering practical testing methods and optimization tips for accurate performance evaluation.
Read more

FAQ

How do I update subscription nodes in Clash?
Set the `interval` parameter in `proxy-providers` within the config file, or restart Clash to trigger an update. Some dashboards also offer a manual refresh button.
What is the difference between url-test and fallback in proxy groups?
url-test continuously tests all nodes' latency and selects the fastest; fallback uses nodes in a fixed priority order and switches only when the primary node is unavailable.
Does rule matching order affect performance?
Yes. Place frequently matched rules (e.g., direct connections for domestic sites) at the top to reduce traversal and improve matching efficiency.
Read more