From 76239af20999fe4d5e85e14547fd762c3a5429d1 Mon Sep 17 00:00:00 2001 From: catvayor Date: Mon, 3 Feb 2025 16:35:23 +0100 Subject: [PATCH] refactor(netconf): use dgn-isp for switches --- machines/netconf/netaccess01.nix | 44 +++++----------- machines/netconf/netcore01.nix | 75 ++++++++++---------------- machines/netconf/netcore02.nix | 90 +++++++++----------------------- 3 files changed, 66 insertions(+), 143 deletions(-) diff --git a/machines/netconf/netaccess01.nix b/machines/netconf/netaccess01.nix index 1a7176e..ffdee7a 100644 --- a/machines/netconf/netaccess01.nix +++ b/machines/netconf/netaccess01.nix @@ -2,46 +2,28 @@ # # SPDX-License-Identifier: EUPL-1.2 -let - #TODO: meta - vlansPlan = { - "uplink-cri".id = 223; - - "admin-core" = { - id = 3000; - l3-interface = "irb.0"; - }; - "admin-ap".id = 3001; - "users".id-list = [ - { - begin = 3045; - end = 4094; - } - ]; - - "ap-staging".id = 2000; - "hypervisor".id = 2001; - }; -in { - vlans = vlansPlan; dgn-hardware.model = "EX2300-48P"; + dgn-isp = { + enable = true; + staging-AP = [ + # "ge-0/0/0" + # "ge-0/0/1" + # "ge-0/0/2" + # "ge-0/0/3" + # "ge-0/0/4" + # "ge-0/0/5" + ]; + admin-ip = "fd26:baf9:d250:8000::2001/64"; + }; dgn-interfaces = { - # "ge-0/0/0" = AP-staging; - # "ge-0/0/1" = AP-staging; - # "ge-0/0/2" = AP-staging; - # "ge-0/0/3" = AP-staging; - # "ge-0/0/4" = AP-staging; - # "ge-0/0/5" = AP-staging; - # netcore02 "xe-0/1/0".ethernet-switching = { interface-mode = "trunk"; vlans = [ "all" ]; }; - # management + # debug management "me0".inet.addresses = [ "192.168.42.6/24" ]; - "irb".inet6.addresses = [ "fd26:baf9:d250:8000::2001/64" ]; }; } diff --git a/machines/netconf/netcore01.nix b/machines/netconf/netcore01.nix index 75e2776..9b55856 100644 --- a/machines/netconf/netcore01.nix +++ b/machines/netconf/netcore01.nix @@ -2,54 +2,35 @@ # # SPDX-License-Identifier: EUPL-1.2 -let - #TODO: meta - vlansPlan = { - "uplink-cri".id = 223; - - "admin-core" = { - id = 3000; - l3-interface = "irb.0"; - }; - "admin-ap".id = 3001; - "users".id-list = [ - { - begin = 3045; - end = 4094; - } - ]; - - "ap-staging".id = 2000; - "hypervisor".id = 2001; - }; -in { - vlans = vlansPlan; dgn-hardware.model = "EX2300-48P"; - dgn-interfaces = - let - hypervisor.ethernet-switching = { - interface-mode = "access"; - vlans = [ "hypervisor" ]; - }; - in - { - "xe-0/2/0".ethernet-switching = { - interface-mode = "trunk"; - vlans = [ "all" ]; - }; - - "ge-0/0/0" = hypervisor; - "ge-0/0/1" = hypervisor; - "ge-0/0/2" = hypervisor; - "ge-0/0/3" = hypervisor; - "ge-0/0/4" = hypervisor; - "ge-0/0/5" = hypervisor; - "ge-0/0/6" = hypervisor; - "ge-0/0/7" = hypervisor; - - # management - "me0".inet.addresses = [ "192.168.2.2/24" ]; - "irb".inet6.addresses = [ "fd26:baf9:d250:8000::100f/64" ]; + dgn-isp = { + enable = true; + admin-ip = "fd26:baf9:d250:8000::100f/64"; + }; + dgn-profiles."hypervisor" = { + interfaces = [ + "ge-0/0/0" + "ge-0/0/1" + "ge-0/0/2" + "ge-0/0/3" + "ge-0/0/4" + "ge-0/0/5" + "ge-0/0/6" + "ge-0/0/7" + ]; + configuration.ethernet-switching = { + interface-mode = "access"; + vlans = [ "hypervisor" ]; }; + }; + dgn-interfaces = { + "xe-0/2/0".ethernet-switching = { + interface-mode = "trunk"; + vlans = [ "all" ]; + }; + + # debug management + "me0".inet.addresses = [ "192.168.2.2/24" ]; + }; } diff --git a/machines/netconf/netcore02.nix b/machines/netconf/netcore02.nix index b304fee..a05e1de 100644 --- a/machines/netconf/netcore02.nix +++ b/machines/netconf/netcore02.nix @@ -2,77 +2,38 @@ # # SPDX-License-Identifier: EUPL-1.2 -let - #TODO: meta - vlansPlan = { - "uplink-cri".id = 223; - - "admin-core" = { - id = 3000; - l3-interface = "irb.0"; - }; - "admin-ap".id = 3001; - "users".id-list = [ - { - begin = 3045; - end = 4094; - } - ]; - - "ap-staging".id = 2000; - "hypervisor".id = 2001; - }; - #TODO: additionnal module (always the same for APs) - AP-staging = { - poe = true; - ethernet-switching = { - interface-mode = "access"; - vlans = [ "ap-staging" ]; - }; - }; -in { - vlans = vlansPlan; dgn-hardware.model = "EX2300-48P"; + dgn-isp = { + enable = true; + staging-AP = [ + # "ge-0/0/0" + # "ge-0/0/1" + # "ge-0/0/2" + # "ge-0/0/3" + "ge-0/0/4" + # "ge-0/0/5" + # "ge-0/0/6" + # "ge-0/0/7" + # "ge-0/0/8" + # "ge-0/0/9" + # "ge-0/0/10" + # "ge-0/0/11" + # "ge-0/0/12" + # "ge-0/0/13" + # "ge-0/0/14" + # "ge-0/0/15" + # "ge-0/0/16" + # "ge-0/0/17" + ]; + admin-ip = "fd26:baf9:d250:8000::1001/64"; + }; dgn-interfaces = { - # "ge-0/0/0" = AP-staging; - # "ge-0/0/1" = AP-staging; - # "ge-0/0/2" = AP-staging; - # "ge-0/0/3" = AP-staging; - "ge-0/0/4" = AP-staging; - # "ge-0/0/5" = AP-staging; - # "ge-0/0/6" = AP-staging; - # "ge-0/0/7" = AP-staging; - # "ge-0/0/8" = AP-staging; - # "ge-0/0/9" = AP-staging; - # "ge-0/0/10" = AP-staging; - # "ge-0/0/11" = AP-staging; - # "ge-0/0/12" = AP-staging; - # "ge-0/0/13" = AP-staging; - # "ge-0/0/14" = AP-staging; - # "ge-0/0/15" = AP-staging; - # "ge-0/0/16" = AP-staging; - # "ge-0/0/17" = AP-staging; - # oob "ge-0/0/42".ethernet-switching = { interface-mode = "trunk"; vlans = [ "all" ]; }; - # AP de test - "ge-0/0/43" = { - poe = true; - ethernet-switching = { - interface-mode = "access"; - vlans = [ 4000 ]; - }; - }; - # uplink oob - "ge-0/0/46".ethernet-switching = { - interface-mode = "access"; - vlans = [ 222 ]; - rstp = false; - }; # ilo "ge-0/0/47".ethernet-switching = { interface-mode = "access"; @@ -107,8 +68,7 @@ in vlans = [ "uplink-cri" ]; }; - # management + # debug management "me0".inet.addresses = [ "192.168.42.6/24" ]; - "irb".inet6.addresses = [ "fd26:baf9:d250:8000::1001/64" ]; }; }