Tun: Update autoOutboundsInterface desc for macOS and Linux (#872)

Co-authored-by: Chapito <282825138+Jasper344612@users.noreply.github.com>
Co-authored-by: yiguodev <147401898+yiguodev@users.noreply.github.com>
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
This commit is contained in:
Fangliding
2026-07-18 11:35:58 +08:00
co-authored by Chapito yiguodev RPRX
parent 3bd509bad9
commit ac476f6c58
3 changed files with 49 additions and 16 deletions
+17 -6
View File
@@ -16,9 +16,10 @@ Linux 可选使用该环境变量传入 TUN FD 以进行某些轻量化或非特
{
// ...
"protocol": "tun",
// [!code focus:9]
// [!code focus:10]
"settings": {
"name": "xray0",
"name": "utun10",
"desc": "Wintun",
"mtu": 1500,
"gateway": ["10.0.0.1/16", "fc00::1/64"],
"dns": ["1.1.1.1", "8.8.8.8"],
@@ -33,19 +34,29 @@ Linux 可选使用该环境变量传入 TUN FD 以进行某些轻量化或非特
> `name`: string
创建的 TUN 接口名。默认 `"xray0"`
创建的 TUN 接口名。默认 `"utunN"`
其中 N 为 10~1024 之间的随机数
> `desc`: string
Windows 系统中的网络接口名称描述,默认为 `Wintun`。该字符串会与 "Tunnel" 拼接成 "xxx Tunnel"
在 Windows 中使用 `route print` 可查看具体信息
> `mtu`: number
接口的 MTU。默认值为 `1500`
接口的 mtu。默认值为 `1500`
> `gateway`: [string]
为 TUN 接口配置的地址前缀列表,通常分别填写 IPv4 / IPv6,例如 `"10.0.0.1/16"``"fc00::1/64"`
macOS 系统中,仅 IPv4 会生效,如未设置,则使用 `169.254.10.1/30`
> `dns`: [string]
为 TUN 接口配置的 DNS 服务器列表,例如 `"1.1.1.1"``"8.8.8.8"`
该项配置只在 Windows 系统上有效,可为 TUN 接口配置的 DNS 服务器列表,例如 `"1.1.1.1"``"8.8.8.8"`
> `userLevel`: number
@@ -57,7 +68,7 @@ userLevel 的值, 对应 [policy](../policy.md#policyobject) 中 `level` 的值.
自动写入系统路由表要导入该 TUN 接口的目标网段列表。每一项均为 CIDR,例如 `"0.0.0.0/0"` 表示所有 IPv4 流量,`"::/0"` 表示所有 IPv6 流量。
当前支持 Windows。其他系统需要手动配置路由表。
当前支持 Windows, macOS, Linux。FreeBSD 系统需要手动配置路由表。
> `autoOutboundsInterface`: string
+16 -5
View File
@@ -16,9 +16,10 @@ On Linux, this environment variable can optionally be used to pass in the TUN FD
{
// ...
"protocol": "tun",
// [!code focus:9]
// [!code focus:10]
"settings": {
"name": "xray0",
"name": "utun10",
"desc": "Wintun",
"mtu": 1500,
"gateway": ["10.0.0.1/16", "fc00::1/64"],
"dns": ["1.1.1.1", "8.8.8.8"],
@@ -33,7 +34,15 @@ On Linux, this environment variable can optionally be used to pass in the TUN FD
> `name`: string
The name of the created TUN interface. Default is `"xray0"`.
The name of the created TUN interface. Default is `"utunN"`.
Where N is a random number between 10 and 1024.
> `desc`: string
The description of the network interface name on Windows. Default is `Wintun`. This string is concatenated with "Tunnel" to form "xxx Tunnel".
On Windows, you can use `route print` to view the details.
> `mtu`: number
@@ -43,9 +52,11 @@ The MTU of the interface. The default is `1500`.
The list of address prefixes assigned to the TUN interface, usually one for IPv4 and one for IPv6, such as `"10.0.0.1/16"` and `"fc00::1/64"`.
On macOS, only IPv4 takes effect; if not set, `169.254.10.1/30` is used.
> `dns`: [string]
The list of DNS servers assigned to the TUN interface, such as `"1.1.1.1"` and `"8.8.8.8"`.
This option only takes effect on Windows. The list of DNS servers assigned to the TUN interface, such as `"1.1.1.1"` and `"8.8.8.8"`.
> `userLevel`: number
@@ -57,7 +68,7 @@ The value of `userLevel` corresponds to the `level` value in [policy](../policy.
The list of destination prefixes that Xray should add to the system routing table automatically so that the traffic is directed into this TUN interface. Each item is a CIDR. For example, `"0.0.0.0/0"` means all IPv4 traffic, and `"::/0"` means all IPv6 traffic.
Currently only supported on Windows. On other systems, the routing table must be configured manually.
Currently supported on Windows, macOS, and Linux. On FreeBSD, the routing table must be configured manually.
> `autoOutboundsInterface`: string
+16 -5
View File
@@ -16,9 +16,10 @@
{
// ...
"protocol": "tun",
// [!code focus:9]
// [!code focus:10]
"settings": {
"name": "xray0",
"name": "utun10",
"desc": "Wintun",
"mtu": 1500,
"gateway": ["10.0.0.1/16", "fc00::1/64"],
"dns": ["1.1.1.1", "8.8.8.8"],
@@ -33,7 +34,15 @@
> `name`: string
Имя создаваемого TUN-интерфейса. По умолчанию `"xray0"`.
Имя создаваемого TUN-интерфейса. По умолчанию `"utunN"`.
Где N — случайное число в диапазоне от 10 до 1024.
> `desc`: string
Описание имени сетевого интерфейса в Windows. По умолчанию `Wintun`. Эта строка объединяется со словом "Tunnel", образуя "xxx Tunnel".
В Windows можно использовать `route print` для просмотра подробной информации.
> `mtu`: number
@@ -43,9 +52,11 @@
Список префиксов адресов, назначаемых TUN-интерфейсу, обычно отдельно для IPv4 и IPv6, например `"10.0.0.1/16"` и `"fc00::1/64"`.
В macOS действует только IPv4; если не задано, используется `169.254.10.1/30`.
> `dns`: [string]
Список DNS-серверов, назначаемых интерфейсу TUN, например `"1.1.1.1"` и `"8.8.8.8"`.
Этот параметр действует только в Windows. Список DNS-серверов, назначаемых интерфейсу TUN, например `"1.1.1.1"` и `"8.8.8.8"`.
> `userLevel`: number
@@ -57,7 +68,7 @@
Список целевых префиксов, которые Xray автоматически добавляет в системную таблицу маршрутизации, чтобы трафик направлялся в этот TUN-интерфейс. Каждый элемент задается в формате CIDR. Например, `"0.0.0.0/0"` означает весь IPv4-трафик, а `"::/0"` означает весь IPv6-трафик.
В настоящее время поддерживается только на Windows. На других системах таблицу маршрутизации необходимо настраивать вручную.
В настоящее время поддерживается на Windows, macOS и Linux. На FreeBSD таблицу маршрутизации необходимо настраивать вручную.
> `autoOutboundsInterface`: string