From c81f2d3b73469e1ea2ab365d4d4ce438675cc232 Mon Sep 17 00:00:00 2001 From: sinavir Date: Fri, 18 Oct 2024 09:27:24 +0200 Subject: [PATCH] feat(krz01/networking): Add a bridge to connect VMs to the world --- machines/krz01/_configuration.nix | 1 + machines/krz01/networking.nix | 24 ++++++++++++++++++++++++ meta/network.nix | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 machines/krz01/networking.nix diff --git a/machines/krz01/_configuration.nix b/machines/krz01/_configuration.nix index e501401..2323df4 100644 --- a/machines/krz01/_configuration.nix +++ b/machines/krz01/_configuration.nix @@ -14,6 +14,7 @@ lib.extra.mkConfig { "ollama" "whisper" "proxmox" + "networking" ]; extraConfig = { diff --git a/machines/krz01/networking.nix b/machines/krz01/networking.nix new file mode 100644 index 0000000..f862607 --- /dev/null +++ b/machines/krz01/networking.nix @@ -0,0 +1,24 @@ +{ + systemd.network = { + networks = { + "10-eno1" = { + matchConfig.Name = [ "eno1" ]; + networkConfig = { + Bridge = "vmbr0"; + }; + }; + + "10-vmbr0" = { + matchConfig.Name = "vmbr0"; + linkConfig.RequiredForOnline = "routable"; + }; + }; + + netdevs."vmbr0" = { + netdevConfig = { + Name = "vmbr0"; + Kind = "bridge"; + }; + }; + }; +} diff --git a/meta/network.nix b/meta/network.nix index 4d2043a..7bcaac6 100644 --- a/meta/network.nix +++ b/meta/network.nix @@ -1,7 +1,7 @@ { krz01 = { interfaces = { - eno1 = { + vmbr0 = { ipv4 = [ { address = "129.199.146.21";