Add netns and unshare support

This commit is contained in:
世界
2026-08-30 17:41:42 +08:00
parent 7b3993db12
commit 9531a6a9cd
34 changed files with 891 additions and 49 deletions
+18 -1
View File
@@ -7,7 +7,8 @@ icon: material/new-box
:material-plus: [include_mac_address](#include_mac_address)
:material-plus: [exclude_mac_address](#exclude_mac_address)
:material-plus: [dns_mode](#dns_mode)
:material-plus: [dns_address](#dns_address)
:material-plus: [dns_address](#dns_address)
:material-plus: [netns](#netns)
!!! quote "Changes in sing-box 1.13.3"
@@ -197,6 +198,22 @@ icon: material/new-box
Virtual device name, automatically selected if empty.
#### netns
!!! question "Since sing-box 1.14.0"
!!! quote ""
Only supported on Linux.
Create the tun interface in the specified network namespace, name, path, or the tag of a
[network namespace](/configuration/network-namespace/).
When set, `auto_route` and `auto_redirect` operate inside the namespace, and no root privilege is
required if the namespace is owned by the current user.
Conflict with `platform`.
#### address
!!! question "Since sing-box 1.10.0"
+16 -1
View File
@@ -7,7 +7,8 @@ icon: material/new-box
:material-plus: [include_mac_address](#include_mac_address)
:material-plus: [exclude_mac_address](#exclude_mac_address)
:material-plus: [dns_mode](#dns_mode)
:material-plus: [dns_address](#dns_address)
:material-plus: [dns_address](#dns_address)
:material-plus: [netns](#netns)
!!! quote "sing-box 1.13.3 中的更改"
@@ -199,6 +200,20 @@ icon: material/new-box
虚拟设备名称,默认自动选择。
#### netns
!!! question "自 sing-box 1.14.0 起"
!!! quote ""
仅支持 Linux。
在指定的网络命名空间中创建 tun 接口,可以是名称、路径,或[网络命名空间](/zh/configuration/network-namespace/)的标签。
设置后,`auto_route` 和 `auto_redirect` 在该命名空间内生效;若命名空间归当前用户所有,则无需 root 权限。
与 `platform` 冲突。
#### address
!!! question "自 sing-box 1.10.0 起"