mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-12-30 12:18:23 +01:00
topology: extend some more
This commit is contained in:
@@ -52,11 +52,27 @@ in {
|
||||
|
||||
nodes.ntnu-pvv-router = mkRouter "NTNU PVV Gateway" {
|
||||
interfaceGroups = [ ["wan1"] ["eth1"] ];
|
||||
connections.eth1 = mkConnection "brus-switch" "eth0";
|
||||
connections.eth1 = mkConnection "knutsen" "em1";
|
||||
interfaces.eth1.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.brus-switch = mkSwitch "Brus Switch" {
|
||||
nodes.knutsen = mkRouter "knutsen" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg";
|
||||
|
||||
interfaceGroups = [ ["em0"] ["em1"] ["vpn1"] ];
|
||||
|
||||
connections.em0 = mkConnection "nintendo" "eth0";
|
||||
|
||||
# connections.vpn1 = mkConnection "ludvigsen" "vpn1";
|
||||
interfaces.vpn1.network = "site-vpn";
|
||||
interfaces.vpn1.virtual = true;
|
||||
interfaces.vpn1.icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/openvpn.svg";
|
||||
|
||||
interfaces.em0.network = "pvv";
|
||||
interfaces.em1.network = "ntnu";
|
||||
};
|
||||
|
||||
nodes.nintendo = mkSwitch "Nintendo (brus switch)" {
|
||||
interfaceGroups = [ (lib.genList (i: "eth${toString i}") 16) ];
|
||||
|
||||
connections = let
|
||||
@@ -64,7 +80,7 @@ in {
|
||||
(mkConnection "bekkalokk" "enp2s0")
|
||||
# (mkConnection "bicep" "enp6s0f0") # NOTE: physical machine is dead at the moment
|
||||
(mkConnection "buskerud" "eth1")
|
||||
(mkConnection "knutsen" "eth1")
|
||||
# (mkConnection "knutsen" "eth1")
|
||||
(mkConnection "powerpuff-cluster" "eth1")
|
||||
(mkConnection "lupine-1" "enp0s31f6")
|
||||
(mkConnection "lupine-2" "enp0s31f6")
|
||||
@@ -73,11 +89,13 @@ in {
|
||||
(mkConnection "lupine-5" "enp0s31f6")
|
||||
(mkConnection "innovation" "em0")
|
||||
(mkConnection "microbel" "eth0")
|
||||
# (mkConnection "isvegg" "")
|
||||
(mkConnection "isvegg" "eth0")
|
||||
(mkConnection "ameno" "eth0")
|
||||
(mkConnection "sleipner" "eno0")
|
||||
];
|
||||
in builtins.listToAttrs (
|
||||
in
|
||||
assert (lib.length connections' <= 15);
|
||||
builtins.listToAttrs (
|
||||
lib.zipListsWith
|
||||
(a: b: lib.nameValuePair a b)
|
||||
(lib.genList (i: "eth${toString (i + 1)}") 15)
|
||||
@@ -85,61 +103,86 @@ in {
|
||||
);
|
||||
};
|
||||
|
||||
nodes.knutsen = mkRouter "knutsen" {
|
||||
interfaceGroups = [ ["eth1"] ["eth2"] ["vpn1"] ];
|
||||
connections.eth2 = mkConnectionRev "brus-switch" "eth6";
|
||||
# connections.vpn1 = mkConnection "ludvigsen" "vpn1";
|
||||
interfaces.vpn1.network = "site-vpn";
|
||||
interfaces.vpn1.virtual = true;
|
||||
};
|
||||
|
||||
nodes.buskerud = mkDevice "buskerud" {
|
||||
interfaceGroups = [ ["eth1"] ];
|
||||
deviceIcon = ./icons/proxmox.svg;
|
||||
interfaceGroups = [ [ "eth1" ] ];
|
||||
|
||||
interfaces.eth1.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.shark = {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.buskerud.id;
|
||||
|
||||
interfaces.ens18.network = "pvv";
|
||||
};
|
||||
|
||||
### Powerpuff
|
||||
|
||||
nodes.powerpuff-cluster = mkDevice "powerpuff-cluster" {
|
||||
interfaceGroups = [ ["eth1"] ];
|
||||
nodes.powerpuff-cluster = mkDevice "Powerpuff Cluster" {
|
||||
deviceIcon = ./icons/proxmox.svg;
|
||||
|
||||
hardware.info = "Dell PowerEdge R730 x 3";
|
||||
|
||||
interfaceGroups = [ [ "eth1" ] ];
|
||||
};
|
||||
|
||||
nodes.kommode = {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
|
||||
interfaces.ens18.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.bicep = {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
|
||||
# hardware.info = "HP Proliant DL370G6";
|
||||
|
||||
interfaces.ens18.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.ustetind = {
|
||||
guestType = "proxmox";
|
||||
guestType = "proxmox LXC";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
# interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
network = "pvv";
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.234"
|
||||
"2001:700:300:1900::234"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
### PVV
|
||||
|
||||
nodes.ntnu-veggen = mkRouter "NTNU-Veggen" {
|
||||
interfaceGroups = [ ["wan1"] ["eth1"] ];
|
||||
connections.eth1 = mkConnection "ludvigsen" "eth1";
|
||||
connections.eth1 = mkConnection "ludvigsen" "re0";
|
||||
};
|
||||
|
||||
nodes.ludvigsen = mkRouter "ludvigsen" {
|
||||
interfaceGroups = [ ["eth1"] ["eth2"] ["vpn1"] ];
|
||||
connections.eth2 = mkConnection "pvv-switch" "eth0";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg";
|
||||
|
||||
interfaceGroups = [ [ "re0" ] [ "em0" ] [ "vpn1" ] ];
|
||||
|
||||
connections.em0 = mkConnection "pvv-switch" "eth0";
|
||||
|
||||
interfaces.vpn1.network = "site-vpn";
|
||||
interfaces.vpn1.virtual = true;
|
||||
interfaces.vpn1.icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/openvpn.svg";
|
||||
|
||||
interfaces.eth1.network = "ntnu";
|
||||
interfaces.eth2.network = "pvv";
|
||||
interfaces.re0.network = "ntnu";
|
||||
interfaces.em0.network = "pvv";
|
||||
};
|
||||
|
||||
nodes.pvv-switch = mkSwitch "PVV Switch (Terminalrommet)" {
|
||||
@@ -151,11 +194,15 @@ in {
|
||||
(mkConnection "wegonke" "enp4s0")
|
||||
(mkConnection "demiurgen" "eno1")
|
||||
(mkConnection "sanctuary" "ethernet_0")
|
||||
# (mkConnection "torskas" "")
|
||||
# (mkConnection "skrott" "")
|
||||
# (mkConnection "principal" "")
|
||||
(mkConnection "torskas" "eth0")
|
||||
(mkConnection "skrott" "eth0")
|
||||
(mkConnection "homeassistant" "eth0")
|
||||
(mkConnection "orchid" "eth0")
|
||||
(mkConnection "principal" "em0")
|
||||
];
|
||||
in builtins.listToAttrs (
|
||||
in
|
||||
assert (lib.length connections' <= 15);
|
||||
builtins.listToAttrs (
|
||||
lib.zipListsWith
|
||||
(a: b: lib.nameValuePair a b)
|
||||
(lib.genList (i: "eth${toString (i + 1)}") 15)
|
||||
@@ -167,19 +214,27 @@ in {
|
||||
### Openstack
|
||||
|
||||
nodes.stackit = mkDevice "stackit" {
|
||||
interfaceGroups = [ ["*"] ];
|
||||
interfaceGroups = [ [ "*" ] ];
|
||||
|
||||
interfaces."*".network = "ntnu";
|
||||
};
|
||||
|
||||
nodes.ildkule = {
|
||||
guestType = "openstack";
|
||||
parent = config.nodes.stackit.id;
|
||||
|
||||
interfaces.ens4.network = "ntnu";
|
||||
};
|
||||
nodes.wenche = {
|
||||
guestType = "openstack";
|
||||
parent = config.nodes.stackit.id;
|
||||
|
||||
interfaces.ens18.network = "pvv";
|
||||
};
|
||||
nodes.bakke = {
|
||||
guestType = "openstack";
|
||||
parent = config.nodes.stackit.id;
|
||||
|
||||
interfaces.enp2s0.network = "pvv";
|
||||
};
|
||||
}
|
||||
|
||||
5
topology/icons/proxmox.svg
Normal file
5
topology/icons/proxmox.svg
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="512" cy="512" r="512" style="fill:#e57000"/>
|
||||
<path d="M512 497.8 342.7 311.6c6.6-6.6 14.2-11.7 22.9-15.5 8.7-3.8 18.1-5.7 28.1-5.7 10.7.1 20.4 2.2 29.3 6.3 8.9 4.1 16.6 9.8 23.1 17l65.8 71.9 65.4-71.9c6.8-7.2 14.7-12.9 23.6-17 9-4.1 18.7-6.2 29.2-6.3 10 .1 19.4 2 28.1 5.7 8.7 3.8 16.4 8.9 22.9 15.5L512 497.8m0 28.4L342.7 712.4c6.6 6.6 14.2 11.7 22.9 15.5 8.7 3.8 18.1 5.7 28.1 5.7 10.5-.1 20.2-2.2 29.2-6.3s16.9-9.8 23.6-17l65.4-71.9 65.8 71.9c6.5 7.2 14.2 12.9 23.1 17 8.9 4.1 18.6 6.2 29.3 6.3 10-.1 19.4-2 28.1-5.7 8.7-3.8 16.4-8.9 22.9-15.5L512 526.2M497.8 512 370.3 372.2c-7.4-7.9-16-14.1-25.9-18.7-9.8-4.5-20.5-6.8-31.9-6.9-11 .1-21.3 2.2-30.8 6.3-9.6 4.1-17.9 9.8-25.1 16.9L385.9 512 256.5 654.2c7.2 7.4 15.6 13.2 25.1 17.4 9.6 4.2 19.8 6.3 30.8 6.3 11.5-.1 22.2-2.4 32.1-6.9 9.9-4.5 18.5-10.8 25.7-18.7L497.8 512m28.4 0 127.5 140.3c7.2 7.9 15.8 14.1 25.7 18.7 9.9 4.5 20.6 6.8 32.1 6.9 11-.1 21.3-2.2 30.8-6.3 9.6-4.2 17.9-9.9 25.1-17.4L638.1 512l129.4-142.2c-7.2-7.2-15.6-12.8-25.1-16.9-9.6-4.1-19.8-6.2-30.8-6.3-11.4.1-22.1 2.4-31.9 6.9-9.8 4.5-18.5 10.8-25.9 18.7L526.2 512" style="fill:#fff"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -9,6 +9,7 @@ in {
|
||||
|
||||
interfaceGroups = [ [ "ens18" ] ];
|
||||
interfaces.ens18 = {
|
||||
network = "pvv";
|
||||
mac = "00:0c:29:de:05:0f";
|
||||
addresses = [
|
||||
"129.241.210.192"
|
||||
@@ -29,6 +30,7 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes.tom = mkDevice "tom" {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
@@ -36,6 +38,7 @@ in {
|
||||
|
||||
interfaceGroups = [ [ "ens18" ] ];
|
||||
interfaces.ens18 = {
|
||||
network = "pvv";
|
||||
mac = "00:0c:29:4d:f7:56";
|
||||
addresses = [
|
||||
"129.241.210.180"
|
||||
@@ -55,6 +58,7 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes.hildring = mkDevice "hildring" {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
@@ -63,6 +67,7 @@ in {
|
||||
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
network = "pvv";
|
||||
mac = "00:0c:29:e7:dd:79";
|
||||
addresses = [
|
||||
"129.241.210.176"
|
||||
@@ -74,11 +79,28 @@ in {
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.drolsum = mkDevice "drolsum" {
|
||||
guestType = "proxmox";
|
||||
parent = config.nodes.powerpuff-cluster.id;
|
||||
deviceType = "loginbox";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
network = "pvv";
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.217"
|
||||
"2001:700:300:1900::217"
|
||||
"2001:700:300:1900::1:217"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.microbel = mkDevice "microbel" {
|
||||
@@ -99,6 +121,7 @@ in {
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.innovation = mkDevice "innovation" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg";
|
||||
|
||||
@@ -125,11 +148,45 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes.principal = mkDevice "principal" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/freebsd.svg";
|
||||
|
||||
interfaceGroups = [ [ ] ];
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "em0" ] ];
|
||||
interfaces.em0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.233"
|
||||
"2001:700:300:1900::1:233"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.homeassistant = mkDevice "homeassistant" {
|
||||
deviceIcon = "services.home-assistant";
|
||||
|
||||
hardware.info = "Raspberry Pi 4B";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.229"
|
||||
"2001:700:300:1900::4:229"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.sleipner = mkDevice "sleipner" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
@@ -146,11 +203,25 @@ in {
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.isvegg = mkDevice "isvegg" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
interfaceGroups = [ [ ] ];
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.175"
|
||||
"2001:700:300:1900::1:a"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.ameno = mkDevice "ameno" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/ubuntu.svg";
|
||||
|
||||
@@ -178,14 +249,42 @@ in {
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nodes.skrott = mkDevice "skrott" {
|
||||
interfaceGroups = [ [ ] ];
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.235"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.torskas = mkDevice "torskas" {
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/arch_linux.svg";
|
||||
|
||||
interfaceGroups = [ [ ] ];
|
||||
hardware.info = "Raspberry pi 4B";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
# mac = "";
|
||||
addresses = [
|
||||
"129.241.210.241"
|
||||
"2001:700:300:1900::241"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.wegonke = mkDevice "wegonke" {
|
||||
deviceType = "terminal";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
@@ -205,6 +304,7 @@ in {
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.demiurgen = mkDevice "demiurgen" {
|
||||
deviceType = "terminal";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
@@ -239,4 +339,24 @@ in {
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nodes.orchid = mkDevice "orchid" {
|
||||
deviceType = "terminal";
|
||||
deviceIcon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/debian.svg";
|
||||
|
||||
hardware.info = "Ryzen1600 Nvidia GTX 1060";
|
||||
|
||||
# TODO: the interface name is likely wrong
|
||||
interfaceGroups = [ [ "eth0" ] ];
|
||||
interfaces.eth0 = {
|
||||
addresses = [
|
||||
"129.241.210.210"
|
||||
"2001:700:300:1900::210"
|
||||
];
|
||||
gateways = [
|
||||
values.hosts.gateway
|
||||
values.hosts.gateway6
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user