Refactor multi networks strategy

This commit is contained in:
世界
2024-11-13 19:05:28 +08:00
parent d1c23bc2da
commit ba454d1693
31 changed files with 495 additions and 336 deletions

View File

@@ -7,6 +7,8 @@ icon: material/new-box
!!! quote "Changes in sing-box 1.11.0"
:material-plus: [default_network_strategy](#default_network_strategy)
:material-plus: [default_network_type](#default_network_type)
:material-plus: [default_fallback_network_type](#default_fallback_network_type)
:material-alert: [default_fallback_delay](#default_fallback_delay)
!!! quote "Changes in sing-box 1.8.0"
@@ -30,17 +32,18 @@ icon: material/new-box
"default_interface": "",
"default_mark": 0,
"default_network_strategy": "",
"default_network_type": [],
"default_fallback_network_type": [],
"default_fallback_delay": ""
}
}
```
### Fields
!!! note ""
| Key | Format |
|-----------|-----------------------|
| `geoip` | [GeoIP](./geoip/) |
| `geosite` | [Geosite](./geosite/) |
You can ignore the JSON Array [] tag when the content is only one item
### Fields
#### rules
@@ -96,11 +99,9 @@ Takes no effect if `outbound.routing_mark` is set.
#### default_network_strategy
!!! quote ""
!!! question "Since sing-box 1.11.0"
Only supported in graphical clients on Android and iOS with `auto_detect_interface` enabled.
Strategy for selecting network interfaces.
See [Dial Fields](/configuration/shared/dial/#network_strategy) for details.
Takes no effect if `outbound.bind_interface`, `outbound.inet4_bind_address` or `outbound.inet6_bind_address` is set.
@@ -108,12 +109,20 @@ Can be overrides by `outbound.network_strategy`.
Conflicts with `default_interface`.
See [Dial Fields](/configuration/shared/dial/#network_strategy) for available values.
#### default_network_type
!!! question "Since sing-box 1.11.0"
See [Dial Fields](/configuration/shared/dial/#network_type) for details.
#### default_fallback_network_type
!!! question "Since sing-box 1.11.0"
See [Dial Fields](/configuration/shared/dial/#fallback_network_type) for details.
#### default_fallback_delay
!!! quote ""
!!! question "Since sing-box 1.11.0"
Only supported in graphical clients on Android and iOS with `auto_detect_interface` enabled and `network_strategy` set.
See [Dial Fields](/configuration/shared/dial/#fallback_delay) for details.
See [Dial Fields](/configuration/shared/dial/#fallback_delay) for details.

View File

@@ -1,5 +1,16 @@
---
icon: material/new-box
---
# 路由
!!! quote "sing-box 1.11.0 中的更改"
:material-plus: [network_strategy](#network_strategy)
:material-plus: [default_network_type](#default_network_type)
:material-plus: [default_fallback_network_type](#default_fallback_network_type)
:material-alert: [default_fallback_delay](#default_fallback_delay)
!!! quote "sing-box 1.8.0 中的更改"
:material-plus: [rule_set](#rule_set)
@@ -26,6 +37,10 @@
}
```
!!! note ""
当内容只有一项时,可以忽略 JSON 数组 [] 标签
### 字段
| 键 | 格式 |
@@ -87,11 +102,9 @@
#### network_strategy
!!! quote ""
!!! question "自 sing-box 1.11.0 起"
仅在 Android 与 Apple 平台图形客户端中支持,并且需要 `auto_detect_interface`
选择网络接口的策略。
详情参阅 [拨号字段](/configuration/shared/dial/#network_strategy)
`outbound.bind_interface`, `outbound.inet4_bind_address``outbound.inet6_bind_address` 已设置时不生效。
@@ -99,12 +112,20 @@
`default_interface` 冲突。
可用值请参阅 [拨号字段](/configuration/shared/dial/#network_strategy)。
#### default_network_type
#### fallback_delay
!!! question "自 sing-box 1.11.0 起"
!!! quote ""
详情参阅 [拨号字段](/configuration/shared/dial/#default_network_type)。
仅在 Android 与 Apple 平台图形客户端中支持,并且需要 `auto_detect_interface``network_strategy` 已设置。
#### default_fallback_network_type
详情请参阅 [拨号字段](/configuration/shared/dial/#fallback_delay)。
!!! question "自 sing-box 1.11.0 起"
详情参阅 [拨号字段](/configuration/shared/dial/#default_fallback_network_type)。
#### default_fallback_delay
!!! question "自 sing-box 1.11.0 起"
详情参阅 [拨号字段](/configuration/shared/dial/#fallback_delay)。

View File

@@ -11,12 +11,18 @@ icon: material/new-box
"action": "route", // default
"outbound": "",
"network_strategy": "",
"network_type": [],
"fallback_network_type": [],
"fallback_delay": "",
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
```
!!! note ""
You can ignore the JSON Array [] tag when the content is only one item
`route` inherits the classic rule behavior of routing connection to the specified outbound.
#### outbound
@@ -27,23 +33,21 @@ Tag of target outbound.
#### network_strategy
!!! quote ""
Only supported in graphical clients on Android and iOS with `auto_detect_interface` enabled.
Strategy for selecting network interfaces.
See [Dial Fields](/configuration/shared/dial/#network_strategy) for details.
Only take effect if outbound is direct without `outbound.bind_interface`,
`outbound.inet4_bind_address` and `outbound.inet6_bind_address` set.
See [Dial Fields](/configuration/shared/dial/#network_strategy) for available values.
#### network_type
See [Dial Fields](/configuration/shared/dial/#network_type) for details.
#### fallback_network_type
See [Dial Fields](/configuration/shared/dial/#fallback_network_type) for details.
#### fallback_delay
!!! quote ""
Only supported in graphical clients on Android and iOS with `auto_detect_interface` enabled and `network_strategy` set.
See [Dial Fields](/configuration/shared/dial/#fallback_delay) for details.
#### udp_disable_domain_unmapping

View File

@@ -12,6 +12,8 @@ icon: material/new-box
"outbound": "",
"network_strategy": "",
"fallback_delay": "",
"network_type": [],
"fallback_network_type": [],
"udp_disable_domain_unmapping": false,
"udp_connect": false
}
@@ -27,23 +29,21 @@ icon: material/new-box
#### network_strategy
!!! quote ""
仅在 Android 与 Apple 平台图形客户端中支持,并且需要 `auto_detect_interface`
选择网络接口的策略。
详情参阅 [拨号字段](/configuration/shared/dial/#network_strategy)。
仅当出站为 `direct``outbound.bind_interface`, `outbound.inet4_bind_address`
`outbound.inet6_bind_address` 未设置时生效。
可用值参阅 [拨号字段](/configuration/shared/dial/#network_strategy)。
#### network_type
详情参阅 [拨号字段](/configuration/shared/dial/#network_type)。
#### fallback_network_type
详情参阅 [拨号字段](/configuration/shared/dial/#fallback_network_type)。
#### fallback_delay
!!! quote ""
仅在 Android 与 Apple 平台图形客户端中支持,并且需要 `auto_detect_interface``network_strategy` 已设置。
详情参阅 [拨号字段](/configuration/shared/dial/#fallback_delay)。
#### udp_disable_domain_unmapping
@@ -68,6 +68,10 @@ icon: material/new-box
}
```
!!! note ""
当内容只有一项时,可以忽略 JSON 数组 [] 标签
`route-options` 为路由设置选项。
### reject