documentation: Bump version & Refactor docs

This commit is contained in:
世界
2023-11-09 17:04:08 +08:00
parent 18dfbd1cef
commit 3c5f658863
105 changed files with 2061 additions and 1767 deletions

66
docs/manual/proxy/tun.md Normal file
View File

@@ -0,0 +1,66 @@
# :material-expansion-card: TUN
## :material-text-box: Definition
Refers to TUNnel, a virtual network device supported by the kernel.
Its also used in sing-box to denote the extensive functionality surrounding TUN inbound:
including traffic assembly, automatic routing, and network and default interface monitoring.
The following flow chart describes the minimal TUN-based transparent proxy process in sing-box:
``` mermaid
flowchart LR
subgraph inbound [Inbound]
direction TB
packet[IP Packet]
packet --> windows[Windows / macOS]
packet --> linux[Linux]
tun[TUN interface]
windows -. route .-> tun
linux -. iproute2 route/rule .-> tun
tun --> gvisor[gVisor TUN stack]
tun --> system[system TUN stack]
assemble([L3 to L4 assemble])
gvisor --> assemble
system --> assemble
assemble --> conn[TCP and UDP connections]
conn --> router[sing-box Router]
end
subgraph outbound [Outbound]
direction TB
direct[Direct outbound]
proxy[Proxy outbounds]
direct --> adi([auto detect interface])
proxy --> adi
adi --> default[Default network interface in the system]
default --> destination[Destination server]
default --> proxy_server[Proxy server]
proxy_server --> destination
end
inbound --> outbound
```
## :material-help-box: How to
A basic TUN-based transparent proxy configuration file includes: an TUN inbound, `route.auto_detect_interface`, like:
```json
{
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "fdfe:dcba:9876::1/126",
"auto_route": true,
"strict_route": true
}
],
"route": {
"auto_detect_interface": true
}
}
```
TODO: finish this wiki