• 请不要在回答技术问题时复制粘贴 AI 生成的内容
MoGeJiEr
V2EX  ›  程序员

mihomo 接入 tailscale

  •  5
     
  •   MoGeJiEr · May 12 · 16670 views
    This topic created in 176 days ago, the information mentioned may be changed or developed.

    自己改了下 mihomo 内核,支持接入 tailscale 网络了,链接:https://github.com/cyenxchen/mihomo

    如果你用的安卓可以使用我改过的 clashmi,这样就可以同时翻墙+访问家里网络了,链接:https://github.com/cyenxchen/clashmi

    我个人自用了几天,没发现什么大问题,当然有问题了也欢迎带日志反馈.

    配置示例:

    proxies:
      - name: ts-mihomo
        type: tailscale
        auth-key: tskey-auth-xxxxx
        hostname: ts-mihomo
        control-url: https://controlplane.tailscale.com
        ephemeral: true # 是否是临时节点
        state-dir: "./tailscale"  # 连接上 tailscale 网络之后会有一些数据持久化,该选项是就指定保存这些数据的目录
        exit-node: "" # 可选,不需要出口节点就不填
        accept-routes: true # 可选,默认 true ,用于接受 subnet routes
    
    rules:
      # 将你家里的内网流量打到 tailscale 中
      - IP-CIDR,192.168.1.0/24,ts-mihomo,no-resolve
    
    Supplement 1  ·  May 13
    已经提 pr 到官方了,官方管理也回复说了可以合并,但要做一些修改,其中最大的问题就是强兼 1.20 版本,这块等我有时间就去处理.
    Supplement 2  ·  May 14
    应该是官方接手了,pr 已经合并主干了,各位等后面更新吧.
    115 replies  •  2026-07-27 16:34:09 +08:00
    1  2  
    ❮ ❯
    ifu25
    ifu25
    May 14
    101
    @ifu25 换成官方的 derp 节点也不行,换 tailscale 的面板就可以,用自建的 headscale 各种折腾没成功。
    xiaokanhongchen
    102
    官方出了 alpha 版,试了,有问题,连不上。楼主的就可以,还是换回来继续使用,等正式版出了再看
    ifu25
    ifu25
    May 15
    103
    @ifu25 升级到最新版 headscale 似乎是可以了,还在验证中。
    MoGeJiEr
    MoGeJiEr
    OP
    May 15
    104
    @ifu25 #100 看着像,你要是有问题带上日志发个 issues,我有空来看下
    a158212892
    a158212892
    May 15 via iPhone
    105
    子网代理貌似不生效,控制台显示 This machine does not expose any routes
    stefwoo
    stefwoo
    May 15
    106
    感谢楼主,太棒了
    jsntit
    jsntit
    May 18
    108
    能不能增加 advertise_routes ,用来发布内网路由,以便外网访问内网
    xiaokanhongchen
    109
    我用的 mihomo-android 二进制文件通过 box4magisk 在手机上使用,我发现官方合并的没有 Android 特定适配代码,导致连不上 Tailscale ,多次测试,只有楼主的可以。以下是我咨询 opus 得到的结论,看看能否合并到官方,看看是否有用:
    ```
    官方版本缺少了以下关键的 Android 适配:

    缺少 tailscaleAndroidStateStore 包装器 - 导致尝试读取 ipn-android 配置失败
    缺少 logtail.Disable() 调用 - 可能导致后台 DNS 查询问题
    缺少 TS_LOGS_DIR 环境变量设置 - 日志目录配置不正确
    初始化时机问题 - init() 中的注册可能在 Tailscale 库初始化之前执行
    ```
    MoGeJiEr
    MoGeJiEr
    OP
    May 19
    110
    @xiaokanhongchen #109 这个问题你要去官方仓库提 issue 的,或者直接使用 clashmi 吧,原版接的就是 mihomo 官方的版本,应该是可以直接用的,实在不行也可以用我魔改版的 clashmi.
    MoGeJiEr
    MoGeJiEr
    OP
    May 19
    111
    @jsntit 直接给官方提 issue 吧,现在是官方接手了
    xiaokanhongchen
    112
    好的好的,感谢
    shoudle
    shoudle
    May 19
    113
    善!
    wsszh
    wsszh
    May 19
    114
    赞!移动端能支持就方便多了
    myarsenal
    myarsenal
    Jul 27
    115
    Loon 或者 quanx 支持这个配置吗,clash party 倒是可以测试成功,mihomo v1.19.27
    1  2  
    ❮ ❯
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3394 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 10:32 · PVG 18:32 · LAX 02:32 · JFK 05:32
    ♥ Do have faith in what you're doing.