Open-source project
Aethersailor/Custom_OpenClash_Rules avatar
Aethersailor/Custom_OpenClash_Rules

Custom_OpenClash_Rules: Configuration Templates and Rule Files for OpenClash on OpenWrt

面向 OpenClash 用户的配置、订阅转换模板、YAML、规则、覆写模块、脚本与中文教程。

6,567 stars1,398 forksShellCC-BY-SA-4.0

At a glance

What is it?
Custom_OpenClash_Rules is a repository of subscription conversion templates, YAML configs, rule files, overwrite modules, and shell scripts built specifically for OpenClash running on OpenWrt. It covers the full configuration workflow in a single plugin, with a project Wiki providing the reasoning behind each setting.
Who is it for?
Custom_OpenClash_Rules is the right tool for OpenWrt users running OpenClash who want a documented, community-maintained configuration framework with three deployment paths and no dependency on additional proxy plugins. It is not designed for other Clash clients, other operating systems, or users who need individual configuration support.
Can I use it commercially?
Yes, with credit. CC-BY-SA-4.0 allows commercial use as long as you credit the authors and indicate what you changed. It is written for creative content, so check how it applies to any code.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Shell, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What This Repository Is and Who It Serves

Custom_OpenClash_Rules is maintained as a companion resource for OpenClash, the Clash-based proxy plugin for OpenWrt routers. The README describes the repository as covering configuration scheme documentation, subscription conversion templates, YAML configuration files, rule files, remote overwrite modules, and auxiliary shell scripts. The project scope is explicitly limited to OpenWrt with OpenClash; the README states it does not provide support for other clients or operating systems.

The target user is someone who already has OpenWrt running on a router and wants a structured, documented way to configure OpenClash rather than assembling settings from scattered sources. The README emphasizes a key design principle: all configuration paths in this project require only one plugin, OpenClash, with no need to stack additional proxy or DNS plugins alongside it.

Repository Structure and the Five Resource Types

The repository is divided into five functional areas. cfg/ holds the subscription conversion templates and YAML configuration files, which are the primary way most users interact with the project. rule/ contains the supplementary and corrective rule files maintained by the project, organized as .list source files from which a GitHub Actions workflow generates Classical YAML, Domain YAML, IP-CIDR YAML, and MRS derivative files. overwrite/ stores single-function remote overwrite modules. shell/ provides installation, update, and CPU architecture detection scripts for OpenClash. The script/sub-store/ directory contains Sub-Store extension scripts that operate independently of the OpenClash configuration flow.

The root README is explicitly a navigation page. Detailed documentation for each resource, including version differences, parameters, and usage steps, lives in the README.md file of the corresponding subdirectory.

Three Ways to Deploy the Configuration

The README describes three complete paths for using the project's configuration:

First, subscription conversion: provide an existing subscription URL to an online or self-hosted conversion endpoint along with one of the project's eight template files. The conversion backend generates a complete OpenClash-ready YAML. The OpenClash dev branch already includes all eight templates as built-in options; older versions can use the remote template address listed in cfg/.

Second, remote YAML overwrite: configure OpenClash to use one of the project's remote overwrite modules from overwrite/yaml/. The module automatically fetches the corresponding YAML, writes it into the subscription, and switches the configuration, handling updates without manual file management.

Third, manual YAML import: download a YAML file from cfg/yaml/, make any necessary local modifications, and import it directly into OpenClash. This path provides the most control but requires manual updates when the configuration changes.

The README notes that the three paths follow the same underlying configuration design and should produce consistent strategy group behavior and routing logic when the same version is used without local modifications.

Rule Files, Game Rules, and the Contribution Process

The rule/ directory contains the project's own supplementary rule lists, covering custom direct-connection domains, proxy domains, Steam CDN, game download CDN, and encrypted DNS. Each .list file is the authoritative source; derivative formats are generated automatically by the workflow.

Contributions to the direct-connection rule list follow a structured process. Individual domain queries and small submissions can go through a public Telegram Rule-Bot instance. Continuous collection of unmatched domains (those falling through to the MATCH rule in Mihomo) uses a Rule-Bot Client that connects to the public bot. Larger batches of verified domains go through a pull request against rule/Custom_Direct.list directly. The README asks contributors to search existing rules, issues, and pull requests before submitting and to provide verifiable evidence.

The rule/game_rule/ subdirectory holds independently maintained game-specific rules. The workflow generates YAML and MRS files from these lists but does not load them into the main configuration automatically. Users should verify the applicable region and the update timestamp before using a game rule.

DNS Leak Prevention: What the Project Covers and What It Does Not

The README includes an explicit warning about DNS leak prevention. The project's configuration can avoid local DNS leaks when three conditions are simultaneously met: Fake-IP mode is active, traffic takeover is in effect, and DNS settings are applied according to the Wiki. The README states that this must be verified with an external detection tool; completing the configuration does not by itself confirm a leak-free result.

Several situations fall outside the project's control: a client device using private DNS or DNS-over-HTTPS independently, a device or flow that is not being intercepted by OpenClash, behavior by the plugin or firmware that differs from the Wiki's description, or manual overrides to the DNS configuration. These cases require separate handling. The README treats these as boundaries of the configuration scheme, not as bugs.

Shell Scripts and Installation Tooling

The shell/ directory provides scripts for installing OpenClash, updating it, and detecting the CPU architecture of the host device. The scripts support both OpenWrt and ImmortalWrt, and they handle both the OPKG and APK package managers. The README notes that these scripts may involve temporarily switching software sources, reinstalling the plugin over an existing copy, applying UCI settings, and triggering OpenClash's internal update process.

The Sub-Store extension scripts in script/sub-store/ extend Sub-Store's subscription processing capabilities. They are not part of the OpenClash installation flow and are not automatically loaded by any project configuration. Each is a standalone addition for users who already run Sub-Store alongside their setup.

Alternative: OpenClash's Built-In Templates and the LoyalSoldier Rule Set

For users who want a simpler starting point, OpenClash itself ships built-in subscription conversion templates in its dev branch, some of which are taken directly from this repository. Those built-in templates cover the common use cases without requiring any interaction with an external repository.

For users who want Clash or Mihomo rule files independent of OpenClash and OpenWrt, LoyalSoldier/clash-rules provides a set of Clash-format YAML rule providers generated from multiple upstream sources on a schedule, designed to be fetched directly as rule-provider URLs in a Clash config. The difference is that LoyalSoldier's repository is purely a rule data source with no configuration framework, Wiki, or installation scripts. Custom_OpenClash_Rules, by contrast, wraps rule data inside a complete documented configuration methodology that assumes the OpenClash and OpenWrt context throughout.

The last push was on 2026-09-27. The repository is released under CC-BY-SA-4.0, which requires attribution and that derivative works use the same license.

Editorial conclusion

Custom_OpenClash_Rules is the right tool for OpenWrt users running OpenClash who want a documented, community-maintained configuration framework with three deployment paths and no dependency on additional proxy plugins. It is not designed for other Clash clients, other operating systems, or users who need individual configuration support. Before deploying, read the DNS leak section in the Wiki and verify the actual result with an external check tool, since the README explicitly states that completing the configuration is not itself proof of a leak-free setup.

Frequently asked questions

What is the difference between the subscription conversion path, the remote YAML overwrite path, and the manual YAML import path?

Subscription conversion generates a complete OpenClash config from an existing subscription URL using a template. Remote YAML overwrite uses an overwrite module to automatically fetch and apply a YAML config inside OpenClash. Manual YAML import downloads the file directly and requires the user to import it and manage updates by hand. All three paths use the same underlying configuration design.

Does this project's configuration guarantee no DNS leaks?

No. The README explicitly states that a leak-free result requires Fake-IP mode, traffic takeover, and correct DNS settings all active simultaneously, and that the actual result must be verified with an external detection tool. Devices using private DNS independently, unintercepted traffic flows, or manual DNS overrides fall outside what the configuration controls.

Can these rule files and templates be used with Clash clients other than OpenClash?

The project is scoped to OpenWrt and OpenClash. The README does not provide support for other Clash clients or operating systems. The rule .list files can technically be referenced by other Clash-compatible clients, but configuration guidance outside the OpenClash context is outside the project's stated scope.

Official sources

  1. Aethersailor/Custom_OpenClash_Rules on GitHub
  2. Issues
  3. License: CC-BY-SA-4.0
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/aethersailor-custom-openclash-rules.svg)](https://hysenlabs.com/projects/aethersailor-custom-openclash-rules)