RouterOS 011: ER-X migration parity, cutover, HA rehearsal #73
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac#73
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Part of #43
Refs: lab/iac#44, lab/iac#45, lab/iac#46, lab/mc#16, lab/clusters#1668
Migrated from router-as-code tracker 011 (docs/routeros/tracker in this repo history). Research notes: docs/routeros/notes/.
Blocked on hardware landing (#44) and the #46 HA decision. The endgame issue
everything else feeds. Inventory source of truth: iac#45 comment 10628
(ER-X: VLAN table 10.15.1/24 native, 1000/1001/1002/1101; 13 port forwards;
BGP AS64512 with only mini up; dnsmasq zone-forward int.animeteamspeak.moe →
10.10.5.53; ramen plaintext pw).
Migration parity checklist (from the inventory)
drop, don't silently omit).
for int names, public resolution surviving a think outage.
configured on the ER-X — configure it now or drop BGP and static-route,
cheapest honest option).
segmentation posture as part of migration, not after.
the ~1G pass-through question (#44's open items).
Cutover order (draft)
planclean, sim round-trip green (#008).Done when
for two weeks.
Cutover plan: pre-seeded routers that work on first power-on (2026-11-13)
The tofu-controller runs on mini, behind the router being replaced. During the swap it can't reach anything, so the routers have to boot fully configured from a rendered
.rsc. Terraform takes over afterwards..rsc. Route A is #69 (compiled from planned values). Route B is #70 (/exportfrom the CHR). While the two disagree, CHR wins.tofu plan -detailed-exitcode, and require an empty plan.import {}blocks resolve by name or field (#66), so.ids don't matter. The first controller plan against the hardware must be empty. Only after that does the device object go to auto-apply, with the #74 timer armed.Rollback for the swap itself: the ER-X stays racked and unchanged until the two-week backstop window (#72) passes.
Cutover steps from #70 (PR #117, recipe in
routeros/render/README.md, "Adopting a device"). Per device:task render:device DEVICE=<d>withPPPOE_USER/PPPOE_PASSWORD, thentask render:gate DEVICE=<d>on the same commit.routeros/render/load.sh <d> out/<d>.full.rsc 192.168.88.6xover the recovery port. It imports, reads back, then disables the recovery address. Shred the render.routeros/render/imports/<d>.tfasrouteros/<d>/imports.tf. The root state must be empty.routeros/<d>/imports.tf.Hardware replacement is the same, plus deleting the dead device's state Secret before step 5 (live change, sign-off).
Prerequisites, all in open PRs (update 2026-11-16):
vlan10-mgmtDHCP client, reservation 10.30.10.10 on a fixed bridge MAC (iac #117). Check at the bench that the lease shows up on the routers.Cutover checklist (2026-11-16, from the live network and the merged roots)
Done: bootstrap on all three devices (prod certs, recovery ports), secrets in OpenBao + mini ESO, ER-X parity (iac#118: VLANs 1+1000, live reservations, BGP to mini, 9 port forwards, crs309 mgmt), rollback fuse (iac#119), lab runner image + env-only passwords + hostAliases (clusters#1704), provider fork tofu.rc (clusters#1703 commit 186a13ff).
A. Config gaps found against the ER-X (must decide or fix before the swap)
nameserver 10.10.1.1(machine-configs modules/network.nix default), i.e. the ER-X dnsmasq. The new routers do not answer DNS (allow_remote_requests=false, #50). At the swap c1 loses name resolution. Fix: either machine-configs default nameservers -> 1.1.1.1, 8.8.8.8 rolled out BEFORE the swap (matches #50), or the routers serve DNS to the LAN zones.port-forward hairpin-nat enableon every LAN. Internal clients that use public names (harbor., git., vault. -> the public IP) need it. nat.tf only forwards from the WAN. Needs dstnat on the public address from inside + srcnat masquerade for the dst-nat'ed LAN traffic (the targets are BGP-routed to mini, which answers LAN clients directly otherwise).approvePlan: auto: the first adoption plan after unsuspending would apply without review. Set manual approval for the first plan.B. Software still in flight
9. iac#117 (#70 generator + DHCP work) merged; re-render and gate all three with #118 and anything from section A.
10. clusters: mini Cilium BGP peer
lab-erx-01 10.15.1.1(clusters/mini/cilium/ciliumbgp.yaml) -> two peers 10.15.1.252 and .253, merged AT the swap. Without it no routes to 10.10.6.x: every published service and every port forward is down.C. Bench (before the swap, ER-X still running the lab)
11. Load the full renders on all three (routeros/render/load.sh) and run the read-only hardware plan per device.
12. VRRP failover: reboot rb5009-a, rb5009-b takes .1 on both legacy networks, and back.
13. Optional PPPoE pre-test: one router WAN on the Bell hub while the ER-X stays up (Bell allows several sessions).
14. Reset check: reset-configuration replays the bootstrap (runbook 6.4).
15. Optional: RouterBOOT 7.20.8 -> 7.25.1 on both RB5009s.
D. Swap day
16. Workstation off VLAN 1001 (gone after the swap) onto the LAN.
17. Cables per the iac#44 port map; ER-X stays racked untouched (rollback = cables back).
18. Merge the Cilium peer change (10); check BGP up and 10.10.6.x routes on both routers.
19. Check: LAN internet, c1 API VIP 10.10.1.20, OpenBao 10.10.1.21, flux reconciling, port forwards from outside, cloudflare-ddns updated to the new public address.
20. Copy the generated imports.tf into each root, state empty, unsuspend crs309 first then rb5009-a, rb5009-b; approve plans that match the gate allowlist; remove imports.tf next commit (routeros/render/README.md). The #74 fuse arms on the first applies (N = 600 s).
Cutover done (2026-11-16)
The ER-X (edge-01) is out of the path. The two RB5009s and the CRS309 run the configs rendered from their Terraform roots, and tofu-controller manages all three with
approvePlan: auto. Each reports No drift / Plan no changes. The ER-X stays racked with no LAN cables as the fallback.Bench (before the swap)
render/load.shover the recovery ports.Swap
Found and fixed on the day
caosh.int.animeteamspeak.moe; the ER-X handed out none. Pods (ndots:5) plus the public*.animeteamspeak.moewildcard resolved every external name to our own IP, so cloudflare-ddns and every new pod lost the internet. Removed live and in IaC. The wildcard follow-up is clusters#1708.ether2and lacked the PPPoE client. Regenerated from a PPPoE render.sys/mounts/pki-net-caosh.pki-net-routeros-issuenow has read on that one mount path.Adoption
Import blocks were removed again (#129-#132), and approvePlan went back to auto (clusters#1709-#1712).
Operational note: never approve both routers' plans at once. The #74 fuse refuses to arm one router while the other is armed. That check stopped a parallel approval on the day, and a sequential retry applied cleanly.
Follow-ups