From 60460ce8c33c09ea7747a2ee3afded212f656b62 Mon Sep 17 00:00:00 2001 From: Astrid Yu Date: Tue, 9 Apr 2024 00:59:39 -0700 Subject: [PATCH] bonding via systemd-networkd --- .gitignore | 1 + machines/boop/net.nix | 46 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/.gitignore b/.gitignore index 104bef5e..68c2a51f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ kubeconfig .env matrix.json result +result-* .direnv *.iso *.tar diff --git a/machines/boop/net.nix b/machines/boop/net.nix index 935ed5bc..344a8c93 100644 --- a/machines/boop/net.nix +++ b/machines/boop/net.nix @@ -2,4 +2,50 @@ let constants = import ./constants.nix; in { networking.useDHCP = false; networking.interfaces.${constants.mgmt_if}.useDHCP = true; + + systemd.network = { + enable = true; + + netdevs."10-prod-vlan-100" = { + netdevConfig = { + Name = "prod-vlan"; + Kind = "vlan"; + Description = "Public prod traffic VLAN"; + }; + vlanConfig.Id = 100; + }; + networks."10-bond-enos" = { + name = "eno2 eno3 eno4"; + matchConfig.Type = "ether"; + networkConfig.Description = "Primary ethernet devices"; + bond = [ "bond007" ]; + }; + netdevs."20-bond007" = { + netdevConfig = { + Name = "bond007"; + Kind = "bond"; + Description = "Bond of primary ethernet devices"; + }; + bondConfig = { + Mode = "802.3ad"; + LACPTransmitRate = "fast"; + }; + }; + networks."20-bond007" = { + name = "bond007"; + matchConfig.Type = "bond"; + networkConfig = { + Description = "Bond of primary ethernet devices"; + VLAN = [ "prod-vlan" ]; + LinkLocalAddressing = "no"; + LLDP = "no"; + IPv6AcceptRA = "no"; + }; + }; + networks."20-bond-prod-vlan" = { + name = "prod-vlan"; + matchConfig.Type = "vlan"; + networkConfig.Description = "VLAN of prod traffic over the bond"; + }; + }; }