Repository navigation
net: relay SLAAC IPv6 /64 to LAN without PD - #160
Merged
Merged
Conversation
… address is proxied Review round 4 of #160: - Q1: probe verdicts (free / occupied, time, 10 min TTL) per WAN device and address live in /run/mini-router/ipv6-relay-probe.json; the cron run writes them, every reconcile (dhcpcd / ppp hooks, apply, cron) reads the same file and proxies only addresses with an unexpired free verdict. No verdict, a timeout or an unknown probe result means no proxy until cron decides. - P2: a probe is ping6 -I <WAN> followed by the WAN neighbour state of the address: echo reply or REACHABLE/STALE/DELAY/PROBE/PERMANENT = occupied (also an upstream host that ignores echo), FAILED = free, anything else (ping6 cannot run, INCOMPLETE that never resolves) = no verdict. - P3: a proxied address that loses its free verdict, becomes occupied, appears in the WAN neighbour table or becomes a router address is removed in the same scan; the 3-scan grace is only for a host that dropped out of the LAN neighbour table. - Discover: filter before the cap of 64, already proxied addresses first (then no verdict, then past half TTL), at most 8 probes at once, no probe starts after 8 s (a run is bounded by ~14 s), a run that finds another one probing skips; the cron reconcile skips a busy state lock (A1). The cap keeps existing proxies first. The legacy-state branch is gone. Disabling relay removes the verdict file. - Q2: tests for the verdict classification, cross-process verdicts (sync never probes), immediate removal vs grace, bounded/parallel discover with the verdict file and both locks in a temp dir, skipped runs, and the cap; two mutations (no verdict = ok, grace for every removal) fail them. - lab 08 (no planted neighbours): the client is discovered from its own traffic, gets a free verdict and is proxied; the ISP reaches it through the proxy; inbound TCP stays default-deny; LAN hosts claiming an upstream address (answering ping, or ignoring it) get an occupied verdict and no proxy; disabling removes every proxy entry and relay host route. - docs/modules/net.md describes the verdicts, who acts on them and the on-link limitation (LAN hosts cannot reach upstream hosts inside the relayed /64). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 18, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
wan[].ipv6_relay(defaultfalse) for an upstream SLAAC/64without DHCPv6-PD./64addresses and LAN IPv6 neighbours from existing dhcpcd hooks plus a crond minute task; assign a stable EUI-64 based address onbr-lan, maintain bounded per-host NDP proxy entries, and clean prefixes, routes, proxies, and deprecated RA state on WAN or configuration changes./proc, and keep IPv6 inbound traffic under the existing default drop plus explicitfirewall.ipv6_allowrules.The design comparison is documented in
docs/modules/net.md: raw Linuxproxy_ndprequires one entry per dynamic host; a resident prefix proxy would add a process and runtime memory; the existing hook + crond scan meets the router's no-idle-daemon policy and remains disabled by default.Why
A modem in router mode may advertise only a SLAAC
/64on the WAN. The router can reach the uplink, but LAN clients previously received no global IPv6 because only DHCPv6-PD populatedbr-lan.Verification
cd mr && gofmt -l . && go vet ./...cd mr && go test -count=1 ./...sh tools/ci.sh—ALL CHECKS PASSEDtools/lab/lab.sh status 3confirmed idle before use;tools/lab/lab.sh run 3 08-dhcp-slaac-relay— 4/4 passed. The LAN client received the relayed prefix, reached the ISP-side IPv6 endpoint, and observed a deprecated LAN prefix after disabling relay.dhcpcd.conf,dnsmasq.conf, nftables, and crontab match origin/main.Closes #159