Files
sing-box-extended-mirror/docs/configuration/route/index.zh.md
T

85 lines
1.6 KiB
Markdown
Raw Normal View History

2022-08-24 16:23:21 +08:00
# 路由
2023-12-01 13:24:18 +08:00
!!! quote "sing-box 1.8.0 中的更改"
:material-plus: [rule_set](#rule_set)
:material-delete-clock: [geoip](#geoip)
:material-delete-clock: [geosite](#geosite)
2022-08-24 16:23:21 +08:00
### 结构
```json
{
"route": {
"geoip": {},
"geosite": {},
"rules": [],
2023-12-01 13:24:18 +08:00
"rule_set": [],
2022-08-24 16:23:21 +08:00
"final": "",
"auto_detect_interface": false,
2022-09-09 15:40:35 +08:00
"override_android_vpn": false,
2022-08-24 16:23:21 +08:00
"default_interface": "en0",
"default_mark": 233
}
}
```
2022-08-25 09:45:22 +08:00
### 字段
2022-08-24 16:23:21 +08:00
2023-12-14 22:23:52 +08:00
| 键 | 格式 |
|-----------|-----------------------|
| `geoip` | [GeoIP](./geoip/) |
2023-12-01 13:24:18 +08:00
| `geosite` | [Geosite](./geosite/) |
#### rule
一组 [路由规则](./rule/) 。
#### rule_set
!!! question "自 sing-box 1.8.0 起"
一组 [规则集](/configuration/rule-set/)。
2022-08-24 16:23:21 +08:00
#### final
2023-11-16 01:11:28 +08:00
默认出站标签。如果为空,将使用第一个可用于对应协议的出站。
2022-08-24 16:23:21 +08:00
#### auto_detect_interface
2023-11-09 17:04:08 +08:00
!!! quote ""
2022-08-24 16:23:21 +08:00
2022-08-25 09:45:22 +08:00
仅支持 Linux、Windows 和 macOS。
2022-08-24 16:23:21 +08:00
2022-09-09 15:40:35 +08:00
默认将出站连接绑定到默认网卡,以防止在 tun 下出现路由环路。
2022-08-24 16:23:21 +08:00
如果设置了 `outbound.bind_interface` 设置,则不生效。
2022-09-09 15:40:35 +08:00
#### override_android_vpn
2023-11-09 17:04:08 +08:00
!!! quote ""
2022-09-09 15:40:35 +08:00
仅支持 Android。
启用 `auto_detect_interface` 时接受 Android VPN 作为上游网卡。
2022-08-24 16:23:21 +08:00
#### default_interface
2023-11-09 17:04:08 +08:00
!!! quote ""
2022-08-24 16:23:21 +08:00
2022-08-25 09:45:22 +08:00
仅支持 Linux、Windows 和 macOS。
2022-08-24 16:23:21 +08:00
2022-09-09 15:40:35 +08:00
默认将出站连接绑定到指定网卡,以防止在 tun 下出现路由环路。
2022-08-24 16:23:21 +08:00
如果设置了 `auto_detect_interface` 设置,则不生效。
#### default_mark
2023-11-09 17:04:08 +08:00
!!! quote ""
2022-08-24 16:23:21 +08:00
2022-08-25 09:45:22 +08:00
仅支持 Linux。
2022-08-24 16:23:21 +08:00
默认为出站连接设置路由标记。
2023-11-16 01:11:28 +08:00
如果设置了 `outbound.routing_mark` 设置,则不生效。