Commit Graph
197 Commits
Author SHA1 Message Date
kurogeek 9ea058bfb8 router/dhcp: make Kea wait for its VLAN sockets
kea-dhcp4-server orders after network-online.target, which under networkd
only waits for the WAN carrier: the vlan-* links are RequiredForOnline=no.
On stellio Kea started before networkd had addressed vlan-lan/vlan-mgmt,
failed both binds and, per its default, kept running with no socket at
all (ss -ulnp showed nothing on :67). Wireless and wired clients'
DISCOVERs reached vlan-lan and were never answered.

Set service-sockets-require-all with a bounded retry so Kea keeps trying
while networkd catches up, and Restart=on-failure on the unit for the
case it still gives up.

Verified with checks.x86_64-linux.router.
2026-09-18 10:06:01 +00:00
kurogeek f98226bc6e router/wifi: assert no supplicant/NetworkManager owns the radios
With the AP-typed match, the station-mode netdev is unmanaged until
hostapd flips it, so any wpa_supplicant/iwd/NetworkManager in the
importing config would grab the radio first and keep resetting it to
managed mode under hostapd. Fail at eval instead of at runtime.
2026-09-18 09:36:07 +00:00
kurogeek d4e98d8dd5 router/wifi: match BSS .network files on WLANInterfaceType=ap
networkd enslaves the radio to br0 once, at link init. On real hardware
(GL-MT6000, mt798x-wmac) that happens while the netdev is still in station
mode, so the kernel rejects the bridge join (IFF_DONT_BRIDGE), the link is
parked in networkd's failed state and never retried: link_reconfigure_impl()
is a no-op while the matching .network file is unchanged, and the udev
'iw set type __ap' hook meant to pre-empt this loses the race. Wireless
clients associate but their DHCP never reaches vlan-lan.

Match on WLANInterfaceType=ap as well as the name. The station-mode netdev
then matches nothing (unmanaged) and the file first matches when hostapd
has switched the radio to AP and raised carrier, so the enslave succeeds
on the first try. Drop the udev hook.

Verified with checks.x86_64-linux.router (hwsim STA lease over the bridge).
2026-09-18 09:22:57 +00:00
kurogeek 60aac6efb2 services/router: init 2026-09-17 08:57:32 +07:00
kurogeek b85d6637f1 machines/gw-cnx-1: wan.macAddress 2026-08-17 17:34:14 +07:00
kurogeek e316ec56ce flake: use flake-parts 2026-08-05 10:19:32 +07:00
kurogeek 559115e52b inventory.json: update install time of gw-cnx-1 2026-07-31 17:37:47 +07:00
kurogeek 9cfcf91b51 inventory.json: update install time of gw-cnx-1 2026-07-31 16:08:14 +07:00
kurogeek 570fe64497 inventory.json: update install time of gw-cnx-1 2026-07-31 15:09:07 +07:00
kurogeek 2ac4215237 inventory.json: update install time of gw-cnx-1 2026-07-31 13:03:43 +07:00
kurogeek d51a334ec6 inventory.json: update install time of gw-cnx-1 2026-07-31 13:00:57 +07:00
kurogeek b81c0aaa89 machines/gw-cnx-1/facter.json: update hardware configuration 2026-07-31 13:00:57 +07:00
Berwn fcd8e55024 Add untagged access ports and a staging uplink for gw-cnx-1
New cnx.router.accessPorts option pins a port untagged to one VLAN via
bridge PVID/EgressUntagged; convention is the last copper port as an
always-available mgmt recovery port. gw-cnx-1 port roles: enp1s0 WAN,
enp2s0 trunk, enp3s0 temporary DHCP uplink into the old OPNsense LAN
(back to trunk at cutover), enp4s0 untagged mgmt.
2026-07-31 12:57:34 +07:00
Berwn 19e1acda51 Renumber gw-cnx-1 to the fleet addressing scheme (OPNsense replacement)
The newedge.house site adopts the 10.1.<vlanId>.0/24 convention: mgmt 10
(the old untagged LAN), lan 20, iot 40, voip 50, dmz 60, unit1-5 110-150.
PPPoE is untagged at this site. Static leases move to a new per-VLAN
dhcp.reservations option rendered into Kea host reservations.
2026-07-31 11:39:54 +07:00
Berwn f5b6b4b55e Serve newedge.house from the fleet nameservers 2026-07-31 11:39:54 +07:00
Berwn 3646d43ac5 Add CNX WAN Speed dashboard for the gateway speed tests
Per-gateway download/upload/ping from the hourly librespeed runs, with
each link's 7-day median overlaid so the WANSpeedDegraded alert
condition is visible at a glance. Label-driven — new sites appear
automatically once scraped.
2026-07-31 11:03:31 +07:00
Berwn d8d4a686eb Add gateway diagnostics: iperf3, CLI toolkit, periodic WAN speed test
iperf3 serves throughput tests from every VLAN and the mesh; an hourly
librespeed run feeds speedtest_* metrics through node_exporter's textfile
collector, and vmalert flags download rates below half the link's own
7-day median so ISP degradation surfaces without per-site thresholds.
2026-07-31 10:44:52 +07:00
Berwn b11ff75ca6 Add internal reverse proxy for gateways (Caddy, wildcard via DNS-01)
cnx.router.proxy serves <service>.<site><n>.cnx.network with a real Let's
Encrypt wildcard obtained via a gateway-scoped TSIG key against ns1; Blocky
resolves the names to the router's LAN address, so they exist only
internally. First user: Omada UI on gw-cnx-1 (omada.cnx1.cnx.network).
2026-07-31 10:09:08 +07:00
Berwn 4735968433 vars: update via generator dns-acme-gw-cnx-1-knot (machine: ns1) 2026-07-31 10:09:08 +07:00
Berwn 02efeb454b vars: update via generator dns-acme-gw-cnx-1-rfc2136 (machine: gw-cnx-1) 2026-07-31 10:09:08 +07:00
Berwn 868cd9eebd vars: update via generator dns-acme-gw-cnx-1-secret (shared) 2026-07-31 10:09:08 +07:00
Berwn 99fdde666c secrets: add group admins to secret gw-cnx-1-age.key 2026-07-31 10:09:08 +07:00
Berwn 7b706eb3e7 secrets: add group admins to secret ns2-age.key 2026-07-31 10:09:08 +07:00
Berwn 6c89a7031a secrets: add group admins to secret ns1-age.key 2026-07-31 10:09:08 +07:00
Berwn 4ca5fd3afd secrets: add group admins to secret control-age.key 2026-07-31 10:09:08 +07:00
kurogeek 7958ddd771 .gitignore 2026-07-31 09:38:57 +07:00
kurogeek 0c11aca91f machines/gw-cnx-1: disko update 2026-07-31 09:38:07 +07:00
kurogeek 292a699a2b clan.core.sops.defaultGroups to all machines 2026-07-31 09:18:18 +07:00
Berwn 7d549a9c17 Migrate deprecated admin service to sshd + users
sshd carries the admin SSH keys and now also CA-signed host certificates
(TOFU-less verification via the shared openssh-ca); the users service
generates per-machine root passwords (share = false, no prompts).
2026-07-28 17:17:56 +07:00
Berwn ac60d527ae vars: update via generator openssh-cert (machine: web01) 2026-07-28 17:15:55 +07:00
Berwn 3471faa466 vars: update via generator openssh-cert (machine: ns2) 2026-07-28 17:15:54 +07:00
Berwn db22afc6e3 vars: update via generator openssh-cert (machine: ns1) 2026-07-28 17:15:54 +07:00
Berwn 04d3518c03 vars: update via generator openssh-cert (machine: mx1) 2026-07-28 17:15:53 +07:00
Berwn 94daf06814 vars: update via generator openssh-cert (machine: gw-cnx-1) 2026-07-28 17:15:53 +07:00
Berwn 3093ed7044 vars: update via generator openssh-cert (machine: control) 2026-07-28 17:15:52 +07:00
Berwn c1fad33ad7 vars: update via generator user-password-root (machine: web01) 2026-07-28 17:15:47 +07:00
Berwn 60f6884f35 vars: update via generator user-password-root (machine: ns2) 2026-07-28 17:15:47 +07:00
Berwn d2b352543b vars: update via generator user-password-root (machine: ns1) 2026-07-28 17:15:46 +07:00
Berwn 7639d477c8 vars: update via generator user-password-root (machine: mx1) 2026-07-28 17:15:45 +07:00
Berwn 8327e4997a vars: update via generator user-password-root (machine: gw-cnx-1) 2026-07-28 17:15:44 +07:00
Berwn 060091247a vars: update via generator user-password-root (machine: control) 2026-07-28 17:15:43 +07:00
Berwn 9ccfbc3959 vars: update via generator openssh-ca (shared) 2026-07-28 17:15:43 +07:00
Berwn 4585fe7b7f Update flake inputs (clan-core 2026-07-08, nixos-mailserver, treefmt-nix) 2026-07-28 17:11:00 +07:00
Berwn 89eb50fcd7 vars: re-encrypt gw-cnx-1 emergency-access and openssh for admins group 2026-07-28 17:06:11 +07:00
Berwn 430c9996ae devshell: run multi-machine clan updates sequentially
Parallel updates interleave output and bury the YubiKey PIN prompts; a
clan wrapper in the dev shell loops one machine at a time instead.
2026-07-28 17:06:11 +07:00
Berwn 158252323f Add site gateway role (modules/router) and gw-cnx-1
Reusable cnx.router.* module for the Topton 1U boxes replacing OPNsense:
PPPoE WAN (optionally VLAN-tagged, AIS: 10, secret credentials incl.
username), VLAN-filtering bridge, nftables NAT/firewall with MSS clamp,
Kea DHCP with per-VLAN lease time, Blocky DNS, DHCPv6-PD, CrowdSec with
the ZeroTier mesh whitelisted, optional Omada controller, ZFS disk.

Fleet baseline rides along: admins sops group is now derived for every
machine in clan.nix (secrets encrypt to it from the first vars generate)
and time sync is chrony everywhere instead of systemd-timesyncd.
2026-07-28 17:06:07 +07:00
Berwn a87b579eb7 docs: add mail runbook page (mailbox and domain add procedures) 2026-07-28 17:06:07 +07:00
Berwn 7cd44d957c vars: update via generator pppoe-credentials (machine: gw-cnx-1) 2026-07-28 16:34:28 +07:00
Berwn dc2183a83a vars: update via generator pppoe-credentials (machine: gw-cnx-1) 2026-07-28 16:31:09 +07:00
Berwn b0aa12ac07 secrets: fix vars for gw-cnx-1 2026-07-28 16:30:29 +07:00