REPORT
CEPATO Technical Note2026.11.27

tailscale内嵌singbox指南,解决代理和ts无法共存的问题

Chongxi
Author:Chongxi
steam: —·spotify: —
ANALYSIS

估计各位用 tailscale 还有代理需求的可能会比较头疼啊,一般来说代理软件和 tailscale 都会占手机 VPN 服务,这就导致你要用其中一个东西就得关掉另外一个(android 有 su 跑 b4m 那种的除外啊),基本上没 root 的 android 用户和 iPhone 用户面对这种高级需求的时候很头大啊,我就是其中之一

好消息是,sing-box 自 1.12.0 起支持 Tailscale 作为内置 endpoint,它直接把 tsnet(Tailscale 的库)嵌进 sing-box 核心,不依赖系统的 Tailscale 客户端。所以 sing-box 占一个 VPN 插槽,Tailscale 在里面跑,拓补如下

PRTCL // PLAINTEXT
手机流量
↓ sing-box TUN 接管
├── 专网 IP → Tailscale endpoint → 内网
├── 特殊需求 → 代理节点 → 出口
└── 常规需求 → direct 直连

guide#

1. 顶层新增 endpoints(与 dns、route 同级)#

PRTCL // JSON
"endpoints": [
{
"type": "tailscale",
"tag": "ts",
"auth_key": "tskey-auth-xxxxxxxxxxxxxxxx",
"accept_routes": true,
"hostname": "qwq"
}
]
字段说明
tag节点名,后面路由规则用 outbound: "ts" 引用
auth_key在 Tailscale 后台 Settings → Keys 生成;留空则启动后在日志 / 通知里出登录链接
accept_routes接受其他节点广播的子网路由(subnet router)
hostname节点在后台显示的名字,首次注册时生效

authkey 需要去 tailscale 的 web console 里生成,于 settings > key,默认配置使用一次后就直接吊销

Screenshot%202026-11-27%20at%202

Screenshot%202026-11-27%20at%202

2. route.rules 中,插在 ip_is_private 那条之前#

PRTCL // JSON
{
"ip_cidr": ["100.64.0.0/10"],
"outbound": "ts"
},
{
"ip_is_private": true,
"outbound": "direct"
},

100.64.0.0/10 是 Tailscale 节点互访的地址段。

如果以后要在外面通过 Tailscale 访问家里 10.0.0.0/24(家里有 subnet router 广播) 就往 ip_cidr 里加 "10.0.0.0/24" 不过代价是:在家时局域网流量也会绕一层 Tailscale, 且 Tailscale 掉线时局域网跟着不通

这样配置就写好了,如果你实在不会写,可以问 ai

3. 使用#

android 那边我不确定现在最好用的 singbox 客户端是什么,这里我就以 iOS 的官 singbox 客户端 singbox MT 为例:启用后直接就能用,没啥需要额外配置的(

IMG_5570

可以看到日志里确实成功通信了

IMG_5571

须知#

1. 为什么必须放在 ip_is_private 前面#

sing-box 的 ip_is_private 底层是 IsPublicAddr → Go 的 netip.IsPrivate(),只认 RFC1918(10/8、172.16/12、192.168/16)和 fc00::/7,100.64.0.0/10 是 CGNAT 段,在 sing-box 眼里算公网 IP

所以不加这条规则,100.x 的流量会一路掉到 final: "proxy-select",被机场代理走

放前面是为了尽早命中,如果加了 10.0.0.0/24,那它确实必须压过 ip_is_private,否则会被 direct 截走

2. MagicDNS#

配置里 DNS 对 A/AAAA 全部返回 fakeip(198.18.0.0/15),xxx.ts.net 会被解析成 198.18.x.x,命不中 100.64.0.0/10 规则,也就不会进 Tailscale

访问 tailnet 里的机器一律用 100.x 的 IP

要支持域名得再加一个 DNS server:

PRTCL // JSON
{
"type": "tailscale",
"tag": "ts-dns",
"endpoint": "ts"
}

再加 DNS 规则把 .ts.net 之类的查询指过去,注意这时域名 DNS 结果不再是 fakeip,需要自己权衡和现有 fakeip 策略的冲突

结#

singbox 现在的成熟度已经超出我的预期了,在之前我们说这是代理界的瑞士军刀,现在几乎成为通用网络栈那种感觉了。感觉 singbox 会成为网络界的 ffmpeg

Chongxi
CHONGXIAuthor
Steam—
Spotify—
Published at:2026.11.27
Classified
Distribution Notice

tailscale内嵌singbox指南,解决代理和ts无法共存的问题

Author CHONGXI/2026.11.27/CEPATO-2026-1127-SINGBO

This work is licensed under CC BY-NC-SA 4.0. Redistribution, remixing and adaptation are allowed for non-commercial use, provided the same license is used and the original author is credited.

SubscribeDonate
Discussion
Archive_Ref
Copyright © 2011–2026 Chongxi & CEPATO
Powered by Astro & CEPATO-NEXT
StatusNon-Collaborative_Entity // CEPATO_NEXT_v27.0

Type a keyword to search