Rules, routing and overrides
This page answers "why did this site get proxied and that one did not": rules match in order and the first hit wins, while Override layers settings above the config without editing the file.
Three modes
Rule mode (default): walk the rules list in order, apply the policy on the first match, and fall back to MATCH.
Global mode: ignore rules entirely and send everything through the selected group or node. Useful for proving whether a rule is at fault.
Direct mode: the core idles and everything connects directly, while profiles and settings stay in place.
Rules match from the top
rules is an ordered list. For each connection the core takes the destination domain or IP, compares from the first entry, and the first match decides the route. Order therefore matters more than content: put DOMAIN-SUFFIX,google.com,PROXY after GEOIP,CN,DIRECT and it never fires.
The usual shape is specific domains first, geography and IP second, MATCH last:
DOMAINmatches exactly,DOMAIN-SUFFIXmatches the suffix, andDOMAIN-KEYWORDmatches anywhere — the easiest to over-match.IP-CIDRandGEOIPdepend on resolution, so they belong after domain rules.MATCHmust come last; it takes no condition.
rules:
- DOMAIN-SUFFIX,openai.com,PROXY
- DOMAIN-KEYWORD,github,PROXY
- GEOIP,CN,DIRECT
- MATCH,PROXY
Where rules come from
| Source | Lives in | How it updates |
|---|---|---|
| Rules shipped with the subscription | The profile yaml | Replaced when the subscription refreshes |
| rule-providers | External rule sets, fetched on demand | Update under Providers, or with the subscription |
| Client overrides | Local to CMFA, never in the yaml | Edited in Override, applied instantly, never overwritten |
| Local file | A yaml in device storage | Replace the file and reload |
Scroll the table sideways
A subscription refresh overwrites rules in the yaml but never touches overrides. Your own exceptions are safer there.
What Override really changes
Override is a pass of parameter replacement CMFA performs after loading the profile and before starting the core. It does not edit your yaml; it substitutes specific fields in memory: DNS, the TUN switch, access control, log level, sniffer, GeoX URLs and more.
The benefit is settings that survive a subscription change. The cost is that it is easy to forget: if the yaml says DIRECT and traffic still proxies, check Override first.
Back up before editing rules
Editing yaml by hand means one indentation mistake stops the whole profile loading, with yaml: line N: did not find expected key. Export a copy first so you can restore it.