Clash Mihomo内核 配置模板
以下是我个人自用的DNS防泄漏版配置,已去掉远程订阅,请自行替换
# 【Meta专属】使用geoip.dat数据库(默认:false使用mmdb数据库)
geodata-mode: true
# GEO 文件加载模式,可选的加载模式如下:
# standard:标准加载器
# memconservative:专为内存受限 (小内存) 设备优化的加载器 (默认值)
geodata-loader: standard
# 自动更新 GEO
geo-auto-update: true
# 更新间隔,单位为小时
geo-update-interval: 24
# 自定 GEO 下载地址
geox-url:
geoip: 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat'
geosite: 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat'
mmdb: 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb'
asn: 'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb'
# 【Meta专属】TCP连接并发,如果域名解析结果对应多个IP,并发所有IP,选择握手最快的IP进行连接
tcp-concurrent: true
# 监听IP白名单(当allow-lan:true),只允许列表设备
# 此功能仅在 allow-lan 设置为 true 时生效,支持三种参数:
# "*" 绑定所有的 IP 地址
bind-address: "*"
# find-process-mode has 3 values:always, strict, off
# - always, 开启,强制匹配所有进程
# - strict, 默认,由 clash 判断是否开启
# - off, 不匹配进程,推荐在路由器上使用此模式
find-process-mode: strict
# 全局客户端指纹
# 可选:chrome, firefox, safari, iOS, android, edge, 360, qq, random, 若选择 random, 则按 Cloudflare Radar 数据按概率生成一个现代浏览器指纹。
global-client-fingerprint: ios
profile: # 存储 select 选择记录
store-selected: true
# 持久化 fake-ip
store-fake-ip: true
# sni嗅探
sniffer:
enable: true
force-dns-mapping: true
parse-pure-ip: true
override-destination: true
sniff:
HTTP:
ports: [80, 8080-8880]
TLS:
ports: [443, 8443]
QUIC:
ports: [443, 8443]
force-domain:
- +.v2ex.com
skip-domain:
- "Mijia Cloud"
dns:
enable: true
listen: :1053
ipv6: true
prefer-h3: false
respect-rules: true
enhanced-mode: redir-host #【Meta专属】redir-host传递域名,可远程解析
default-nameserver:
- system
nameserver-policy:
# 中国大陆及私有地址走运营商DNS解析
"geosite:cn,private,geolocation-cn": 'system'
# 广告域名直接DNS拦截,不解析
"geosite:category-ads-all": rcode://success
nameserver:
- https://8.8.8.8/dns-query
- https://1.1.1.1/dns-query
proxy-server-nameserver:
- system
# 如果有需要添加本地节点,可取消下一行的注释并根据mihomo的wiki自行填写
# proxies:
proxy-providers:
myProxy: &myProxy
type: http
url: '这里改为你的远程订阅地址'
path: ./Proxies/proxies.yaml
interval: 3600
Proxies - HK:
<<: *myProxy
filter: '^(?=.*((?i)🇭🇰|香港|(\b(HK|Hong)\b)))'
Proxies - TW:
<<: *myProxy
filter: '^(?=.*((?i)🇹🇼|台湾|(\b(TW|Tai|Taiwan)\b)))'
Proxies - SG:
<<: *myProxy
filter: '^(?=.*((?i)🇸🇬|新加坡|狮|(\b(SG|Singapore)\b)))'
Proxies - KR:
<<: *myProxy
filter: '^(?=.*((?i)🇰🇷|韩国|韓|首尔|(\b(KR|Korea)\b)))'
Proxies - JP:
<<: *myProxy
filter: '^(?=.*((?i)🇯🇵|日本|川日|东京|大阪|泉日|埼玉|(\b(JP|Japan)\b)))'
Proxies - US:
<<: *myProxy
filter: '^(?=.*((?i)🇺🇸|美国|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|(\b(US|United States)\b)))'
Proxies - Other:
<<: *myProxy
filter: '^(?!.*(?i)(🇭🇰|香港|HK|Hong|🇹🇼|台湾|TW|Tai|Taiwan|🇯🇵|日本|川日|东京|大阪|泉日|埼玉|JP|Japan|🇰🇷|韩国|韓|首尔|KR|Korea|🇸🇬|新加坡|狮|SG|Singapore|🇺🇸|美国|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States|群|邀请|返利|循环|官网|客服|网站|网址|获取|订阅|流量|到期|机场|下次|版本|官址|备用|过期|已用|联系|邮箱|工单|贩卖|通知|倒卖|防止|国内|地址|频道|无法|说明|使用|提示|特别|访问|支持|traffic|USE|USED|TOTAL|EXPIRE|EMAIL|Panel|\d{4}-\d{2}-\d{2}|\dG)).+$'
proxy-groups:
- name: "🚀 Final"
type: select
proxies: [🇭🇰 Hong Kong, 🇸🇬 Singapore, 🇯🇵 Japan, 🇺🇸 United States, 🇺🇳 United Nations]
icon: https://raw.githubusercontent.com/Orz-3/face/master/Global.png
- name: "🎬 Media"
type: select
proxies: [🚀 Final, 🇭🇰 Hong Kong, 🇸🇬 Singapore, 🇯🇵 Japan, 🇺🇸 United States, 🇺🇳 United Nations]
icon: https://raw.githubusercontent.com/Orz-3/face/master/YouTube.png
- name: "📡 Telegram"
type: select
proxies: [🚀 Final, 🇭🇰 Hong Kong, 🇸🇬 Singapore, 🇯🇵 Japan, 🇺🇸 United States, 🇺🇳 United Nations]
icon: https://github.com/shindgewongxj/WHATSINStash/raw/main/icon/telegram.png
- name: "🇭🇰 Hong Kong"
type: select
use:
- Proxies - HK
icon: https://raw.githubusercontent.com/Orz-3/face/master/HK.png
- name: "🇸🇬 Singapore"
type: select
use:
- Proxies - SG
icon: https://raw.githubusercontent.com/Orz-3/face/master/SG.png
- name: "🇯🇵 Japan"
type: select
use:
- Proxies - JP
icon: https://raw.githubusercontent.com/Orz-3/face/master/JP.png
- name: "🇺🇸 United States"
type: select
use:
- Proxies - US
icon: https://raw.githubusercontent.com/Orz-3/face/master/US.png
- name: "🇺🇳 United Nations"
type: select
use:
- Proxies - Other
icon: https://raw.githubusercontent.com/Orz-3/face/master/UN.png
- name: "💔 China"
type: select
proxies:
- DIRECT
icon: https://raw.githubusercontent.com/Orz-3/face/master/China.png
rule-anchor:
domain_mrs: &domain_mrs {type: http, interval: 3600, behavior: domain, format: mrs}
ip_mrs: &ip_mrs {type: http, interval: 3600, behavior: ipcidr, format: mrs}
rule-providers:
# behavior 参数有三种可选项:domain / ipcidr / classical,对应不同格式的 rule-provider 文件格式,请按实际格式填写
# format 格式,可选 yaml 和 text,默认 yaml
#专项规则
AI:
<<: *domain_mrs
url: "https://github.com/DustinWin/ruleset_geodata/raw/clash-ruleset/ai.mrs"
rules:
# 强制直连
- DST-PORT,22,DIRECT
- DOMAIN-SUFFIX,libtorrent.org,DIRECT
- DOMAIN-SUFFIX,qbittorrent.org,DIRECT
- PROCESS-NAME,qbittorrent.exe,DIRECT
- PROCESS-NAME,QQ.exe,DIRECT
- PROCESS-NAME,WXWorkLocal.exe,DIRECT
# 强制代理
- GEOSITE,ookla-speedtest,🚀 Final
# Telegram
- PROCESS-NAME,Telegram.exe,📡 Telegram
- GEOSITE,telegram,📡 Telegram
- GEOIP,telegram,📡 Telegram,no-resolve
# Github
- GEOSITE,github,🚀 Final
# Instagram
- GEOSITE,instagram,🚀 Final
# 微软服务
- GEOSITE,microsoft@cn,DIRECT
- GEOSITE,microsoft,🚀 Final
# Cloudflare
- GEOSITE,cloudflare,🚀 Final
- GEOIP,cloudflare,🚀 Final,no-resolve
# 苹果服务
- GEOSITE,icloud,🚀 Final
- GEOSITE,apple,🚀 Final
# 谷歌服务
- GEOSITE,google,🚀 Final
- GEOIP,google,🚀 Final,no-resolve
# AI
- RULE-SET,AI,🇺🇸 United States
# 国际媒体分组
- GEOSITE,netflix,🎬 Media
- GEOSITE,disney,🎬 Media
- GEOIP,netflix,🎬 Media,no-resolve
# 最终规则
- GEOSITE,private,DIRECT
- GEOSITE,CN,DIRECT
- GEOSITE,geolocation-cn,DIRECT
- GEOSITE,geolocation-!cn,🚀 Final
- GEOIP,private,DIRECT,no-resolve
- GEOIP,CN,DIRECT,no-resolve
- MATCH,🚀 Final