Repository navigation
net: handle upstream overlap, modem access, and ISP DNS sources - #138
Merged
Merged
Conversation
Owner
Author
|
Follow-up after QA review:
Verification: |
Owner
Author
|
Additional follow-up: overlapping gateway conflicts now suppress proxy ARP with a doctor risk event, and stale WAN gateway host routes are removed from allocated WAN tables. Head 6d43b2e; local Go vet/tests, i18n, and tools/ci.sh all pass; GitHub checks are green. |
# Conflicts: # mr/mod_net_render.go
This was referenced Oct 17, 2026
Cd1s
added a commit
that referenced
this pull request
Oct 17, 2026
…r rolls back on fresh machines (Closes #145) (#147) Since #138 network.sh truncates /run/mini-router/modem-aliases and modem-neigh. install.sh's apply runs network.sh in place before mr-network (which creates the directory) ever started, so the redirection failed, the script exited and the apply rolled back on every fresh machine. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Cd1s
added a commit
that referenced
this pull request
Oct 17, 2026
…s with simulated ISPs (DHCP, PPPoE, DHCPv6-PD) and a LAN client (#149) * tools/lab: add isolated fresh environment harness * tools/lab: record A1 verification results * tools/lab: keep veth pairs inside lab namespaces * tools/lab: isolate LAN and add guest seed installation * tools/lab: add ISP slirp PPPoE hooks and live scenarios * tools/lab: record leakage and ISP milestones * tools/lab: complete cloud-init guest handoff and fallback LAN services * tools/lab: fix cloud-init seed YAML and document guest limits * tools/lab: update A1 continuation report * tools/lab: seed Alpine router package layer for offline install * tools/lab: protect host resolver and namespace state * tools/lab: continue guest install with offline packages * tools/lab: add A1 handover notes * tools/lab: run the real install.sh — signed offline apk mirror, virtio agent console, deferred install, PPPoE/PD ISP rework * tools/lab: lts base, virtio agent console, PPPoE + DHCPv6-PD ISP, lab.sh change, scenarios on lib.sh, A1c report Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools/lab: no host daemon config or services, isp --gw, 03 for same-subnet modems after #138 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools/lab: README links the product fixes #147 #148 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools/lab: review fixes — pinned downloads, image lock, pppd off the host's /run, cleanup on every exit - the cloud image and the minirootfs are fixed versions with pinned SHA256s (checked against Alpine's .sha512 / .sha256); the package chroot is always re-extracted from the verified tarball - one lock (mr-lab-images/.build.lock) for all shared image initialisation; temp dirs from mktemp; loop mounts on fresh mount points, unmounted by the exit trap - veth pairs are created inside the lab namespaces (ip -n <sw> link add ... peer ... netns <ns>) - pppoe-server and its pppd run with a private tmpfs /run: no /run/ppp0.pid or pppd2.tdb on the host - processes are stopped TERM first, KILL after 3 s; isp_stop / ns_del signal everything inside the lab namespace, pid files only a process whose name still matches; powercut goes through kill_qemu - host guard: INT/TERM/HUP run it in dash, symlinks under /etc/ppp, a baseline across commands (lab.sh guard-reset); up refuses to run next to host dnsmasq / kea / radvd services - scenarios: the lab is taken down on any exit (MRLAB_KEEP=1 keeps it), failed setup steps bail out - README: dependencies (mask services before installing; python3, openssh-client; no socat), download trust, host safety Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
/32gateway routes in the main and WAN tables, scoped proxy ARP and masquerade for an upstream gateway that overlaps a LAN subnet, with cleanup on WAN changes, LAN renumbering, and removed WAN tables.wan[].modem.addresssupport for PPPoE physical links: a/32modem alias, host route, trusted-LAN proxy ARP/forwarding/NAT, and state cleanup. Invalid, public, loopback, multicast, router-address, masked, or non-PPPoE values are rejected./run/ppp/resolv.confas the PPP bootstrap fallback and supportdns.fallbackfor an explicit no-source fallback.fe80::/10.ip route get, proxy ARP scope, DHCP firewall reload/cleanup, modem state cleanup, DNS lease behavior, and gateway route cleanup.This change intentionally spans modules because the behavior crosses runtime hooks and generated artifacts:
mr/hooks.goowns WAN leases/routes/events and DHCP hooks;mr/mod_net.goandmr/mod_net_render.goown WAN validation and network rendering;mr/mod_dns.goplusdocs/modules/dns.mdown ISP DNS rendering;mr/mod_fw_nft.goowns the DHCPv6 and modem firewall rules;mr/mod_sys_doctor.goowns the diagnostics; andmr/mod_proxy_test.goupdates the proxy-off regression assertion to allow the independent modem proxy-ARP command.Why
A DHCP modem can assign a gateway and DNS inside the router LAN subnet, blackholing router DNS and LAN access to the modem. Bridged PPPoE users need the modem management page reachable from trusted LAN. Some BNGs send DHCPv6 replies with non-ULA source addresses. WAN protocol changes and DHCPv6 lease events must not remove still-valid IPv4 ISP DNS.
For existing users with
ipv6: trueandpeerdns: true, ISP-provided IPv6 DNS is now visible to dnsmasq after DHCPv6 reports it; it is kept separately from IPv4 DNS and removed only when the IPv6 lease expires. No public fallback is introduced unlessdns.fallbackis explicitly configured./run/ppp/resolv.confremains available during PPP startup.Static WAN/LAN subnet overlap remains a validation error as a safety boundary; DHCP overlap is handled at runtime with a host route and single-address proxy ARP.
Verification
cd mr && go vet ./...cd mr && go test -count=1 ./...python3 tools/i18n.py checksh tools/ci.sh(ALL CHECKS PASSED)Closes #137