LiberatorNetwork

Liberator network constants - single source of truth for IPs/VLANs/bridge names on the Liberator Proxmox stack. No literal IPs/CIDRs/VLAN ids in templates or helpers - always go through this class (see CLAUDE.md "no hardcoded magic values").

Note

Two-phase IP plan for the Proxmox host (see docs/Liberator.adoc):

  • Phase 1 (bootstrap, fresh install via answer.toml): Proxmox lives on the Mikrotik LAN at ProxmoxBootstrapIp/24 with gateway MikrotikLanIp. The Mikrotik is at factory MikrotikLanIp/24. NixDns does not exist yet → Mikrotik forwards DNS upstream until EnsureNixDnsNameserverIfHealthy promotes NixDns.

  • Phase 2 (post-converge, every update cycle): ConfigureProxmoxBridges re-IPs the Proxmox host onto VLAN 250 mgmt at ProxmoxMgmtIp/24 with gateway MikrotikMgmtIp. Mikrotik becomes pure L2 trunk; NixDns owns name resolution (NixDns answers a 'proxmox' A-record via NixTemplateFactory).

public static class LiberatorNetwork

1. Fields

1.1. BondName

LACP bond device name on the Proxmox host.

public const string BondName

1.2. BridgeName

VLAN-aware Linux bridge on the Proxmox host (trunks bond0).

public const string BridgeName

1.3. MgmtCidr

CIDR suffix for the mgmt VLAN segment (10.0.250.0/24).

public const string MgmtCidr

1.4. MgmtVlanId

Mgmt VLAN id (matches MikrotikDesiredStateBuilder VLAN 250 + Liberator vlan map).

public const int MgmtVlanId

1.5. MgmtVlanInterface

Linux bridge sub-interface name for the mgmt VLAN (Proxmox vmbrXvY naming).

public const string MgmtVlanInterface

1.6. MikrotikLanCidr

CIDR suffix for the Mikrotik LAN segment (10.0.0.0/24).

public const string MikrotikLanCidr

1.7. MikrotikLanIp

Mikrotik factory IP on its LAN bridge (matches NETSetupMikrotik fixed default).

public static readonly IP MikrotikLanIp

1.8. MikrotikMgmtIp

Mikrotik mgmt IP on VLAN 250 (matches MikrotikDesiredStateBuilder mgmt spec).

public static readonly IP MikrotikMgmtIp

1.9. ProxmoxBootstrapIp

Proxmox install-time IP - bootstrap on Mikrotik LAN before VLAN cutover.

public static readonly IP ProxmoxBootstrapIp

1.10. ProxmoxMgmtIp

Proxmox post-converge IP - mgmt VLAN 250.

public static readonly IP ProxmoxMgmtIp

2. Properties

2.1. BootstrapOverride

Test-bench override for the Phase 1 bootstrap network. When non-null, the Liberator gate in ProxmoxAutoInstallExtensions.ToProxmoxAutoInstall uses the override values instead of ProxmoxBootstrapIp / MikrotikLanIp / MikrotikLanCidr. Production leaves this null - real Liberator boxes always boot on the Mikrotik LAN. The Hyper-V e2e Liberator test sets this from VirtualHyperVTestBase.EnsureFreeIP so the Proxmox VM boots reachable from the test runner (test bench has no Mikrotik at 10.0.0.1). Test cleanup MUST reset to null.

public static Func<(IP Ip, IP Gateway, string Cidr)> BootstrapOverride { get; set; }