{"id":941,"date":"2026-06-20T18:20:01","date_gmt":"2026-06-20T10:20:01","guid":{"rendered":"https:\/\/www.suannai.link\/blog\/clash%e8%a7%84%e5%88%99%e9%9b%86%e9%85%8d%e7%bd%ae%ef%bc%9a%e4%bb%8e%e5%9f%ba%e7%a1%80%e8%af%ad%e6%b3%95%e5%88%b0%e9%ab%98%e7%ba%a7%e9%80%bb%e8%be%91%e5%a4%84%e7%90%86\/"},"modified":"2026-06-20T18:20:01","modified_gmt":"2026-06-20T10:20:01","slug":"clash%e8%a7%84%e5%88%99%e9%9b%86%e9%85%8d%e7%bd%ae%ef%bc%9a%e4%bb%8e%e5%9f%ba%e7%a1%80%e8%af%ad%e6%b3%95%e5%88%b0%e9%ab%98%e7%ba%a7%e9%80%bb%e8%be%91%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.suannai.link\/blog\/clash%e8%a7%84%e5%88%99%e9%9b%86%e9%85%8d%e7%bd%ae%ef%bc%9a%e4%bb%8e%e5%9f%ba%e7%a1%80%e8%af%ad%e6%b3%95%e5%88%b0%e9%ab%98%e7%ba%a7%e9%80%bb%e8%be%91%e5%a4%84%e7%90%86\/","title":{"rendered":"Clash\u89c4\u5219\u96c6\u914d\u7f6e\uff1a\u4ece\u57fa\u7840\u8bed\u6cd5\u5230\u9ad8\u7ea7\u903b\u8f91\u5904\u7406"},"content":{"rendered":"<p>Clash \u89c4\u5219\u96c6\uff08Rule Set\uff09\u662f\u5ba2\u6237\u7aef\u5b9e\u73b0\u6d41\u91cf\u5206\u6d41\u7684\u6838\u5fc3\u673a\u5236\uff0c\u5b83\u51b3\u5b9a\u4e86\u54ea\u4e9b\u6d41\u91cf\u8d70\u4ee3\u7406\u3001\u54ea\u4e9b\u6d41\u91cf\u76f4\u8fde\uff0c\u4ee5\u53ca\u5982\u4f55\u5904\u7406\u57df\u540d\u89e3\u6790\u3002\u8bb8\u591a\u7528\u6237\u5728\u4f7f\u7528 Clash \u6838\u5fc3\uff08\u5982 Clash.Meta\/Mihomo\uff09\u65f6\uff0c\u5e38\u9047\u5230\u89c4\u5219\u4e0d\u751f\u6548\u3001\u57df\u540d\u89e3\u6790\u9519\u8bef\uff08DNS \u6cc4\u6f0f\uff09\u6216\u89c4\u5219\u51b2\u7a81\u5bfc\u81f4\u8fde\u63a5\u5931\u8d25\u7684\u95ee\u9898\u3002<\/p>\n<p>\u672c\u6587\u9488\u5bf9\u201cClash\u89c4\u5219\u96c6\u914d\u7f6e\u201d\u8fd9\u4e00\u9700\u6c42\uff0c\u8be6\u7ec6\u62c6\u89e3 YAML \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u89c4\u5219\u96c6\u6a21\u5757\uff0c\u89e3\u91ca `payload`\u3001`type`\u3001`interval` \u7b49\u5173\u952e\u53c2\u6570\u7684\u4f5c\u7528\uff0c\u5e76\u63d0\u4f9b\u4e00\u5957\u53ef\u590d\u7528\u7684\u914d\u7f6e\u903b\u8f91\uff0c\u5e2e\u52a9\u4f60\u5efa\u7acb\u7a33\u5b9a\u3001\u9ad8\u6548\u7684\u5206\u6d41\u4f53\u7cfb\u3002<\/p>\n<h2>\u89c4\u5219\u96c6\u6a21\u5757\u7684\u6838\u5fc3\u53c2\u6570\u89e3\u6790<\/h2>\n<p>\u5728 Clash \u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c\u89c4\u5219\u96c6\u901a\u5e38\u5b9a\u4e49\u5728\u9876\u5c42\u7684 `rule-providers` \u5b57\u6bb5\u4e0b\u3002\u7406\u89e3\u8fd9\u4e9b\u53c2\u6570\u662f\u6b63\u786e\u914d\u7f6e\u7684\u524d\u63d0\u3002<\/p>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u53c2\u6570\u540d<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u7c7b\u578b<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u8bf4\u660e<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u914d\u7f6e\u5efa\u8bae<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`type`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">string<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u89c4\u5219\u96c6\u7684\u6765\u6e90\u7c7b\u578b\u3002\u5e38\u89c1\u503c\u5305\u62ec `http`\u3001`file`\u3001`inline`\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`http` \u7528\u4e8e\u8fdc\u7a0b\u8ba2\u9605\u66f4\u65b0\uff1b`file` \u7528\u4e8e\u672c\u5730\u6587\u4ef6\uff1b`inline` \u7528\u4e8e\u76f4\u63a5\u5199\u5165\u914d\u7f6e\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`path`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">string<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u89c4\u5219\u96c6\u5b58\u50a8\u7684\u6587\u4ef6\u8def\u5f84\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\uff08\u5982 `.\/rules\/xxx.yaml`\uff09\u6216\u7edd\u5bf9\u8def\u5f84\u3002\u82e5\u4e3a `http` \u7c7b\u578b\uff0c\u6b64\u8def\u5f84\u4e3a\u4e0b\u8f7d\u540e\u7684\u5b58\u50a8\u4f4d\u7f6e\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`url`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">string<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4ec5\u5f53 `type` \u4e3a `http` \u65f6\u5fc5\u586b\u3002\u63d0\u4f9b\u89c4\u5219\u7684\u8fdc\u7a0b URL\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u786e\u4fdd URL \u53ef\u516c\u5f00\u8bbf\u95ee\u4e14\u8fd4\u56de\u6807\u51c6\u7684 YAML \u683c\u5f0f\u6570\u636e\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`interval`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">int<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4ec5\u5f53 `type` \u4e3a `http` \u65f6\u5fc5\u586b\u3002\u81ea\u52a8\u66f4\u65b0\u7684\u65f6\u95f4\u95f4\u9694\uff08\u79d2\uff09\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u5efa\u8bae\u8bbe\u7f6e\u4e3a 3600 \u5230 86400 \u4e4b\u95f4\uff0c\u907f\u514d\u8fc7\u4e8e\u9891\u7e41\u8bf7\u6c42\u5bfc\u81f4\u88ab\u5c01\u6216\u670d\u52a1\u5668\u538b\u529b\u8fc7\u5927\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`behavior`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">string<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u89c4\u5219\u5339\u914d\u7684\u884c\u4e3a\u6a21\u5f0f\u3002\u5e38\u89c1\u503c\uff1a`classical`\u3001`ipcidr`\u3001`domain`\u3001`geosite`\u3001`geoip`\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`classical` \u4e3a\u7ecf\u5178\u6b63\u5219\/\u7cbe\u786e\u5339\u914d\uff1b`domain` \u7528\u4e8e\u57df\u540d\u5339\u914d\uff1b`geosite`\/`geoip` \u7528\u4e8e\u5730\u7406\u4f4d\u7f6e\u5339\u914d\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">`format`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">string<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4ec5\u5f53 `type` \u4e3a `http` \u65f6\u53ef\u9009\u3002\u6307\u5b9a\u4e0b\u8f7d\u5185\u5bb9\u7684\u683c\u5f0f\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u901a\u5e38\u4e3a `yaml` \u6216 `text`\u3002\u82e5\u8fdc\u7a0b\u6e90\u8fd4\u56de\u7684\u662f\u7eaf\u6587\u672c\u57df\u540d\u5217\u8868\uff0c\u9700\u8bbe\u4e3a `text`\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u4e3a\u4ec0\u4e48\u9700\u8981\u533a\u5206\u8fd9\u4e9b\u53c2\u6570\uff1f<\/strong><br \/>\u5982\u679c `type` \u914d\u7f6e\u9519\u8bef\uff0c\u5ba2\u6237\u7aef\u5c06\u65e0\u6cd5\u62c9\u53d6\u89c4\u5219\uff1b\u5982\u679c `interval` \u8bbe\u7f6e\u8fc7\u77ed\uff0c\u53ef\u80fd\u5bfc\u81f4\u8fdc\u7a0b\u6e90\u62d2\u7edd\u670d\u52a1\uff1b\u5982\u679c `behavior` \u4e0d\u5339\u914d\u89c4\u5219\u5185\u5bb9\u7684\u683c\u5f0f\uff08\u4f8b\u5982\u7528 `domain` \u53bb\u5339\u914d IP \u6bb5\uff09\uff0c\u89c4\u5219\u5c06\u5b8c\u5168\u5931\u6548\u3002<\/p>\n\n<h2>\u5982\u4f55\u7f16\u5199\u6b63\u786e\u7684\u89c4\u5219\u96c6\u6587\u4ef6<\/h2>\n<p>\u89c4\u5219\u96c6\u6587\u4ef6\u672c\u8eab\u4e5f\u662f\u4e00\u4e2a YAML \u6587\u4ef6\uff0c\u5176\u5185\u5bb9\u7ed3\u6784\u53d6\u51b3\u4e8e `behavior` \u53c2\u6570\u7684\u8bbe\u5b9a\u3002\u5e38\u89c1\u7684\u89c4\u5219\u96c6\u7c7b\u578b\u5305\u62ec\u57df\u540d\u96c6\u3001IP \u96c6\u548c\u5730\u7406\u4f4d\u7f6e\u96c6\u3002<\/p>\n<h3>1. \u57df\u540d\u89c4\u5219\u96c6\uff08Domain\uff09<\/h3>\n<p>\u57df\u540d\u89c4\u5219\u96c6\u7528\u4e8e\u5339\u914d\u4e3b\u673a\u540d\u3002\u5728 `behavior` \u4e3a `domain` \u6216 `classical` \u65f6\uff0c\u6587\u4ef6\u5185\u5bb9\u5e94\u5305\u542b\u57df\u540d\u5217\u8868\u3002<\/p>\n<p>&#8220;`yaml<br \/>payload:<br \/>\u2022 DOMAIN-SUFFIX,google.com<br \/>\u2022 DOMAIN-KEYWORD,github<br \/>\u2022 DOMAIN,apple.com<br \/>\u2022 REGEX,^<br \/>&#8220;`<\/p>\n<p>* `DOMAIN-SUFFIX`\uff1a\u5339\u914d\u540e\u7f00\u3002\u4f8b\u5982 `google.com` \u4f1a\u5339\u914d `google.com`\u3001`www.google.com`\u3001`mail.google.com`\uff0c\u4f46\u4e0d\u4f1a\u5339\u914d `notgoogle.com`\u3002<br \/>* `DOMAIN-KEYWORD`\uff1a\u5339\u914d\u5305\u542b\u7279\u5b9a\u5173\u952e\u8bcd\u7684\u57df\u540d\u3002<br \/>* `REGEX`\uff1a\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u5339\u914d\u57df\u540d\uff0c\u7075\u6d3b\u6027\u6700\u9ad8\u4f46\u6027\u80fd\u5f00\u9500\u8f83\u5927\uff0c\u5efa\u8bae\u8c28\u614e\u4f7f\u7528\u3002<\/p>\n<h3>2. IP \u89c4\u5219\u96c6\uff08IPCIDR \/ GeoIP\uff09<\/h3>\n<p>IP \u89c4\u5219\u96c6\u7528\u4e8e\u5339\u914d\u76ee\u6807 IP \u5730\u5740\u3002\u901a\u5e38\u7528\u4e8e\u7ed5\u8fc7\u56fd\u5185 IP \u6216\u5c4f\u853d\u7279\u5b9a\u5e7f\u544a IP\u3002<\/p>\n<p>&#8220;`yaml<br \/>payload:<br \/>\u2022 IP-CIDR,192.168.0.0\/16,no-resolve<br \/>\u2022 IP-CIDR,10.0.0.0\/8,no-resolve<br \/>\u2022 GEOIP,CN,no-resolve<br \/>&#8220;`<\/p>\n<p>* `IP-CIDR`\uff1a\u6807\u51c6 CIDR \u683c\u5f0f\uff0c\u5982 `1.1.1.1\/32`\u3002<br \/>* `GEOIP`\uff1a\u57fa\u4e8e\u5730\u7406\u4f4d\u7f6e\u6570\u636e\u5e93\u7684\u5339\u914d\uff0c\u901a\u5e38\u4f9d\u8d56\u5ba2\u6237\u7aef\u5185\u7f6e\u7684 GeoIP \u6570\u636e\u5e93\u3002<br \/>* `no-resolve`\uff1a<strong>\u5173\u952e\u53c2\u6570<\/strong>\u3002\u5f53\u89c4\u5219\u4e2d\u5305\u542b IP \u65f6\uff0c\u5fc5\u987b\u52a0\u4e0a `no-resolve`\u3002\u8fd9\u544a\u8bc9\u5ba2\u6237\u7aef\u4e0d\u8981\u5bf9\u76ee\u6807 IP \u8fdb\u884c DNS \u67e5\u8be2\uff0c\u76f4\u63a5\u5efa\u7acb\u8fde\u63a5\u3002\u5982\u679c\u9057\u6f0f\u6b64\u53c2\u6570\uff0c\u5ba2\u6237\u7aef\u4f1a\u5c1d\u8bd5\u89e3\u6790\u4e00\u4e2a IP \u5730\u5740\uff0c\u5bfc\u81f4\u9519\u8bef\u3002<\/p>\n<h3>3. \u5730\u7406\u4f4d\u7f6e\u89c4\u5219\u96c6\uff08GeoSite \/ GeoIP\uff09<\/h3>\n<p>\u5bf9\u4e8e\u4f7f\u7528 `geosite` \u6216 `geoip` \u884c\u4e3a\u7684\u89c4\u5219\u96c6\uff0c\u901a\u5e38\u4e0d\u9700\u8981\u624b\u52a8\u7f16\u5199 `payload`\uff0c\u800c\u662f\u7531\u5ba2\u6237\u7aef\u6839\u636e `url` \u62c9\u53d6\u5e76\u89e3\u6790\u3002\u4f46\u5982\u679c\u4f60\u4f7f\u7528 `inline` \u7c7b\u578b\uff0c\u9700\u8981\u77e5\u9053\u5176\u683c\u5f0f\u901a\u5e38\u7531\u7b2c\u4e09\u65b9\u6570\u636e\u5e93\u5de5\u5177\u751f\u6210\uff0c\u683c\u5f0f\u8f83\u4e3a\u7279\u6b8a\uff0c\u4e0d\u5efa\u8bae\u65b0\u624b\u624b\u52a8\u7f16\u5199\u3002<\/p>\n<h2>\u5728 Clash \u914d\u7f6e\u4e2d\u5f15\u7528\u89c4\u5219\u96c6<\/h2>\n<p>\u5b9a\u4e49\u597d `rule-providers` \u540e\uff0c\u9700\u8981\u5728 `rules` \u5b57\u6bb5\u4e2d\u5f15\u7528\u5b83\u4eec\u3002\u5f15\u7528\u89c4\u5219\u96c6\u65f6\uff0c\u53ea\u9700\u4f7f\u7528 `{name}` \u8bed\u6cd5\uff0c\u65e0\u9700\u5c55\u5f00\u5177\u4f53\u5185\u5bb9\u3002<\/p>\n<p>&#8220;`yaml<br \/>rule-providers:<br \/> anti-ad:<br \/> type: http<br \/> url: &#8220;&#8221;<br \/> interval: 86400<br \/> behavior: classical<br \/> format: yaml<br \/> path: .\/providers\/anti-ad.yaml<\/p>\n<p> domestic-geo:<br \/> type: http<br \/> url: &#8220;&#8221;<br \/> interval: 7200<br \/> behavior: geoip<br \/> format: yaml<br \/> path: .\/providers\/domestic-geo.yaml<\/p>\n<p>rules:<br \/>\u2022 RULE-SET,anti-ad,REJECT<br \/>\u2022 RULE-SET,domestic-geo,DIRECT<br \/>\u2022 MATCH,PROXY<br \/>&#8220;`<\/p>\n<p><strong>\u914d\u7f6e\u903b\u8f91\u89e3\u6790\uff1a<\/strong><br \/>\u2022 <strong>\u5b9a\u4e49\u63d0\u4f9b\u8005<\/strong>\uff1a\u9996\u5148\u901a\u8fc7 `rule-providers` \u5b9a\u4e49\u6570\u636e\u6e90\u3002`anti-ad` \u4f7f\u7528\u7ecf\u5178\u884c\u4e3a\uff08\u652f\u6301\u6b63\u5219\u548c\u57df\u540d\uff09\uff0c`domestic-geo` \u4f7f\u7528 GeoIP \u884c\u4e3a\u3002<br \/>\u2022 <strong>\u5f15\u7528\u89c4\u5219<\/strong>\uff1a\u5728 `rules` \u4e2d\uff0c`RULE-SET,anti-ad,REJECT` \u8868\u793a\u5c06 `anti-ad` \u63d0\u4f9b\u8005\u4e2d\u7684\u6240\u6709\u89c4\u5219\u5c55\u5f00\uff0c\u5e76\u5e94\u7528 `REJECT`\uff08\u62d2\u7edd\u8fde\u63a5\uff09\u52a8\u4f5c\u3002<br \/>\u2022 <strong>\u987a\u5e8f\u91cd\u8981\u6027<\/strong>\uff1a\u89c4\u5219\u4ece\u4e0a\u5230\u4e0b\u5339\u914d\uff0c\u4e00\u65e6\u5339\u914d\u6210\u529f\u5373\u505c\u6b62\u3002\u56e0\u6b64\uff0c\u66f4\u5177\u4f53\u3001\u66f4\u4f18\u5148\u7684\u89c4\u5219\u5e94\u653e\u5728\u524d\u9762\u3002<\/p>\n<h2>\u5e38\u89c1\u914d\u7f6e\u9519\u8bef\u4e0e\u6392\u67e5\u65b9\u6cd5<\/h2>\n<p>\u5373\u4f7f\u914d\u7f6e\u770b\u4f3c\u6b63\u786e\uff0c\u89c4\u5219\u96c6\u4e5f\u53ef\u80fd\u4e0d\u751f\u6548\u3002\u4ee5\u4e0b\u662f\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u539f\u56e0\u3002<\/p>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u95ee\u9898\u73b0\u8c61<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u53ef\u80fd\u539f\u56e0<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u6392\u67e5\u4e0e\u89e3\u51b3\u65b9\u6cd5<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u89c4\u5219\u96c6\u663e\u793a\u52a0\u8f7d\u6210\u529f\uff0c\u4f46\u89c4\u5219\u4e0d\u751f\u6548<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">1. `behavior` \u4e0e\u89c4\u5219\u5185\u5bb9\u4e0d\u5339\u914d\u3002<br \/>2. \u89c4\u5219\u4f18\u5148\u7ea7\u4f4e\u4e8e\u5176\u4ed6\u901a\u7528\u89c4\u5219\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">1. \u68c0\u67e5\u89c4\u5219\u96c6\u6587\u4ef6\u5185\u5bb9\u683c\u5f0f\u662f\u5426\u4e0e `behavior` \u4e00\u81f4\uff08\u5982 IP \u89c4\u5219\u662f\u5426\u5305\u542b `no-resolve`\uff09\u3002<br \/>2. \u8c03\u6574 `rules` \u4e2d\u7684\u987a\u5e8f\uff0c\u5c06 `RULE-SET` \u653e\u5728\u66f4\u5177\u4f53\u7684\u89c4\u5219\u4e4b\u524d\u6216\u4e4b\u540e\uff0c\u89c6\u9700\u6c42\u800c\u5b9a\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u5ba2\u6237\u7aef\u542f\u52a8\u62a5\u9519 `invalid rule provider`<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">1. \u8fdc\u7a0b URL \u8fd4\u56de\u975e YAML \u683c\u5f0f\u3002<br \/>2. YAML \u8bed\u6cd5\u9519\u8bef\uff08\u7f29\u8fdb\u3001\u7279\u6b8a\u5b57\u7b26\uff09\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">1. \u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00 `url`\uff0c\u786e\u8ba4\u8fd4\u56de\u5185\u5bb9\u662f\u5426\u4e3a\u5408\u6cd5\u7684 YAML\u3002<br \/>2. \u4f7f\u7528 YAML \u9a8c\u8bc1\u5de5\u5177\u68c0\u67e5 `path` \u6307\u5411\u7684\u672c\u5730\u6587\u4ef6\u8bed\u6cd5\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u57df\u540d\u89e3\u6790\u6cc4\u6f0f\uff08DNS Leak\uff09<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">1. \u89c4\u5219\u4e2d\u7f3a\u5c11 `DNS` \u76f8\u5173\u89c4\u5219\u3002<br \/>2. `no-resolve` \u7f3a\u5931\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">1. \u786e\u4fdd\u5bf9\u9700\u8981\u4ee3\u7406\u7684\u57df\u540d\u6dfb\u52a0\u4e86 `DNS-SET` \u6216 `RULE-SET` \u5e76\u5173\u8054\u4e86\u6b63\u786e\u7684 DNS \u7b56\u7565\u3002<br \/>2. \u68c0\u67e5\u6240\u6709 IP \u7c7b\u89c4\u5219\u662f\u5426\u90fd\u6dfb\u52a0\u4e86 `no-resolve`\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u89c4\u5219\u66f4\u65b0\u5931\u8d25<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">1. \u8fdc\u7a0b URL \u4e0d\u53ef\u8bbf\u95ee\u3002<br \/>2. `interval` \u8bbe\u7f6e\u4e3a 0 \u6216\u6781\u5c0f\u503c\u3002<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">1. \u68c0\u67e5\u7f51\u7edc\u662f\u5426\u80fd\u8bbf\u95ee\u8fdc\u7a0b URL\u3002<br \/>2. \u5c06 `interval` \u8bbe\u7f6e\u4e3a\u5408\u7406\u503c\uff08\u5982 3600 \u79d2\u4ee5\u4e0a\uff09\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/p>\n<h2>\u9ad8\u7ea7\u6280\u5de7\uff1a\u4f18\u5316\u89c4\u5219\u96c6\u6027\u80fd\u4e0e\u7a33\u5b9a\u6027<\/h2>\n<h3>1. \u4f7f\u7528\u672c\u5730\u7f13\u5b58\u51cf\u5c11\u5ef6\u8fdf<\/h3>\n<p>\u901a\u8fc7\u8bbe\u7f6e `path` \u53c2\u6570\uff0cClash \u4f1a\u5c06\u8fdc\u7a0b\u89c4\u5219\u96c6\u4e0b\u8f7d\u5230\u672c\u5730\u6587\u4ef6\u3002\u540e\u7eed\u66f4\u65b0\u65f6\uff0c\u5ba2\u6237\u7aef\u4f1a\u5bf9\u6bd4\u672c\u5730\u6587\u4ef6\u4e0e\u8fdc\u7a0b\u6587\u4ef6\u7684\u65f6\u95f4\u6233\u6216\u5185\u5bb9\u54c8\u5e0c\uff0c\u4ec5\u5728\u6709\u53d8\u5316\u65f6\u91cd\u65b0\u52a0\u8f7d\u3002\u8fd9\u5927\u5927\u51cf\u5c11\u4e86\u542f\u52a8\u65f6\u95f4\u548c\u7f51\u7edc\u4f9d\u8d56\u3002<\/p>\n<h3>2. \u5408\u5e76\u4e0e\u7cbe\u7b80\u89c4\u5219\u96c6<\/h3>\n<p>\u8fc7\u591a\u7684\u89c4\u5219\u96c6\u4f1a\u589e\u52a0\u5185\u5b58\u5360\u7528\u548c\u5339\u914d\u65f6\u95f4\u3002<br \/>* <strong>\u5408\u5e76\u540c\u7c7b\u9879<\/strong>\uff1a\u5c06\u591a\u4e2a\u529f\u80fd\u76f8\u4f3c\u7684\u89c4\u5219\u96c6\uff08\u5982\u591a\u4e2a\u5e7f\u544a\u62e6\u622a\u5217\u8868\uff09\u5408\u5e76\u4e3a\u4e00\u4e2a\uff0c\u51cf\u5c11 `rule-providers` \u7684\u6570\u91cf\u3002<br \/>* <strong>\u53bb\u9664\u5197\u4f59<\/strong>\uff1a\u5b9a\u671f\u6e05\u7406\u89c4\u5219\u96c6\u4e2d\u91cd\u590d\u6216\u8fc7\u671f\u7684\u6761\u76ee\u3002<\/p>\n<h3>3. \u4f7f\u7528 `inline` \u89c4\u5219\u96c6\u5904\u7406\u5c11\u91cf\u89c4\u5219<\/h3>\n<p>\u5bf9\u4e8e\u4e0d\u9700\u8981\u9891\u7e41\u66f4\u65b0\u3001\u6570\u91cf\u6781\u5c11\u7684\u89c4\u5219\uff08\u5982\u51e0\u4e2a\u7279\u5b9a\u57df\u540d\uff09\uff0c\u5efa\u8bae\u4f7f\u7528 `inline` \u7c7b\u578b\uff0c\u76f4\u63a5\u5199\u5728 `rules` \u5b57\u6bb5\u4e2d\uff0c\u800c\u4e0d\u662f\u521b\u5efa\u72ec\u7acb\u7684\u89c4\u5219\u96c6\u6587\u4ef6\u3002\u8fd9\u6837\u53ef\u4ee5\u7b80\u5316\u914d\u7f6e\u7ed3\u6784\u3002<\/p>\n<p>&#8220;`yaml<br \/>rules:<br \/>\u2022 DOMAIN-SUFFIX,example.com,PROXY<br \/>\u2022 IP-CIDR,1.1.1.1\/32,DIRECT,no-resolve<br \/>\u2022 MATCH,PROXY<br \/>&#8220;`<\/p>\n<h2>\u9a8c\u8bc1\u89c4\u5219\u96c6\u914d\u7f6e\u662f\u5426\u751f\u6548<\/h2>\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u52a1\u5fc5\u8fdb\u884c\u9a8c\u8bc1\uff0c\u786e\u4fdd\u5206\u6d41\u903b\u8f91\u7b26\u5408\u9884\u671f\u3002<br \/>\u2022 <strong>\u68c0\u67e5\u65e5\u5fd7<\/strong>\uff1a\u5728 Clash \u5ba2\u6237\u7aef\u7684\u65e5\u5fd7\u754c\u9762\uff0c\u5f00\u542f\u201c\u8c03\u8bd5\u201d\u6216\u201c\u8be6\u7ec6\u201d\u65e5\u5fd7\u6a21\u5f0f\u3002\u89c2\u5bdf\u662f\u5426\u6709 `rule match` \u6216 `rule set match` \u7684\u8bb0\u5f55\uff0c\u786e\u8ba4\u89c4\u5219\u662f\u5426\u88ab\u89e6\u53d1\u3002<br \/>\u2022 <strong>\u6d4b\u8bd5 DNS \u89e3\u6790<\/strong>\uff1a\u4f7f\u7528\u5728\u7ebf DNS \u6cc4\u6f0f\u68c0\u6d4b\u5de5\u5177\uff0c\u6216\u76f4\u63a5\u5728\u5ba2\u6237\u7aef\u4e2d\u67e5\u770b\u7279\u5b9a\u57df\u540d\u7684\u89e3\u6790 IP\u3002\u5982\u679c\u57df\u540d\u5e94\u8d70\u4ee3\u7406\uff0c\u89e3\u6790 IP \u5e94\u4e3a\u4ee3\u7406\u670d\u52a1\u5668\u7684 IP \u6216\u8fdc\u7a0b DNS \u8fd4\u56de\u7684\u7ed3\u679c\uff1b\u5982\u679c\u5e94\u76f4\u8fde\uff0c\u89e3\u6790 IP \u5e94\u4e3a\u672c\u5730 DNS \u8fd4\u56de\u7684\u56fd\u5185 IP\u3002<br \/>\u2022 <strong>\u5b9e\u9645\u8bbf\u95ee\u6d4b\u8bd5<\/strong>\uff1a\u8bbf\u95ee\u89c4\u5219\u96c6\u5b9a\u4e49\u7684\u76ee\u6807\u7f51\u7ad9\u6216\u670d\u52a1\uff0c\u786e\u8ba4\u8fde\u63a5\u72b6\u6001\uff08\u4ee3\u7406\u3001\u76f4\u8fde\u6216\u62d2\u7edd\uff09\u4e0e\u9884\u671f\u4e00\u81f4\u3002<\/p>\n<p>\u901a\u8fc7\u6b63\u786e\u914d\u7f6e\u89c4\u5219\u96c6\uff0c\u4f60\u53ef\u4ee5\u5b9e\u73b0\u7cbe\u7ec6\u5316\u7684\u6d41\u91cf\u63a7\u5236\uff0c\u63d0\u5347\u7f51\u7edc\u4f53\u9a8c\u5e76\u4fdd\u969c\u9690\u79c1\u5b89\u5168\u3002\u8bb0\u4f4f\uff0c\u89c4\u5219\u96c6\u7684\u7ef4\u62a4\u662f\u4e00\u4e2a\u6301\u7eed\u7684\u8fc7\u7a0b\uff0c\u9700\u6839\u636e\u7f51\u7edc\u73af\u5883\u548c\u670d\u52a1\u53d8\u5316\u5b9a\u671f\u8c03\u6574\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Clash \u89c4\u5219\u96c6\uff08Rule Set\uff09\u662f\u5ba2\u6237\u7aef\u5b9e\u73b0\u6d41\u91cf\u5206\u6d41\u7684\u6838\u5fc3\u673a\u5236\uff0c\u5b83\u51b3\u5b9a\u4e86\u54ea\u4e9b\u6d41\u91cf\u8d70\u4ee3\u7406\u3001\u54ea\u4e9b\u6d41\u91cf\u76f4\u8fde\uff0c\u4ee5 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-941","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts\/941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/comments?post=941"}],"version-history":[{"count":0,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts\/941\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/media?parent=941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/categories?post=941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/tags?post=941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}