From 7a3f214944339b6674a82b6fc9bd1592796c20cc Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 15 Aug 2021 22:02:51 +0000 Subject: [PATCH] ops/nixos: switch to VLANs for uplink to veloxserv --- ops/nixos/lib/blade-router.nix | 13 +++++++++++-- ops/nixos/lib/blade.nix | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ops/nixos/lib/blade-router.nix b/ops/nixos/lib/blade-router.nix index 9fed9d5fa3..36ff1ee107 100644 --- a/ops/nixos/lib/blade-router.nix +++ b/ops/nixos/lib/blade-router.nix @@ -56,6 +56,15 @@ with lib; boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1; networking = { + vlans.vl-transit = { + id = 100; + interface = "en-internet"; + }; + vlans.vl-linx = { + id = 200; + interface = "en-internet"; + }; + interfaces.br-public.ipv4.addresses = [{ address = config.my.blade-router.addresses.br-public.v4.addr; prefixLength = config.my.blade-router.addresses.br-public.v4.prefixLength; @@ -64,11 +73,11 @@ with lib; address = config.my.blade-router.addresses.br-public.v6.addr; prefixLength = config.my.blade-router.addresses.br-public.v6.prefixLength; }]; - interfaces.en-internet.ipv4.addresses = [{ + interfaces.vl-transit.ipv4.addresses = [{ address = config.my.blade-router.addresses.linknet.v4.local; prefixLength = config.my.blade-router.addresses.linknet.v4.prefixLength; }]; - interfaces.en-internet.ipv6.addresses = [{ + interfaces.vl-transit.ipv6.addresses = [{ address = config.my.blade-router.addresses.linknet.v6.local; prefixLength = config.my.blade-router.addresses.linknet.v6.prefixLength; }]; diff --git a/ops/nixos/lib/blade.nix b/ops/nixos/lib/blade.nix index 0e48c99e96..508385bdf5 100644 --- a/ops/nixos/lib/blade.nix +++ b/ops/nixos/lib/blade.nix @@ -117,7 +117,7 @@ in { nat = lib.optionalAttrs (config.my.blade.macAddress.internet != null) { enable = true; internalInterfaces = [ "br-mgmt" ]; - externalInterface = "en-internet"; + externalInterface = "vl-transit"; }; }; services.udev.extraRules = ''