diff --git a/nixos/boxes/home/palace/default.nix b/nixos/boxes/home/palace/default.nix index b40a906..665203c 100644 --- a/nixos/boxes/home/palace/default.nix +++ b/nixos/boxes/home/palace/default.nix @@ -126,9 +126,9 @@ in }; linkConfig.Name = "et1g0"; }; - "10-lan-core" = { + "10-lan-core-phy" = { matchConfig.PermanentMACAddress = "e0:d5:5e:68:0c:70"; - linkConfig.Name = "lan-core"; + linkConfig.Name = "lan-core-phy"; }; "10-et100g" = { matchConfig = { @@ -145,6 +145,12 @@ in netdevs = mkMerge [ (mkVLAN "lan-hi" vlans.hi) (mkVLAN "lan-lo-phy" vlans.lo) + { + "25-lan-core".netdevConfig = { + Name = "lan-core"; + Kind = "bridge"; + }; + } { "25-lan-lo".netdevConfig = { Name = "lan-lo"; @@ -199,6 +205,12 @@ in }; "60-lan-hi" = networkdAssignment "lan-hi" assignments.hi; + "50-lan-core-phy" = { + matchConfig.Name = "lan-core-phy"; + networkConfig = { + Bridge = "lan-core"; + } // networkd.noL3; + }; "50-lan-lo-phy" = { matchConfig.Name = "lan-lo-phy"; networkConfig = { diff --git a/nixos/boxes/home/palace/vms/default.nix b/nixos/boxes/home/palace/vms/default.nix index bb3985c..ea1ab00 100644 --- a/nixos/boxes/home/palace/vms/default.nix +++ b/nixos/boxes/home/palace/vms/default.nix @@ -172,11 +172,19 @@ }; memory = 32768; cleanShutdown.timeout = 120; - networks.netboot = { - bridge = "lan-lo"; - waitOnline = "carrier"; - mac = "52:54:00:a5:7e:93"; - extraOptions.bootindex = 1; + networks = { + netboot = { + bridge = "lan-lo"; + waitOnline = "carrier"; + mac = "52:54:00:a5:7e:93"; + extraOptions.bootindex = 1; + }; + core = { + bridge = "lan-core"; + ifname = "vm-sfh-core"; + waitOnline = "carrier"; + mac = "52:54:00:72:67:51"; + }; }; hostDevices = { et100g0vf2 = { diff --git a/nixos/boxes/home/palace/vms/sfh/containers/default.nix b/nixos/boxes/home/palace/vms/sfh/containers/default.nix index 6dae711..5df1a18 100644 --- a/nixos/boxes/home/palace/vms/sfh/containers/default.nix +++ b/nixos/boxes/home/palace/vms/sfh/containers/default.nix @@ -1,6 +1,6 @@ { imports = [ - # ./unifi.nix + ./unifi.nix ./hass.nix ]; } diff --git a/nixos/boxes/home/palace/vms/sfh/containers/unifi.nix b/nixos/boxes/home/palace/vms/sfh/containers/unifi.nix index 285fe90..0e5429e 100644 --- a/nixos/boxes/home/palace/vms/sfh/containers/unifi.nix +++ b/nixos/boxes/home/palace/vms/sfh/containers/unifi.nix @@ -24,6 +24,15 @@ in address = net.cidr.host (65536*5+1) prefixes.hi.v6; }; }; + core = { + inherit domain; + name = "unifi-ctr-core"; + mtu = 1500; + ipv4 = { + address = net.cidr.host 21 prefixes.core.v4; + gateway = null; + }; + }; }; configuration = { lib, config, pkgs, assignments, ... }: @@ -48,7 +57,10 @@ in }; systemd = { - network.networks."80-container-host0" = networkdAssignment "host0" assignments.hi; + network.networks = { + "80-container-host0" = networkdAssignment "host0" assignments.hi; + "80-lan-core" = networkdAssignment "lan-core" assignments.core; + }; }; services = { diff --git a/nixos/boxes/home/palace/vms/sfh/default.nix b/nixos/boxes/home/palace/vms/sfh/default.nix index 2d45d0c..181a3d7 100644 --- a/nixos/boxes/home/palace/vms/sfh/default.nix +++ b/nixos/boxes/home/palace/vms/sfh/default.nix @@ -111,6 +111,13 @@ in MTUBytes = toString lib.my.c.home.hiMTU; }; }; + "10-lan-core-ctrs" = { + matchConfig = { + Driver = "virtio_net"; + PermanentMACAddress = "52:54:00:72:67:51"; + }; + linkConfig.Name = "lan-core-ctrs"; + }; "10-lan-lo-ctrs" = { matchConfig = { Driver = "virtio_net"; @@ -131,6 +138,11 @@ in linkConfig.RequiredForOnline = "no"; networkConfig = networkd.noL3; }; + "30-lan-core-ctrs" = { + matchConfig.Name = "lan-core-ctrs"; + linkConfig.RequiredForOnline = "no"; + networkConfig = networkd.noL3; + }; "30-lan-lo-ctrs" = { matchConfig.Name = "lan-lo-ctrs"; linkConfig.RequiredForOnline = "no"; @@ -145,6 +157,11 @@ in MACVLAN = mkForce "lan-hi-ctrs:host0 lan-lo-ctrs:lan-lo"; }; }; + unifi = { + networkConfig = { + MACVLAN = mkForce "lan-hi-ctrs:host0 lan-core-ctrs:lan-core"; + }; + }; }; systemd.services = { @@ -174,7 +191,7 @@ in containers.instances = let instances = { - # unifi = {}; + unifi = {}; hass = { bindMounts = { "/dev/bus/usb/001/002".readOnly = false; diff --git a/nixos/boxes/home/routing-common/dns.nix b/nixos/boxes/home/routing-common/dns.nix index 83d1537..1a80c61 100644 --- a/nixos/boxes/home/routing-common/dns.nix +++ b/nixos/boxes/home/routing-common/dns.nix @@ -223,6 +223,7 @@ in dave-lo IN AAAA ${net.cidr.host (65536+2) prefixes.lo.v6} shytzel IN A ${net.cidr.host 12 prefixes.core.v4} + brian IN A ${net.cidr.host 13 prefixes.core.v4} wave IN A ${net.cidr.host 12 prefixes.hi.v4} ; wave IN AAAA ${net.cidr.host (65536+3) prefixes.hi.v6}