image:[AGPL-3.0,link="https://www.gnu.org/licenses/agpl-3.0"] image:[Palimpsest,link="https://github.com/hyperpolymath/palimpsest-licence"] :toc: :toclevels: 3 :icons: font :source-highlighter: rouge
Network Recovery Unit is the AmbientOps module for diagnosing and repairing internet connectivity on Linux.
It is designed as the Linux counterpart to “Complete Internet Repair”-style tooling, but implemented with AmbientOps principles: plan-first changes, receipts, and safe defaults.
|
Important
|
Project status: Re-scope / integration rewrite in progress This repo previously explored broader ambitions (traffic shaping, PAN setup, beyond-computer networking). Those are now v3 goals for AmbientOps. v1 here focuses on “get Linux online again” reliably. |
Network Recovery Unit is used by:
-
A&E (System Emergency Room) for network emergencies (quick handoff)
-
Operating Theatre as a procedure pack (plan → apply with receipts)
-
Ward to surface calm “network health” signals (via System Weather)
-
Records to package a redaction-aware network incident bundle
-
Fix common connectivity failures quickly and safely
-
Work offline (as much as possible)
-
Prefer non-destructive actions and reversible steps
-
Produce evidence and receipts suitable for support/help forums
-
Cross-distribution best-effort (Ubuntu/Debian/Fedora/Arch first)
Diagnostics (no root required where possible):
-
Interface status and link state
-
DHCP lease and address configuration sanity
-
Routing table and default gateway validation
-
DNS configuration and resolution checks
-
Connectivity tests (ICMP + HTTP/HTTPS where possible)
-
Firewall posture inspection (best-effort: nftables/iptables/UFW/firewalld)
-
Network manager state (NetworkManager/systemd-networkd where available)
Repairs (root required for most):
-
Renew DHCP / reconfigure interface
-
Repair default route / gateway
-
Repair DNS resolver configuration
-
Restart or reconcile NetworkManager/systemd-networkd (guided)
-
Flush relevant caches (DNS, manager state) where appropriate
The CLI mirrors the AmbientOps “scan/plan/apply” discipline:
nru diagnose nru plan sudo nru apply sudo nru apply --dry-run nru export --bundle /path/to/incident
You may also provide targeted operations:
nru diagnose dns|iface|route|firewall|manager sudo nru apply dns|iface|route|manager
Network Recovery Unit will never:
-
delete user data
-
“open ports” without explicit user consent
-
disable security controls silently
-
make undocumented permanent changes without a receipt
Any mutating action must:
-
be represented as a plan first
-
declare required privileges
-
declare reversibility level
-
emit a receipt and evidence pointers
Network Recovery Unit produces artifacts aligned with system-tools-contracts:
-
Evidence envelope references (diagnostics)
-
Procedure plan (steps, previews, risk labels)
-
Run bundle (standard folder layout)
-
Receipt (human + machine)
-
Core: D
-
robust CLI, orchestration, cross-distro detection
-
-
Optional: Rust helpers
-
privileged, safety-critical execution paths (tight sandbox boundaries)
-
Elixir/BEAM is excellent for coordination layers, but for Linux networking repair it is less suitable than D/Rust because the work is mostly system integration and privileged operations.
-
src/— main CLI + orchestration -
modules/diagnostics/— diagnostic checks -
modules/repairs/— repair actions (plan/apply) -
schemas/— local copies/links to relevant contracts -
examples/— sample bundles and receipts -
docs/— distro notes, safety notes, troubleshooting