From 3c445ab4c700903fefaa9599fb56459513226dcf Mon Sep 17 00:00:00 2001 From: sinavir Date: Thu, 17 Oct 2024 17:54:54 +0200 Subject: [PATCH] feat(networking): Add a bridge to connect VMs to the world --- machines/krz01/_configuration.nix | 5 +++-- machines/krz01/networking.nix | 22 ++++++++++++++++++++++ meta/network.nix | 3 ++- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 machines/krz01/networking.nix diff --git a/machines/krz01/_configuration.nix b/machines/krz01/_configuration.nix index e37d0a5..2323df4 100644 --- a/machines/krz01/_configuration.nix +++ b/machines/krz01/_configuration.nix @@ -8,12 +8,13 @@ lib.extra.mkConfig { enabledServices = [ # INFO: This list needs to stay sorted alphabetically # Machine learning API machine - "microvm-ml01" - "microvm-router01" + # "microvm-ml01" + # "microvm-router01" "nvidia-tesla-k80" "ollama" "whisper" "proxmox" + "networking" ]; extraConfig = { diff --git a/machines/krz01/networking.nix b/machines/krz01/networking.nix new file mode 100644 index 0000000..cc41276 --- /dev/null +++ b/machines/krz01/networking.nix @@ -0,0 +1,22 @@ +{ + systemd.networknetworks = { + "10-eno1" = { + matchConfig.Name = [ "eno1" ]; + networkConfig = { + Bridge = "vmbr0"; + }; + }; + + "10-vmbr0" = { + matchConfig.Name = "vmbr0"; + linkConfig.RequiredForOnline = "routable"; + }; + }; + + systemd.network.netdevs."vmbr0" = { + netdevConfig = { + Name = "vmbr0"; + Kind = "bridge"; + }; + }; +} diff --git a/meta/network.nix b/meta/network.nix index 29da555..b72f4d5 100644 --- a/meta/network.nix +++ b/meta/network.nix @@ -31,7 +31,8 @@ krz01 = { interfaces = { - eno1 = { + # see also machines/krz01/networking.nix + vmbr0 = { ipv4 = [ { address = "129.199.146.21";