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

Practical V2Ray Routing Strategies: A Guide to Fine-Grained Traffic Splitting by Domain and IP
This article delves into the core principles and configuration methods of V2Ray routing strategies, focusing on how to achieve fine-grained traffic splitting based on domain names and IP addresses to optimize network performance, improve access speed, and ensure critical traffic takes the optimal path.
Read more
Enterprise VPN Performance Benchmarking: How to Quantify and Evaluate Connection Speed and Stability
This article provides a comprehensive guide to VPN performance benchmarking for enterprise IT managers. It details the key metrics, testing methodologies, tool selection, and result interpretation for quantifying connection speed and stability, aiming to help businesses establish a scientific evaluation framework and optimize network investments and user experience.
Read more
VPN Speed Testing in Cross-Border Scenarios: Deep Analysis of Latency, Throughput, and Stability
This article provides an in-depth analysis of key VPN speed testing metrics in cross-border scenarios: latency, throughput, and stability, covering testing methods, influencing factors, and optimization strategies to help users accurately evaluate VPN performance.
Read more
Deep Dive into VPN Split Tunneling: From Policy Routing to Application-Level Intelligent Scheduling
This article provides an in-depth analysis of VPN split tunneling, covering policy routing, application-level splitting, and intelligent scheduling to optimize network performance and security.
Read more
Multipath VPN Aggregation: Technical Solutions for Enhancing Cross-Border Connection Stability
This article delves into multipath VPN aggregation technology, which leverages multiple network links (e.g., broadband, 4G/5G) simultaneously to significantly enhance the stability and throughput of cross-border VPN connections. It analyzes core principles, key implementation techniques (including load balancing, dynamic failover, packet duplication and deduplication), and practical deployment challenges and optimization strategies, offering enterprise-grade users a highly reliable cross-border networking solution.
Read more
Optimizing VMess Connection Stability: A Guide to Multiplexing, Load Balancing, and Timeout Configuration
This article delves into optimizing VMess connection stability through multiplexing, load balancing, and timeout configuration, offering practical examples and best practices to reduce latency, increase throughput, and prevent disconnections.
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