sing-box/docs/configuration/route/index.zh.md

69 lines
1.4 KiB
Markdown
Raw Normal View History

# 路由
### 结构
```json
{
"route": {
"geoip": {},
"geosite": {},
2023-06-07 13:10:01 +00:00
"ip_rules": [],
"rules": [],
"final": "",
"auto_detect_interface": false,
2022-09-09 07:40:35 +00:00
"override_android_vpn": false,
"default_interface": "en0",
"default_mark": 233
}
}
```
### 字段
2023-06-07 13:10:01 +00:00
| 键 | 格式 |
|------------|-------------------------|
| `geoip` | [GeoIP](./geoip) |
| `geosite` | [GeoSite](./geosite) |
| `rules` | 一组 [路由规则](./rule) |
#### final
默认出站标签。如果未空,将使用第一个可用于对应协议的出站。
#### auto_detect_interface
!!! error ""
仅支持 Linux、Windows 和 macOS。
2022-09-09 07:40:35 +00:00
默认将出站连接绑定到默认网卡,以防止在 tun 下出现路由环路。
如果设置了 `outbound.bind_interface` 设置,则不生效。
2022-09-09 07:40:35 +00:00
#### override_android_vpn
!!! error ""
仅支持 Android。
启用 `auto_detect_interface` 时接受 Android VPN 作为上游网卡。
#### default_interface
!!! error ""
仅支持 Linux、Windows 和 macOS。
2022-09-09 07:40:35 +00:00
默认将出站连接绑定到指定网卡,以防止在 tun 下出现路由环路。
如果设置了 `auto_detect_interface` 设置,则不生效。
#### default_mark
!!! error ""
仅支持 Linux。
默认为出站连接设置路由标记。
2023-06-07 13:10:01 +00:00
如果设置了 `outbound.routing_mark` 设置,则不生效。