ConfigureMikrotikVlans

Phase 3e helper: push VLAN-aware bridge + LACP bond + WiFi SSIDs to the upstream Mikrotik (hAP ax2 in the Liberator topology) via RouterOS REST API v7.

Note

Idempotent, drift-correcting: run every netsetup update cycle. Re-applying the same config = no-op. Manual WebFig changes get reverted to desired state.

Target state (see docs/Liberator.adoc):

  • bridge VLAN-aware on, VLANs 10/20/250/254

  • bonding1 LACP 802.3ad slaves=ether2,ether3, trunk tagged on bond

  • ether1 WAN untagged DHCP, ether4+ether5 access VLAN20 untagged

  • WiFi: Liberator(20), Liberator-Guest(254 open), admin-oob-lib(250 hidden WPA3)

  • Mikrotik mgmt IP VLAN250 .1

  • remove flat NAT, disable Mikrotik DHCP server

Gated by NETSetup.Helpers.LiberatorGate.IsFullLiberatorFlow(ISystemHost,NETSetup.Entities.NETSetupConfig): only runs on hosts that have an OPNsense VM in config (canonical Liberator master signal).

public static class ConfigureMikrotikVlans

1. Methods

1.1. Run(ISystemHost, NETSetupConfig, IServiceProvider)

Pushes the desired VLAN topology to the upstream Mikrotik via REST API.

public static void Run(ISystemHost host, NETSetupConfig config, IServiceProvider services)
Table 1. Parameters
Name Type Description

host

ISystemHost

config

NETSetupConfig

services

IServiceProvider