summarylogtreecommitdiffstats
path: root/config.base.yaml
blob: d40f98331f6fd79e0c6dad76620d3ed8d09f3991 (plain)
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
mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
ipv6: true

unified-delay: true
tcp-concurrent: true

external-controller: 127.0.0.1:9090
secret: "__MIHOMO_SECRET__"

external-ui: /usr/share/metacubexd

profile:
  store-selected: true
  store-fake-ip: true

# Use explicit upstream resolvers so TUN takeover on systemd-resolved cannot
# send Mihomo DNS queries back to itself through `system`.
dns:
  enable: true
  ipv6: false
  default-nameserver:
    - 223.5.5.5
    - 119.29.29.29
    - 114.114.114.114
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  use-hosts: true
  respect-rules: true
  proxy-server-nameserver:
    - 223.5.5.5
    - 119.29.29.29
    - 114.114.114.114
  nameserver:
    - 223.5.5.5
    - 119.29.29.29
    - 114.114.114.114
  fallback:
    - 1.1.1.1
    - 8.8.8.8
  fallback-filter:
    geoip: true
    geoip-code: CN
    ipcidr:
      - 240.0.0.0/4
    domain:
      - +.google.com
      - +.facebook.com
      - +.youtube.com

proxy-providers:
  subscriptions:
    type: file
    path: ./providers/subscriptions.yaml
    health-check:
      enable: true
      url: https://www.gstatic.com/generate_204
      interval: 300
      timeout: 5000
      lazy: true
      expected-status: 204

proxy-groups:
  - name: PROXY
    type: select
    proxies:
      - AUTO
      - DIRECT
    use:
      - subscriptions

  - name: AUTO
    type: url-test
    use:
      - subscriptions
    url: https://www.gstatic.com/generate_204
    interval: 300
    timeout: 5000
    lazy: true
    empty-fallback: DIRECT

rules:
  - GEOIP,LAN,DIRECT,no-resolve
  - MATCH,PROXY

# TUN is intentionally disabled by default. Verify mixed-port proxying first,
# then enable and tune this block manually if full routing is required.
#
# tun:
#   enable: true
#   stack: mixed
#   auto-route: true
#   auto-detect-interface: true
#   dns-hijack:
#     - any:53