Skip to content

Commit 5f8fc03

Browse files
committed
docs(network): document ipv6 and fake-ip behavior
1 parent abcc3d0 commit 5f8fc03

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ On tags (`v*`):
260260
- `mode = "tun"` and `ipv6 = true`: IPv6 is proxied by the core TUN stack
261261
- `mode != "tun"` and `ipv6 = true`: IPv6 stays direct outside the Linux firewall graph
262262
- `ipv6 = false`: runtime disables IPv6 in the core/DNS path so clients prefer IPv4
263+
- practical selection matrix:
264+
- `mixed + ipv6=true + fake-ip`: current default, IPv4 proxied and IPv6 direct
265+
- `mixed + ipv6=false + fake-ip`: prefer IPv4 while keeping transparent IPv4 proxying
266+
- `tun + ipv6=true + fake-ip`: closest to phone-style full-device behavior, including proxied IPv6
267+
- `mixed + redir-host`: real-address DNS answers instead of fake-IP
268+
- browser/devtools may still show the real upstream server address even when local DNS is `fake-ip`; the fake-IP is only the local interception hop
263269
- Route convergence: renew/reapply prunes stale BOX fwmark rules and enforces one current `route_pref` rule
264270
- Idempotent + lock-protected: `enable|renew|disable`
265271
- `BOX_TRACE_COMMANDS=1` logs external command executions with component/action context
@@ -275,6 +281,16 @@ On tags (`v*`):
275281
- `cap_ipv4=true`
276282
- `cap_ipv6=false` (full IPv6 interception/hijack graph pending)
277283

284+
## Live Behavior Notes
285+
286+
- `boxctl service status --json` reports:
287+
- `dns_enhanced_mode`
288+
- `ipv6_enabled`
289+
- `ipv6_effective_mode`
290+
- `boxctl firewall status --json` reports the same IPv6/DNS fields plus backend capability flags.
291+
- If `dns_enhanced_mode = "fake-ip"`, local name resolution can return fake-IP ranges such as `198.18.0.0/16` while browser/devtools still show the real remote server address used by Mihomo's outbound connection.
292+
- There is no reference-backed `prefer_ipv4|prefer_ipv6|default` selector. The supported family control is `network.ipv6 = true|false`.
293+
278294
## Rollback/Uninstall
279295

280296
Safe uninstall (keeps config backups/data unless manually removed):

docs/linux-port/01-component-config-runtime-model.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,8 @@ This snapshot is used by:
141141
- `mode!=tun` + `ipv6=true`: IPv6 remains direct because the firewall graph is still IPv4-only.
142142
- `ipv6=false`: runtime disables IPv6 in the core/DNS layer so clients fall back to IPv4.
143143
- `network.dns_enhanced_mode = "fake-ip" | "redir-host"` is exposed explicitly for Mihomo overlay rendering.
144+
- Operational presets:
145+
- `mixed + ipv6=true + fake-ip`: default desktop compromise, IPv4 proxied and IPv6 direct
146+
- `mixed + ipv6=false + fake-ip`: force IPv4 preference without changing firewall mode
147+
- `tun + ipv6=true + fake-ip`: closest to phone-style full-device behavior
148+
- `mixed + redir-host`: avoid fake-IP answers and keep real-address DNS responses

docs/linux-port/04-component-firewall-routing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ If unsupported, apply controlled downgrade with explicit logs.
8080
- non-`tun` modes + `network.ipv6=true`: IPv6 remains direct outside the firewall graph.
8181
- `network.ipv6=false`: runtime disables IPv6 in the core/DNS path to prefer IPv4.
8282
- `network.dns_enhanced_mode` controls Mihomo DNS `fake-ip` vs `redir-host` independently from firewall mode.
83+
- This means `mixed` mode on current Linux-native backends is effectively:
84+
- IPv4: transparent redirect/mark path through Box/Mihomo
85+
- IPv6: direct host path unless `mode=tun`
86+
- When `dns_enhanced_mode = "fake-ip"`, applications may resolve fake IPv4/IPv6 placeholders locally while observability tools still show the real remote upstream address chosen by Mihomo.
8387

8488
## Tailscale Coexistence Requirements
8589
For hosts that run Tailscale alongside Box, firewall apply/cleanup must preserve Tailscale routing and DNS behavior.

0 commit comments

Comments
 (0)