OpenClash configuration, rule fragments, utilities, and override resources
English | 简体中文
📖 Project Wiki • 🧩 Configuration Resources • 🗂️ Rule Fragments
✨ A More Elegant Way to Use OpenClash ✨
Custom_OpenClash_Rules is a resource repository built around OpenClash.
It provides OpenClash configuration guidance, subscription-conversion templates, YAML examples, rule fragments, utility scripts, override resources, and related documentation to make OpenClash easier to deploy, maintain, and adjust.
The root README serves only as the project homepage and resource navigator. For individual files, their purposes, differences, and usage instructions, refer to the README in the corresponding directory or the project Wiki.
Note
The project Wiki is currently available in Chinese only.
| Need | Recommended entry |
|---|---|
| Configure or understand OpenClash for the first time | Project Wiki |
| Use subscription-conversion templates or YAML examples | cfg/ |
| Add rules to an existing configuration | rule/ |
| Use OpenClash-related utility scripts | shell/ |
| Use remote override resources | overwrite/ |
| Troubleshoot common problems | Troubleshooting |
The project Wiki is one of the repository's two core components. It provides a complete configuration approach for OpenWrt and OpenClash rather than merely listing individual settings. The documentation explains how related options interact, why they are configured, and what effects they may have, helping users deploy and maintain OpenClash with an understanding of the underlying design.
The guide follows the practical OpenClash workflow and focuses on:
- OpenClash fundamentals and transparent traffic routing: Establishes a complete usage framework around
Fake-IPmode, traffic interception, rule matching, and policy selection. - DNS strategy and leak-risk control: Explains the resolution paths used by direct and non-direct traffic, with the aim of reducing unnecessary DNS detours, resolution failures, and leak risks.
- Direct-access optimization: Uses features such as OpenClash's “Bypass Mainland China” option so that suitable domains and IP addresses can retain local resolution and direct access, reducing unnecessary processing of direct traffic by OpenClash.
- IPv6 configuration and compatibility: Provides an approach for configuring IPv6 in OpenWrt and OpenClash while preserving IPv6 connectivity and applying the intended routing policies.
- Troubleshooting and supplementary guides: Covers common problems such as OpenClash startup failures, network interruptions, unexpected traffic routing, and inaccessible websites, together with related notes and tutorials.
The overall approach is designed to rely primarily on OpenClash's own capabilities and avoid unnecessary stacks of DNS plugins. Most operations can be completed through the OpenClash LuCI interface. The Wiki can therefore serve both as a first-time setup guide and as a reference for later troubleshooting and configuration optimization.
Tip
New users should read the Wiki before selecting a configuration resource below. The Wiki explains why the settings are designed this way, while the configuration resources provide reusable implementations.
Entry: Project Wiki
The cfg/ directory is the repository's other core component. It converts the configuration approach described in the Wiki into reusable resources. The directory contains subscription-conversion templates, YAML configuration examples, and supporting documentation for users who want to generate an OpenClash configuration quickly or adapt an existing configuration.
Tip
The remote URL for this project's subscription conversion template is included in OpenClash's built-in template list, so you can select it directly without entering the URL manually.
These resources focus on:
- Subscription conversion and configuration generation: Organizes node subscriptions into structures suitable for OpenClash, reducing the need to write and maintain configurations manually.
- Policy designs with different levels of complexity: Provides configurations with different priorities, balancing policy-group coverage, ease of use, and maintenance cost.
- Routing for common services and applications: Organizes policy groups and rules for commonly used services, applications, and platforms while retaining room for further customization.
- Alignment with the Wiki's configuration approach: Designs the configurations around
Fake-IP, DNS strategy, direct access, and rule-based routing so they can be used together with the project Wiki. - Rule and data update capabilities: References upstream rules and GEO data to reduce the cost of manually maintaining time-sensitive datasets. Some configurations also apply differentiated handling to scenarios such as downloads and gaming platforms.
- YAML configuration references: Provides complete configuration-structure examples for understanding OpenClash configuration files and for use as a foundation when building or modifying a configuration.
The root README does not enumerate individual templates or configuration files. Refer to the README in cfg/ for each configuration's purpose, differences, usage links, and precautions.
Entry: cfg/
Rule fragments that can be added selectively to an existing configuration. General and game-related rules are treated as a single resource category; consult the directory documentation for their classification and usage.
Entry: rule/
Scripts related to OpenClash installation, updates, detection, and maintenance.
Entry: shell/
Resources and documentation for OpenClash remote overrides. This directory references an externally maintained project; consult its directory documentation and upstream repository for details.
Entry: overwrite/
This repository primarily targets OpenWrt and OpenClash environments. It does not provide general-purpose configuration support for other clients or operating systems.
The project is a collection of the maintainer's personal experience and technical materials. It does not provide customized configurations, bespoke development, or one-to-one technical support.
For a small number of direct-access domains, using OpenClash custom rules is recommended first.
Domains suitable for inclusion in this project may be submitted through GitHub Issues, Pull Requests, or COCR RULE BOT.
Note
Where appropriate, the maintainer may submit collected entries to relevant upstream rule projects.
Warning
Usage Notice:
- This project is intended solely for technical study and research concerning the OpenWrt operating system and its OpenClash plugin. Its content consists of neutral technical implementation examples and experimental materials and is not directed toward any specific use case or purpose.
- Before accessing, using, or copying any content from this project, users must independently confirm that doing so is permitted by the laws and regulations of their location and all relevant jurisdictions. The relevant content must be deleted within 24 hours after study and research.
- This project's content must not be used for any purpose that violates applicable laws or regulations. Users must independently comply with the laws and regulations of their location and all relevant jurisdictions, including those of the People's Republic of China. Within the territory of the People's Republic of China, this project's content must not be used to obtain or disseminate unlawful information from outside the country whose access or distribution is legally restricted or blocked, or to engage in similar conduct.
- This project neither provides nor concerns any equipment, software, tools, network connections, or services. The project maintainer does not produce, sell, or provide related equipment, software, tools, or technical services, nor does the maintainer provide technical support, assistance, or any other form of help to any individual or organization for obtaining or disseminating information whose access or distribution is legally restricted or blocked, or for circumventing regulatory systems.
- Any individual or organization is solely responsible for conduct arising from its direct or indirect use of this project's content and bears all corresponding legal liability. The project maintainer does not participate in users' specific conduct and assumes no responsibility for their purposes, methods, or resulting consequences, including joint and several liability of any kind.
- Any modification, secondary development, integration, distribution, or other derivative activity based on this project's content is the independent act of the relevant individual or organization and is unrelated to this project or its maintainer. Any resulting legal liability is borne solely by the party performing such activity.
- This project discourages any form of reproduction, republication, or secondary dissemination. Reproducing, republishing, or redistributing this project's content on any platform within mainland China is strictly prohibited.
- No reproduction, republication, or secondary dissemination may imply endorsement of the reproduced content by this project or its maintainer. Any legal risk arising from the reproduction, dissemination, or use of this project's content is borne solely by the party performing the relevant act and is unrelated to this project or its maintainer.
- The project maintainer reserves the right to revise or supplement this disclaimer at any time. Any individual or organization that uses, copies, or accesses this project's content is deemed to have read and accepted this disclaimer.
Note
- This project was created in April 2024 as a non-profit collection of technical research and practical experience.
- The content reflects only the maintainer's personal experience. It is intended for technical exchange, is not authoritative, and does not represent the only or officially recommended way to use OpenClash.
- This project does not operate any YouTube channel and has not published tutorials or instructional videos on YouTube or any other video platform.
- This project's content was not compiled or adapted from third-party tutorials or videos. Problems caused by tutorials, templates, or configuration files from other sources should not be reported in this project's Issues or Discussions.
- Accessible wording does not constitute a commitment to teach, guide, or support any particular group of users.
This project uses or references the following projects and resources, listed in no particular order:
- vernesong/OpenClash
- MetaCubeX/mihomo
- vernesong/mihomo
- ACL4SSR/ACL4SSR
- TraderWukong/demo
- Giveupmoon/OpenClash_Overwrite
- blackmatrix7/ios_rule_script
- v2fly/domain-list-community
- felixonmars/dnsmasq-china-list
- Loyalsoldier/v2ray-rules-dat
- dogfight360/UsbEAm
- ddgksf2013/ddgksf2013
- mottzz87/crules
- 217heidai/adblockfilters
- privacy-protection-tools/anti-AD
- TG-Twilight/AWAvenue-Ads-Rule
- hagezi/dns-blocklists
- Aethersailor/adblockfilters-modified
- 521xueweihan/GitHub520
- Aethersailor/SubConverter-Extended
- Aethersailor/subconverter
- Aethersailor/Rule-Bot
- oooldtoy/SSTAP_ip_crawl_tool
- immortalwrt/user-FAQ
