Router config as OpenTofu (terraform-routeros) via tofu-controller #45
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac#45
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 lab/iac#43.
Chosen over the KCL->rsc->netinstall pattern after an independent review: incremental changes over the RouterOS REST API,
tofu planas drift detection, broad coverage (firewall, NAT, DHCP, DNS, WireGuard, BGP, PoE, bridge VLANs), native fit for the existing tofu-controller. nix-routeros is too thin to depend on (no VLAN/WireGuard/BGP modules).Caveats from the review: existing singletons need
importblocks or*_settingsresources; ordered firewall rules needplace_before/routeros_move_items; state holds secrets (encrypt it; OpenBao later); keep a periodic/exportdiff as a backstop for unmanaged config.Done when
plancleanMigration inventory: what the ER-X (
edge-01/lab-erx-01, EdgeRouter X SFP, EdgeOS 3.0.1) runs today. Read-only pull ofshow configuration commandsplus live state, 2026-11-06. Secrets left out.WAN
firewall options mss-clamp interface-type pppoe). Session stable 5d+.pppoe0(rule 5010). Hardware NAT offload on.dhcpv6-pdon eth0 is dead config: Bell has no residential IPv6.WAN_IN/WAN_LOCAL= allow established/related, drop invalid, default drop. IPv6 equivalents unused.LAN (switch0, VLAN-aware, eth1-eth4)
Port roles: eth1, eth3 trunk all VLANs; eth2, eth4 PVID 1001 (Management untagged) + tagged others; eth2 no link.
Keep these subnets on the RB5009s. OpenBao TLS, Raft
retry_joinand AppRolesecret_id_bound_cidrs(lab/machine-configs#3, #8) bind to host addresses; same subnets = router-agnostic.DHCP (dnsmasq)
int.) is not implemented; do it here instead of on EdgeOS.bootfile-server 10.10.2.4,pxelinux.0. Nothing routes 10.10.2.x.Routing
10.10.6.x/32,10.44.0.0/24).10.8.0.0/24 via 10.10.5.7(wireguard-kube, distance 2): 10.10.5.7 is not on any connected network, so it resolves via the default route outpppoe0. Broken.PBR_MAIL_REDIRECTon switch0: TCP to mail ports from 10.10.1.0/24 -> table 1 -> default via 37.59.107.172 (OVH VPS). Next hop is not on a connected network; probably falls through. Untested.Port forwards (WAN
pppoe0, hairpin NAT on, auto-firewall on)All forwards are
tcp_udpregardless of service.Services on the router
SSH on 1023, GUI 8080/8443 with
older-ciphers, SNMP v2 communitylabro on 10.15.1.1, UPnP on switch0, syslog to 10.10.6.1, NTP ubnt pool, DPI + traffic analysis on, UNMS disabled (stale connection string in config).Fix in the new config, do not copy
ramen: admin with a plaintext password stored in config. Drop it; key-only admin.dhcpv6-pd,ipa-01static host mapping, Pi PXE server 10.10.2.4, UNMS string.4.4.4.4is not a public resolver (8.8.4.4intended?).ginjiruu referenced this issue2026-11-14 01:41:02 +00:00
ginjiruu referenced this issue2026-11-14 01:41:06 +00:00
Done as of the 2026-11-16 adoption. Full router config renders from git (render.py + gate, iac#117/#120/#121), applied and adopted by tofu-controller on crs309/rb5009-a/rb5009-b with approvePlan auto and no drift (iac#129-133, provider fork 1.99.1003). ER-X migration closed with iac#73; DNS/DHCP behaviour follow-ups live in flux-clusters#1708 (wildcard records) and the BGP hardening in iac#125.