ConfigureOpnsenseVlans

Phase 3e helper: push multi-VLAN interface config + per-VLAN DHCP + DNS-forwarder
firewall aliases / filter rules to OPNsense via REST API.

Note

Idempotent, drift-correcting: re-pushed every netsetup update cycle. Manual WebUI changes get reverted to the C#-computed desired state.

Target state (see docs/Liberator.adoc):

  • 5 interfaces assigned: vtnet0 WAN (untagged), vtnet1..4 = VLAN 10/20/250/254 children

  • DHCP server per VLAN (10/20/254), static reservations from config.Computers[].MAC

  • DNS forwarder → NixDns .53

  • FW deny-default inter-VLAN; allow VLAN20 → VLAN10 AD/DNS/SMB/print/HTTPS; Guest internet-only

  • NAT outbound

Gated by NETSetup.Helpers.LiberatorGate.IsFullLiberatorFlow(ISystemHost,NETSetup.Entities.NETSetupConfig).

public static class ConfigureOpnsenseVlans

1. Methods

1.1. Run(ISystemHost, NETSetupConfig, IServiceProvider)

Pushes desired OPNsense multi-VLAN config 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