众所周知,安卓同时只能有一个VPN处在运行状态,因此最近尝试在手机上把 Mihomo 内核和 Tailscale APP 一起使用,手机已经root,用box4magisk模块来运行mihomo。
目前尝试还没有成功,发现存在一些DNS方面的问题。。。具体而言,当安卓VPN Service启动的时候,mihomo的DNS劫持会失效,用wireshark抓包能看到所有的DNS查询都直接走wlan0了,mihomo dns不会收到任何dns流量
而且,模块配置不管是用tproxy模式还是直接用内核的tun模式,都是一样的问题。不知坛友们有无这方面经验
Mihomo内核使用的是github actions最新版本。最简配置如下:
mixed-port: 7890
allow-lan: false
bind-address: "*"
ipv6: false
mode: rule
log-level: debug
find-process-mode: always
external-controller: 127.0.0.1:9090
external-ui: ui
profile:
store-selected: true
store-fake-ip: true
dns:
enable: true
use-hosts: true
use-system-hosts: true
listen: 0.0.0.0:1053
ipv6: false
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.0/16
fake-ip-filter:
# mDNS
- "*.lan"
- "*.local"
nameserver:
- "223.5.5.5"
- "180.76.76.76"
- "119.29.29.29"
fallback:
- "tls://1.1.1.1#Proxy"
- "tls://8.8.8.8#Proxy"
fallback-filter:
geoip: true
geoip-code: CN
ipcidr:
- 240.0.0.0/4
tun:
enable: true
stack: system
device: tun9
dns-hijack:
- "0.0.0.0:53"
- "tcp://0.0.0.0:53"
auto-detect-interface: true
strict-route: true
gso: true
auto-route: true
route-exclude-address:
- "100.64.0.0/10" # Tailscale
proxy-providers:
airport_air:
type: http
url: 机场订阅链接
path: ./airport.yaml
interval: 86400
health-check:
enable: false
interval: 600
url: https://www.gstatic.com/generate_204
proxy-groups:
- name: Proxy
type: select
proxies:
- "airport"
- Direct
- name: airport
type: select
use:
- airport_air
proxies:
- Direct
- name: Direct
type: select
proxies:
- DIRECT
- name: "🐟 漏网之鱼"
type: select
proxies:
- Proxy
- Direct
rules:
# Private and LAN
- GEOIP,private,DIRECT,no-resolve
- GEOSITE,private,DIRECT,no-resolve
- DOMAIN-SUFFIX,msftconnecttest.com,DIRECT,no-resolve
# Tailscale
- IP-CIDR,100.64.0.0/10,DIRECT,no-resolve
# CN
- GEOSITE,cn,Direct
# PROXY
- GEOSITE,category-social-media-!cn,Proxy
- GEOSITE,category-entertainment,Proxy
- GEOSITE,category-communication,Proxy
- GEOSITE,category-scholar-!cn,Proxy
- GEOSITE,category-orgs,Proxy
- GEOSITE,category-porn,Proxy
- GEOSITE,category-android-app-download,Proxy
- GEOSITE,category-forums,Proxy
- GEOSITE,category-anticensorship,Proxy
- GEOSITE,category-dev,Proxy
- GEOSITE,gfw,Proxy
- GEOIP,telegram,Proxy
- GEOIP,CN,Direct
- MATCH,🐟 漏网之鱼
补充:
-
后续经过尝试,貌似所有安卓VPN都与mihomo有不兼容的问题,不仅仅局限于Taliscale/Zerotier
-
关于为什么不用 magisk-tailscaled 模块?因为此模块存在一些问题,包括暂不支持UDP、无法方便地投送文件、暂不支持moonlight串流等,无法完美替代Tailscale APP