Skip to content

Commit 3ab8ba7

Browse files
committed
documentation: Update descriptions for neighbor rules
1 parent 1edc8fd commit 3ab8ba7

File tree

9 files changed

+133
-16
lines changed

9 files changed

+133
-16
lines changed

docs/configuration/dns/rule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ Match default interface address.
425425

426426
!!! quote ""
427427

428-
Only supported on Linux with `route.find_neighbor` enabled.
428+
Only supported on Linux, macOS, or in graphical clients on Android and macOS. See [Neighbor Resolution](/configuration/shared/neighbor/) for setup.
429429

430430
Match source device MAC address.
431431

@@ -435,7 +435,7 @@ Match source device MAC address.
435435

436436
!!! quote ""
437437

438-
Only supported on Linux with `route.find_neighbor` enabled.
438+
Only supported on Linux, macOS, or in graphical clients on Android and macOS. See [Neighbor Resolution](/configuration/shared/neighbor/) for setup.
439439

440440
Match source device hostname from DHCP leases.
441441

docs/configuration/dns/rule.zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Available values: `wifi`, `cellular`, `ethernet` and `other`.
424424

425425
!!! quote ""
426426

427-
仅支持 Linux,且需要 `route.find_neighbor` 已启用
427+
仅支持 Linux、macOS,或在 Android 和 macOS 图形客户端中支持。参阅 [邻居解析](/configuration/shared/neighbor/) 了解设置方法
428428

429429
匹配源设备 MAC 地址。
430430

@@ -434,7 +434,7 @@ Available values: `wifi`, `cellular`, `ethernet` and `other`.
434434

435435
!!! quote ""
436436

437-
仅支持 Linux,且需要 `route.find_neighbor` 已启用
437+
仅支持 Linux、macOS,或在 Android 和 macOS 图形客户端中支持。参阅 [邻居解析](/configuration/shared/neighbor/) 了解设置方法
438438

439439
匹配源设备从 DHCP 租约获取的主机名。
440440

docs/configuration/route/index.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ icon: material/alert-decagram
4040
"override_android_vpn": false,
4141
"default_interface": "",
4242
"default_mark": 0,
43+
"find_process": false,
4344
"find_neighbor": false,
4445
"dhcp_lease_files": [],
4546
"default_domain_resolver": "", // or {}
@@ -114,25 +115,33 @@ Set routing mark by default.
114115

115116
Takes no effect if `outbound.routing_mark` is set.
116117

118+
#### find_process
119+
120+
!!! quote ""
121+
122+
Only supported on Linux, Windows, and macOS.
123+
124+
Enable process search for logging when no `process_name`, `process_path`, `package_name`, `user` or `user_id` rules exist.
125+
117126
#### find_neighbor
118127

119128
!!! question "Since sing-box 1.14.0"
120129

121130
!!! quote ""
122131

123-
Only supported on Linux.
132+
Only supported on Linux and macOS.
124133

125-
Enable neighbor resolution for source MAC address and hostname lookup.
134+
Enable neighbor resolution for logging when no `source_mac_address` or `source_hostname` rules exist.
126135

127-
Required for `source_mac_address` and `source_hostname` rule items.
136+
See [Neighbor Resolution](/configuration/shared/neighbor/) for setup.
128137

129138
#### dhcp_lease_files
130139

131140
!!! question "Since sing-box 1.14.0"
132141

133142
!!! quote ""
134143

135-
Only supported on Linux.
144+
Only supported on Linux and macOS.
136145

137146
Custom DHCP lease file paths for hostname and MAC address resolution.
138147

docs/configuration/route/index.zh.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ icon: material/alert-decagram
4242
"override_android_vpn": false,
4343
"default_interface": "",
4444
"default_mark": 0,
45+
"find_process": false,
4546
"find_neighbor": false,
4647
"dhcp_lease_files": [],
4748
"default_network_strategy": "",
@@ -113,25 +114,33 @@ icon: material/alert-decagram
113114

114115
如果设置了 `outbound.routing_mark` 设置,则不生效。
115116

117+
#### find_process
118+
119+
!!! quote ""
120+
121+
仅支持 Linux、Windows 和 macOS。
122+
123+
在没有 `process_name``process_path``package_name``user``user_id` 规则时启用进程搜索以输出日志。
124+
116125
#### find_neighbor
117126

118127
!!! question "自 sing-box 1.14.0 起"
119128

120129
!!! quote ""
121130

122-
仅支持 Linux。
131+
仅支持 Linux 和 macOS
123132

124-
启用邻居解析以查找源 MAC 地址和主机名
133+
在没有 `source_mac_address``source_hostname` 规则时启用邻居解析以输出日志
125134

126-
`source_mac_address``source_hostname` 规则项需要此选项
135+
参阅 [邻居解析](/configuration/shared/neighbor/) 了解设置方法
127136

128137
#### dhcp_lease_files
129138

130139
!!! question "自 sing-box 1.14.0 起"
131140

132141
!!! quote ""
133142

134-
仅支持 Linux。
143+
仅支持 Linux 和 macOS
135144

136145
用于主机名和 MAC 地址解析的自定义 DHCP 租约文件路径。
137146

docs/configuration/route/rule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ Match specified outbounds' preferred routes.
466466

467467
!!! quote ""
468468

469-
Only supported on Linux with `route.find_neighbor` enabled.
469+
Only supported on Linux, macOS, or in graphical clients on Android and macOS. See [Neighbor Resolution](/configuration/shared/neighbor/) for setup.
470470

471471
Match source device MAC address.
472472

@@ -476,7 +476,7 @@ Match source device MAC address.
476476

477477
!!! quote ""
478478

479-
Only supported on Linux with `route.find_neighbor` enabled.
479+
Only supported on Linux, macOS, or in graphical clients on Android and macOS. See [Neighbor Resolution](/configuration/shared/neighbor/) for setup.
480480

481481
Match source device hostname from DHCP leases.
482482

docs/configuration/route/rule.zh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ icon: material/new-box
464464

465465
!!! quote ""
466466

467-
仅支持 Linux,且需要 `route.find_neighbor` 已启用
467+
仅支持 Linux、macOS,或在 Android 和 macOS 图形客户端中支持。参阅 [邻居解析](/configuration/shared/neighbor/) 了解设置方法
468468

469469
匹配源设备 MAC 地址。
470470

@@ -474,7 +474,7 @@ icon: material/new-box
474474

475475
!!! quote ""
476476

477-
仅支持 Linux,且需要 `route.find_neighbor` 已启用
477+
仅支持 Linux、macOS,或在 Android 和 macOS 图形客户端中支持。参阅 [邻居解析](/configuration/shared/neighbor/) 了解设置方法
478478

479479
匹配源设备从 DHCP 租约获取的主机名。
480480

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
icon: material/lan
3+
---
4+
5+
# Neighbor Resolution
6+
7+
Match LAN devices by MAC address and hostname using
8+
[`source_mac_address`](/configuration/route/rule/#source_mac_address) and
9+
[`source_hostname`](/configuration/route/rule/#source_hostname) rule items.
10+
11+
Neighbor resolution is automatically enabled when these rule items exist.
12+
Use [`route.find_neighbor`](/configuration/route/#find_neighbor) to force enable it for logging without rules.
13+
14+
## Linux
15+
16+
Works natively. No special setup required.
17+
18+
Hostname resolution requires DHCP lease files,
19+
automatically detected from common DHCP servers (dnsmasq, odhcpd, ISC dhcpd, Kea).
20+
Custom paths can be set via [`route.dhcp_lease_files`](/configuration/route/#dhcp_lease_files).
21+
22+
## Android
23+
24+
!!! quote ""
25+
26+
Only supported in graphical clients.
27+
28+
Requires Android 11 or above and ROOT.
29+
30+
Must use [VPNHotspot](https://github.com/Mygod/VPNHotspot) to share the VPN connection.
31+
ROM built-in features like "Use VPN for connected devices" can share VPN
32+
but cannot provide MAC address or hostname information.
33+
34+
Set **IP Masquerade Mode** to **None** in VPNHotspot settings.
35+
36+
Only route/DNS rules are supported. TUN include/exclude routes are not supported.
37+
38+
### Hostname Visibility
39+
40+
Hostname is only visible in sing-box if it is visible in VPNHotspot.
41+
For Apple devices, change **Private Wi-Fi Address** from **Rotating** to **Fixed** in the Wi-Fi settings
42+
of the connected network. Non-Apple devices are always visible.
43+
44+
## macOS
45+
46+
Requires the standalone version (macOS system extension).
47+
The App Store version can share the VPN as a hotspot but does not support MAC address or hostname reading.
48+
49+
See [VPN Hotspot](/manual/misc/vpn-hotspot/#macos) for Internet Sharing setup.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
icon: material/lan
3+
---
4+
5+
# 邻居解析
6+
7+
通过
8+
[`source_mac_address`](/configuration/route/rule/#source_mac_address)
9+
[`source_hostname`](/configuration/route/rule/#source_hostname) 规则项匹配局域网设备的 MAC 地址和主机名。
10+
11+
当这些规则项存在时,邻居解析自动启用。
12+
使用 [`route.find_neighbor`](/configuration/route/#find_neighbor) 可在没有规则时强制启用以输出日志。
13+
14+
## Linux
15+
16+
原生支持,无需特殊设置。
17+
18+
主机名解析需要 DHCP 租约文件,
19+
自动从常见 DHCP 服务器(dnsmasq、odhcpd、ISC dhcpd、Kea)检测。
20+
可通过 [`route.dhcp_lease_files`](/configuration/route/#dhcp_lease_files) 设置自定义路径。
21+
22+
## Android
23+
24+
!!! quote ""
25+
26+
仅在图形客户端中支持。
27+
28+
需要 Android 11 或以上版本和 ROOT。
29+
30+
必须使用 [VPNHotspot](https://github.com/Mygod/VPNHotspot) 共享 VPN 连接。
31+
ROM 自带的「通过 VPN 共享连接」等功能可以共享 VPN,
32+
但无法提供 MAC 地址或主机名信息。
33+
34+
在 VPNHotspot 设置中将 **IP 遮掩模式** 设为 ****
35+
36+
仅支持路由/DNS 规则。不支持 TUN 的 include/exclude 路由。
37+
38+
### 设备可见性
39+
40+
MAC 地址和主机名仅在 VPNHotspot 中可见时 sing-box 才能读取。
41+
对于 Apple 设备,需要在所连接网络的 Wi-Fi 设置中将**私有无线局域网地址****轮替**改为**固定**
42+
非 Apple 设备始终可见。
43+
44+
## macOS
45+
46+
需要独立版本(macOS 系统扩展)。
47+
App Store 版本可以共享 VPN 热点但不支持 MAC 地址或主机名读取。
48+
49+
参阅 [VPN 热点](/manual/misc/vpn-hotspot/#macos) 了解互联网共享设置。

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ nav:
129129
- UDP over TCP: configuration/shared/udp-over-tcp.md
130130
- TCP Brutal: configuration/shared/tcp-brutal.md
131131
- Wi-Fi State: configuration/shared/wifi-state.md
132+
- Neighbor Resolution: configuration/shared/neighbor.md
132133
- Endpoint:
133134
- configuration/endpoint/index.md
134135
- WireGuard: configuration/endpoint/wireguard.md

0 commit comments

Comments
 (0)