第一章 · Sing-box 架构优势与通用理念
作为新一代跨平台代理通用内核,Sing-box 凭借极佳的 CPU 效能管理、极低的物理内存开销以及对 VLESS Reality、Hysteria 2、TUIC v5 的原生全面支持,成为了 2026 年极客玩家与多端出海团队的首选。
[Sing-box Core] ──> [Inbounds: TUN / SOCKS5] ──> [Route: Rule-set 匹配] ──> [Outbounds: VLESS / Shadowsocks]
1.1 与传统客户端的区别
- 统一轻量二进制:全平台(Windows, macOS, Linux, iOS, Android)使用相同的规则与配置文件格式。
- 现代化 Rule-set 动态分流:放弃臃肿的单体 GeoIP 数据库,全面采用按需动态拉取的
.srs编译二进制规则集。 - 极致的传输吞吐能力:在大带宽(如 1 Gbps / 8K 极清视频)播放场景下,CPU 占用率相比传统内核下降 40% 以上。
第二章 · 核心 JSON 配置文件结构详解
Sing-box 的配置由四大核心模块构成:log(日志)、dns(加密解析)、inbounds(入站网卡)、outbounds(出站节点)与 route(路由规则)。
{
"log": {
"level": "info",
"timestamp": true
},
"dns": {
"servers": [
{ "tag": "dns_remote", "address": "https://1.1.1.1/dns-query", "detour": "proxy" },
{ "tag": "dns_direct", "address": "https://223.5.5.5/dns-query", "detour": "direct" }
],
"rules": [
{ "outbound": "any", "server": "dns_direct" },
{ "clash_mode": "Global", "server": "dns_remote" },
{ "clash_mode": "Direct", "server": "dns_direct" }
]
},
"inbounds": [
{
"type": "tun",
"tag": "tun-in",
"interface_name": "tun0",
"inet4_address": "172.19.0.1/30",
"auto_route": true,
"strict_route": true
}
]
}
第三章 · Rule-set 规则集与三段分流挂载
通过引入远程或本地 rule-set,可以实现国内应用直连、海外 AI/流媒体走高速专线代理、恶意广告自动拦截的三段式精准分流。
3.1 路由规则配置示例
{
"route": {
"rule_set": [
{
"tag": "geosite-geolocation-cn",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-cn.srs"
},
{
"tag": "geosite-openai",
"type": "remote",
"format": "binary",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-openai.srs"
}
],
"rules": [
{ "protocol": "dns", "action": "hijack-dns" },
{ "rule_set": "geosite-openai", "outbound": "AI-Proxy" },
{ "rule_set": "geosite-geolocation-cn", "outbound": "direct" }
],
"auto_detect_interface": true
}
}
第四章 · 跨平台移动端与桌面端快捷部署步骤
- Android (Sing-box for Android):在 Google Play 下载客户端,选择 Profiles 页面点击加号,选择
Import from URL粘贴订阅链接。 - iOS / macOS (Sing-box GUI):在 App Store 安装后,导入 Remote Profile 并允许创建 VPN 接口配置。
- Windows (Sing-box Windows CLI / GUI):配置
auto_route: true并以管理员身份启动。
第五章 · 排错与常见报错说明
- 报错
FATAL[0000] start service: tun interface name missing:说明系统未正确分配虚拟网卡权限,Windows 请管理员运行,Linux 请赋予CAP_NET_ADMIN能力。 - 配置语法校验工具:可通过执行
sing-box check -c config.json输出具体排错行号。
📡 关注雷达官方情报
📢 Telegram 官方情报频道:点击直达加入专属频道
(实时推送突发断流预警、节点风控通报与大促独家优惠)