|
|
|
@ -12,96 +12,108 @@
|
|
|
|
|
#### Rule Providers 配置方式
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
rule-providers:
|
|
|
|
|
reject:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
|
|
|
|
|
path: ./ruleset/reject.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
icloud:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt"
|
|
|
|
|
path: ./ruleset/icloud.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
apple:
|
|
|
|
|
Myrejetct:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt"
|
|
|
|
|
path: ./ruleset/apple.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
google:
|
|
|
|
|
url: https://anti-ad.net/clash.yaml
|
|
|
|
|
path: ./ruleset/Myrejetct.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
cncidr:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/google.txt"
|
|
|
|
|
path: ./ruleset/google.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
behavior: ipcidr
|
|
|
|
|
url: https://raw.githubusercontent.com/DH-Teams/DH-Geo_AS_IP_CN/main/Geo_AS_IP_CN_All_Clash.yaml
|
|
|
|
|
path: ./ruleset/cncidr.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
|
|
|
|
|
proxy:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt"
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/proxy.txt
|
|
|
|
|
path: ./ruleset/proxy.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
interval: 259200
|
|
|
|
|
direct:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt"
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/direct.txt
|
|
|
|
|
path: ./ruleset/direct.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
interval: 259200
|
|
|
|
|
cfdomain:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt"
|
|
|
|
|
path: ./ruleset/private.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
gfw:
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/cf-domain.txt
|
|
|
|
|
path: ./ruleset/cfdomain.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
|
|
|
|
|
openai:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt"
|
|
|
|
|
path: ./ruleset/gfw.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/openai.txt
|
|
|
|
|
path: ./ruleset/openai.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
|
|
|
|
|
tld-not-cn:
|
|
|
|
|
lancidr:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt"
|
|
|
|
|
path: ./ruleset/tld-not-cn.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
behavior: ipcidr
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/master/Clash-Rule/lancidr.txt
|
|
|
|
|
path: ./ruleset/lancidr.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
telegramcidr:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: ipcidr
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt"
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/master/Clash-Rule/telegramcidr.txt
|
|
|
|
|
path: ./ruleset/telegramcidr.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
interval: 259200
|
|
|
|
|
|
|
|
|
|
cncidr:
|
|
|
|
|
DropIP:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: ipcidr
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt"
|
|
|
|
|
path: ./ruleset/cncidr.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/DropIP.txt
|
|
|
|
|
path: ./ruleset/DropIP.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
|
|
|
|
|
lancidr:
|
|
|
|
|
private:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/private.txt
|
|
|
|
|
path: ./ruleset/private.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
reject:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/Reject.txt
|
|
|
|
|
path: ./ruleset/reject.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
Cloudflare:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: ipcidr
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt"
|
|
|
|
|
path: ./ruleset/lancidr.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/Cloudflare.txt
|
|
|
|
|
path: ./ruleset/Cloudflare.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
Google:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: ipcidr
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/master/Clash-Rule/Google.txt
|
|
|
|
|
path: ./ruleset/Google.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
applications:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: classical
|
|
|
|
|
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt"
|
|
|
|
|
url: https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/applications.txt
|
|
|
|
|
path: ./ruleset/applications.yaml
|
|
|
|
|
interval: 259200
|
|
|
|
|
|
|
|
|
|
icloud:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/icloud.txt"
|
|
|
|
|
path: ./ruleset/icloud.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
|
|
|
|
|
apple:
|
|
|
|
|
type: http
|
|
|
|
|
behavior: domain
|
|
|
|
|
url: "https://raw.githubusercontent.com/kurdsvv/rules/refs/heads/master/Clash-Rule/apple.txt"
|
|
|
|
|
path: ./ruleset/apple.yaml
|
|
|
|
|
interval: 86400
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
@ -113,52 +125,23 @@ rule-providers:
|
|
|
|
|
- 如你不希望进行 DNS 解析,可在 `GEOIP` 规则的最后加上 `,no-resolve`,如 `GEOIP,CN,DIRECT,no-resolve`。
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
rules:
|
|
|
|
|
- RULE-SET,applications,DIRECT
|
|
|
|
|
- DOMAIN,clash.razord.top,DIRECT
|
|
|
|
|
- DOMAIN,yacd.haishan.me,DIRECT
|
|
|
|
|
- RULE-SET,private,DIRECT
|
|
|
|
|
- RULE-SET,DropIP,REJECT-DROP
|
|
|
|
|
- RULE-SET,reject,REJECT
|
|
|
|
|
- RULE-SET,applications,REJECT
|
|
|
|
|
#- RULE-SET,Myrejetct,REJECT
|
|
|
|
|
- RULE-SET,proxy,🚀 节点选择
|
|
|
|
|
- RULE-SET,private,♻️ 自动选择
|
|
|
|
|
- RULE-SET,openai,♻️ 自动选择
|
|
|
|
|
- RULE-SET,telegramcidr,🌈 Telegram
|
|
|
|
|
- RULE-SET,direct,DIRECT
|
|
|
|
|
- RULE-SET,cncidr,DIRECT
|
|
|
|
|
- RULE-SET,icloud,DIRECT
|
|
|
|
|
- RULE-SET,apple,DIRECT
|
|
|
|
|
- RULE-SET,google,PROXY
|
|
|
|
|
- RULE-SET,proxy,PROXY
|
|
|
|
|
- RULE-SET,direct,DIRECT
|
|
|
|
|
- RULE-SET,Google,🚀 节点选择
|
|
|
|
|
- RULE-SET,Cloudflare,Cloudafare-conn
|
|
|
|
|
- RULE-SET,lancidr,DIRECT
|
|
|
|
|
- RULE-SET,cncidr,DIRECT
|
|
|
|
|
- RULE-SET,telegramcidr,PROXY
|
|
|
|
|
- GEOIP,LAN,DIRECT
|
|
|
|
|
- GEOIP,CN,DIRECT
|
|
|
|
|
- MATCH,PROXY
|
|
|
|
|
- MATCH,MATCH
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#### 黑名单模式 Rules 配置方式
|
|
|
|
|
|
|
|
|
|
- 黑名单模式,意为「**只有命中规则的网络流量,才使用代理**」,适用于服务器线路网络质量不稳定或不够快,或服务器流量紧缺的用户。通常也是软路由用户、家庭网关用户的常用模式。
|
|
|
|
|
- 以下配置中,除了 `DIRECT` 和 `REJECT` 是默认存在于 Clash 中的 policy(路由策略/流量处理策略),其余均为自定义 policy,对应配置文件中 `proxies` 或 `proxy-groups` 中的 `name`。如你直接使用下面的 `rules` 规则,则需要在 `proxies` 或 `proxy-groups` 中手动配置一个 `name` 为 `PROXY` 的 policy。
|
|
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
|
rules:
|
|
|
|
|
- RULE-SET,applications,DIRECT
|
|
|
|
|
- DOMAIN,clash.razord.top,DIRECT
|
|
|
|
|
- DOMAIN,yacd.haishan.me,DIRECT
|
|
|
|
|
- RULE-SET,private,DIRECT
|
|
|
|
|
- RULE-SET,reject,REJECT
|
|
|
|
|
- RULE-SET,tld-not-cn,PROXY
|
|
|
|
|
- RULE-SET,gfw,PROXY
|
|
|
|
|
- RULE-SET,telegramcidr,PROXY
|
|
|
|
|
- MATCH,DIRECT
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 致谢
|
|
|
|
|
|
|
|
|
|
- [@Loyalsoldier/geoip](https://github.com/Loyalsoldier/geoip)
|
|
|
|
|
- [@Loyalsoldier/v2ray-rules-dat](https://github.com/Loyalsoldier/v2ray-rules-dat)
|
|
|
|
|
- [@gfwlist/gfwlist](https://github.com/gfwlist/gfwlist)
|
|
|
|
|
- [@v2fly/domain-list-community](https://github.com/v2fly/domain-list-community)
|
|
|
|
|
- [@felixonmars/dnsmasq-china-list](https://github.com/felixonmars/dnsmasq-china-list)
|
|
|
|
|
- [@17mon/china_ip_list](https://github.com/17mon/china_ip_list)
|
|
|
|
|
|
|
|
|
|
## 项目 Star 数增长趋势
|
|
|
|
|
|
|
|
|
|
[](https://starchart.cc/Loyalsoldier/clash-rules)
|
|
|
|
|