-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconfig-simple.yaml
More file actions
232 lines (212 loc) · 6.78 KB
/
config-simple.yaml
File metadata and controls
232 lines (212 loc) · 6.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# 全局配置
mixed-port: 7890 # HTTP(S) 和 SOCKS 代理混合端口
# redir-port: 7891 # 透明代理端口,用于 Linux 和 MacOS
# tproxy-port: 7892 # 透明代理端口,用于 Linux (TProxy TCP and TProxy UDP)
# port: 7893 # HTTP(S) 代理服务器端口
# socks-port: 7894 # SOCKS5 代理端口
allow-lan: true # 允许局域网连接
bind-address: "*" # 绑定 IP 地址,仅作用于 allow-lan 为 true 时,'*'表示所有地址
skip-auth-prefixes: # 设置跳过验证的 IP 段
- 127.0.0.1/8
- ::1/128
lan-allowed-ips: # 允许连接的 IP 地址段,仅作用于 allow-lan 为 true, 默认值为 0.0.0.0/0 和::/0
- 0.0.0.0/0
- ::/0
mode: rule # 'rule' 规则 / 'global' 全局 / 'direct' 直连
log-level: warning # 日志等级 silent/error/warning/info/debug
ipv6: false # IPv6 总开关,关闭阻断所有 IPv6 链接和屏蔽 DNS 请求 AAAA 记录
keep-alive-interval: 1800 #TCP Keep Alive 包的间隔,单位为秒
keep-alive-idle: 60 # TCP Keep Alive 的最大空闲时间
disable-keep-alive: false # 禁用 TCP Keep Alive
# 缓存
profile:
store-selected: true # 存储 select 选择记录
store-fake-ip: true # 持久化 fake-ip
unified-delay: true # 统一延迟,更换延迟计算方式,通过去除握手等额外开销来降低延迟数值
tcp-concurrent: false # TCP 并发,TCP 并发请求所有 IP 地址,然后选择延迟最低的一个进行连接
# 全局 TLS 指纹,优先低于 proxy 内的 client-fingerprint
# 可选: "chrome","firefox","safari","ios","random","none" options.
global-client-fingerprint: chrome
# GEOIP 数据模式
geodata-mode: true # 更改 geoip 使用文件,mmdb 或者 dat,可选 true/false,true为dat,此项有默认值 false
geodata-loader: memconservative # GEO 文件加载模式
geo-auto-update: true # 是否自动更新 GEO
geo-update-interval: 720 # 更新间隔,单位:小时
# 自定义 GEO 下载地址
geox-url:
geoip: "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat"
geosite: "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat"
mmdb: "https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/Country.mmdb"
asn: "https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/GeoLite2-ASN.mmdb"
global-ua: clash.meta # 自定义外部资源下载时使用的的 UA
# TUN 配置
tun:
enable: true
stack: mixed
dns-hijack:
- "any:53"
- "tcp://any:53"
auto-route: true
auto-redirect: true
auto-detect-interface: true
strict-route: true
# DNS 配置
dns:
enable: true # 关闭将使用系统 DNS
prefer-h3: false # 是否开启 DoH 支持 HTTP/3,将并发尝试
listen: 0.0.0.0:53 # 开启 DNS 服务器监听
ipv6: false # false 将返回 AAAA 的空结果
respect-rules: true # 遵循规则
enhanced-mode: fake-ip # 使用fake-ip模式
behavior: strict
fake-ip-range: 198.18.0.1/16 # Fake IP 池设置
fake-ip-filter-mode: blacklist
# 用于解析 nameserver,fallback 以及其他 DNS 服务器配置的 DNS 服务器域名
default-nameserver:
- 223.5.5.5
- 223.6.6.6
# 配置不使用 fake-ip 的域名
fake-ip-filter:
- "*.lan"
- "*.local"
- "*.arpa"
- time.*.com
- ntp.*.com
- +.xiaomi.com
- localhost.ptlogin2.qq.com
- geosite:private
- geosite:cn
- "+.qq.com"
- "+.wechat.com"
- "+.weixin.qq.com"
- "+.qpic.cn"
- "+.qlogo.cn"
- "+.servicewechat.com"
- "+.tenpay.com"
- "+.wxpay.wxutil.com"
# 配置 DNS 服务器
nameserver:
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
# 配置 DNS 策略
nameserver-policy:
"geosite:cn,private,apple":
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
"geosite:geolocation-!cn":
- https://dns.cloudflare.com/dns-query
- https://dns.google/dns-query
# 当配置 fallback 时,会查询 nameserver 中返回的 IP 是否为 CN,非必要配置
# 当不是 CN,则使用 fallback 中的 DNS 查询结果
fallback:
- https://dns.cloudflare.com/dns-query
- https://dns.google/dns-query
fallback-filter:
geoip: true # 配置是否使用 geoip
geoip-code: CN # 当 nameserver 域名的 IP 查询 geoip 库为 CN 时,不使用 fallback 中的 DNS 查询结果
ipcidr:
- ::/128
- ::1/128
- 2001::/32
- 0.0.0.0/8
- 10.0.0.0/8
- 100.64.0.0/10
- 127.0.0.0/8
- 169.254.0.0/16
- 172.16.0.0/12
- 192.0.0.0/24
- 192.0.2.0/24
- 192.88.99.0/24
- 192.168.0.0/16
- 198.18.0.0/15
- 198.51.100.0/24
- 203.0.113.0/24
- 224.0.0.0/4
- 240.0.0.0/4
- 255.255.255.255/32
proxy-server-nameserver:
- https://doh.pub/dns-query
- https://dns.alidns.com/dns-query
- 223.5.5.5
- 119.29.29.29
# 嗅探配置
sniffer:
enable: true
sniff:
HTTP:
ports: [80, 8080-8880]
override-destination: true
TLS:
ports: [443, 8443]
QUIC:
ports: [443, 8443]
skip-domain:
- "Mijia Cloud"
- "+.push.apple.com"
# 策略组引用
Pro:
&a1 {
type: http,
interval: 28800,
health-check:
{
enable: true,
url: "https://www.google.com/generate_204",
interval: 1800,
},
override: { skip-cert-verify: true, udp: true },
}
manual: &a2 { type: select, use: [Subscribe] }
proxy-providers:
Subscribe:
<<: *a1
url: $suburl
path: ./SelfHost.yaml
proxy-groups:
# 默认
- {
name: 默认,
<<: *a2,
icon: "https://img.hoofei.com/clash/icons/Manual.png",
}
# 家宽
- {
name: 家宽,
<<: *a2,
filter: "家宽|住宅|(?i)ISP|isp|AT&T|Verizon|Sprint|T-Mobile|HKT|HGC|HKBN|CMHK|Hinet|Softbank|KDDI|Singtel|M1|Starhub",
icon: "https://img.hoofei.com/clash/icons/ISP.png",
}
rules:
# DNS 查询规则(优先级最高)
- DOMAIN-SUFFIX,doh.pub,DIRECT
- DOMAIN-SUFFIX,alidns.com,DIRECT
- DOMAIN-SUFFIX,cloudflare.com,默认
- DOMAIN,dns.google,默认
- IP-CIDR,1.1.1.1/32,默认,no-resolve
- IP-CIDR,1.0.0.1/32,默认,no-resolve
- IP-CIDR,8.8.8.8/32,默认,no-resolve
- IP-CIDR,8.8.4.4/32,默认,no-resolve
- IP-CIDR,223.5.5.5/32,DIRECT,no-resolve
- IP-CIDR,223.6.6.6/32,DIRECT,no-resolve
- IP-CIDR,119.29.29.29/32,DIRECT,no-resolve
# 私有网络
- GEOIP,PRIVATE,DIRECT,no-resolve
# 分流
- GEOSITE,category-ai-!cn,家宽
- GEOSITE,tiktok,默认
- GEOSITE,netflix,默认
- GEOSITE,disney,默认
- GEOSITE,telegram,默认
- GEOIP,telegram,默认
- GEOSITE,whatsapp,默认
- DOMAIN-SUFFIX,doh.pub,DIRECT
- DOMAIN-SUFFIX,alidns.com,DIRECT
- DOMAIN-SUFFIX,cloudflare.com,默认
- DOMAIN-SUFFIX,dns.google,默认
- DOMAIN,1.1.1.1,默认
- DOMAIN,1.0.0.1,默认
- DOMAIN,8.8.8.8,默认
- DOMAIN,8.8.4.4,默认
- GEOSITE,CN,DIRECT
- GEOIP,CN,DIRECT,no-resolve
- MATCH,默认