feat(network): add host VLAN-bridge networking foundation #29
Reference in New Issue
Block a user
Delete Branch "task-0003-network-vlan-foundation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Introduce
modules.network, the host-level networking foundation a Host declares once and every Guest will later attach to.A Host states its trunk interface and the set of tagged VLAN ids to materialize, and the module emits exactly one systemd-networkd bridge per VLAN — named by the
br-vlan<id>convention — plus the host's own management address on a chosen VLAN's bridge.Each VLAN materializes as a
<trunk>.<id>tagged sub-interface stacked on the trunk, abr-vlan<id>bridge, and a network enslaving the sub-interface to the bridge.The trunk and every bridge set
RequiredForOnline = "no"sosystemd-networkd-wait-onlinenever blocks boot on a carrier-less link.The management address is a static CIDR, or DHCP when unset, on the management VLAN's bridge alone.
This slice is the host-level foundation only; no Guest is wired to a bridge yet.
No host enables it yet
The repo's only host,
neogaia, is a wifi laptop on an access port. It can't present guests as L2 citizens (wifi doesn't bridge), and enabling the module there turns onsystemd-networkdand pulls insystemd-resolved, which takes over the laptop's DNS — an unwanted change to a daily machine. So the module ships inert; the standing enablement lands with the first wired server host.The foundation is still fully verified, and reproducibly so from this tree:
nix flake check— passes (module was enabled onneogaiatransiently to confirm the full toplevel builds, then reverted).Bridge names, VLAN tags, trunk stacking, sub-interface→bridge enslavement, and the management address were confirmed by
nix eval.Reproducible without touching any host file, by enabling the module ad hoc:
Notable decisions
unmanagedguard for the trunk, sub-interfaces, and bridges, so enabling it is self-sufficient on a host that also runs NetworkManager.management.gatewayoption was considered and dropped as speculative for this slice.Review
Risk
Overall: Low (revised down after removing the host enablement)
nix flake checkbuilds the toplevel and eval-checks the assertions, and the module was exercised via a transient enablement, but no standing host build covers it.Standards and Spec
All Standards and Spec findings raised in review were addressed: comments split to one sentence per line and the file-top header reduced to a single purpose line, the cross-file narration and duplicated comments removed, the speculative
gatewayoption dropped, the silent management-address drop closed with a second assertion, and the NetworkManager guard moved into the module so enabling it is self-sufficient.— Claude
b87076ebd3toe05adef7b7