RouterOS 001: RouterOS sim via containerlab (mikrotik_chr, RB5009 port names) #63

Closed
opened 2026-11-14 01:41:02 +00:00 by ginjiruu · 3 comments
Owner

Part of #43

Rewritten 2026-11-13. The sim runs on any workstation with containerlab, not on mini. Sim tooling landed with this issue's PR (routeros/sim/, task sim:*).

Decision

  • containerlab >= 0.82, mikrotik_chr kind, using MikroTik's official mikrotik/chr image unchanged (no vrnetlab build). Pinned to the hardware RouterOS version, currently mikrotik/chr:7.25.1.
  • Vagrant was rejected: its box-plus-provisioner model skips the install and boot path that the machine-configs harness exists to test, and it adds nothing for routers.
  • Runs on arch-ws (docker, KVM, nested virt). Mini is optional later, for an unattended CI gate.

Proven on arch-ws (2026-11-13)

  • task sim:up: r1, r2 (RB5009 stand-ins) and isp (PPPoE server) all healthy in about 40 s, event-driven wait (scripts/sim-wait-healthy.sh).
  • RB5009 port names. CHR ether1 belongs to containerlab (management, mgmt VRF). Data NICs are ether2+. routeros/sim/rename.rsc, loaded as each node's startup-config, renames them by default-name: ether1 to clab-mgmt, ether2-9 to ether1-8, ether10 to sfp-sfpplus1. Device config is identical in sim and on hardware. The names survive /system reboot, and the launcher stays healthy.
    • mgmt itself is taken (the VRF), hence clab-mgmt.
  • REST on http://172.31.255.{11,12,2}, admin:admin, RouterOS 7.25.1.

containerlab features that close other tickets

  • startup-config: imports an .rsc over REST and fails the node with RouterOS's own line-numbered error. That is the import half of the round-trip gate (#70).
  • containerlab save writes each node's /export minus the management entries. That is the export half for route B of #70.

Remaining

  • routeros/sim/ Terraform root (#65): local state, endpoints hard-coded to 172.31.255.0/24, per the AGENTS.md simulator exception
  • isp node: PPPoE server config, so both routers' WAN sessions come up
  • LAN segment: a containerlab bridge node shared by r1, r2 and a Linux client, for VRRP (#46) and DHCP checks. The same host bridges let machine-configs harness VMs attach (machine-configs#31).
  • What the sim can't cover, checked on the bench instead: SFP+/DAC behaviour, switch-chip hardware offload, PoE-out.
Part of #43 **Rewritten 2026-11-13.** The sim runs on any workstation with containerlab, not on mini. Sim tooling landed with this issue's PR (`routeros/sim/`, `task sim:*`). ## Decision - **containerlab >= 0.82, `mikrotik_chr` kind**, using MikroTik's official `mikrotik/chr` image unchanged (no vrnetlab build). Pinned to the hardware RouterOS version, currently `mikrotik/chr:7.25.1`. - Vagrant was rejected: its box-plus-provisioner model skips the install and boot path that the machine-configs harness exists to test, and it adds nothing for routers. - Runs on arch-ws (docker, KVM, nested virt). Mini is optional later, for an unattended CI gate. ## Proven on arch-ws (2026-11-13) - `task sim:up`: r1, r2 (RB5009 stand-ins) and isp (PPPoE server) all healthy in about 40 s, event-driven wait (`scripts/sim-wait-healthy.sh`). - **RB5009 port names.** CHR `ether1` belongs to containerlab (management, `mgmt` VRF). Data NICs are ether2+. `routeros/sim/rename.rsc`, loaded as each node's `startup-config`, renames them by `default-name`: ether1 to `clab-mgmt`, ether2-9 to `ether1-8`, ether10 to `sfp-sfpplus1`. Device config is identical in sim and on hardware. The names survive `/system reboot`, and the launcher stays healthy. - `mgmt` itself is taken (the VRF), hence `clab-mgmt`. - REST on `http://172.31.255.{11,12,2}`, admin:admin, RouterOS 7.25.1. ## containerlab features that close other tickets - `startup-config:` imports an `.rsc` over REST and fails the node with RouterOS's own line-numbered error. That is the import half of the round-trip gate (#70). - `containerlab save` writes each node's `/export` minus the management entries. That is the export half for route B of #70. ## Remaining - [ ] `routeros/sim/` Terraform root (#65): local state, endpoints hard-coded to 172.31.255.0/24, per the AGENTS.md simulator exception - [ ] isp node: PPPoE server config, so both routers' WAN sessions come up - [ ] LAN segment: a containerlab `bridge` node shared by r1, r2 and a Linux client, for VRRP (#46) and DHCP checks. The same host bridges let machine-configs harness VMs attach (machine-configs#31). - [ ] What the sim can't cover, checked on the bench instead: SFP+/DAC behaviour, switch-chip hardware offload, PoE-out.
Author
Owner

Consumer: lab/machine-configs#31 puts NixOS harness VMs and RouterOS stand-ins on shared virtual L2 segments (ADR-0011 VIP failover, router reboot vs hosts). It should reuse this rig's image and pinned RouterOS version rather than pin its own. Open point for both: the stand-ins must share L2 with the harness VMs, so where they run (harness host vs mini) matters.

Consumer: lab/machine-configs#31 puts NixOS harness VMs and RouterOS stand-ins on shared virtual L2 segments (ADR-0011 VIP failover, router reboot vs hosts). It should reuse this rig's image and pinned RouterOS version rather than pin its own. Open point for both: the stand-ins must share L2 with the harness VMs, so where they run (harness host vs mini) matters.
ginjiruu changed title from RouterOS 001: Containerized RouterOS (CHR) sim rig on mini to RouterOS 001: RouterOS sim via containerlab (mikrotik_chr, RB5009 port names) 2026-11-14 02:56:23 +00:00
Author
Owner

ADR-0009: the sim's CHRs get OpenBao-issued www-ssl certs from the harness OpenBao (#85), and the provider verifies them against the harness root. No self-signed and no insecure in sim either.

ADR-0009: the sim's CHRs get OpenBao-issued `www-ssl` certs from the harness OpenBao (#85), and the provider verifies them against the harness root. No self-signed and no `insecure` in sim either.
Author
Owner

Done. Sim tooling landed with its PR: routeros/sim/ + task sim:* (mikrotik_chr 7.25.1), 3-server clab lab green (e25c820), used continuously since (bootstrap #64, rollback #74 A-E, parity gates). Reset-slot and failover behavior subsequently proven on real RB5009/crs309 hardware 2026-11-16.

Done. Sim tooling landed with its PR: routeros/sim/ + task sim:* (mikrotik_chr 7.25.1), 3-server clab lab green (e25c820), used continuously since (bootstrap #64, rollback #74 A-E, parity gates). Reset-slot and failover behavior subsequently proven on real RB5009/crs309 hardware 2026-11-16.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lab/iac#63
No description provided.