From 5b1ff6ef264871be1fb7e14e72a620490edf8fd4 Mon Sep 17 00:00:00 2001 From: Geir Okkenhaug Jerstad Date: Sun, 18 Aug 2024 15:40:05 +0200 Subject: [PATCH] bond network config --- workstation/configuration.nix | 12 +---------- workstation/network.nix | 38 +++++++++++++++++++++++++++++++++++ workstation/network.nix~ | 10 +++++++++ 3 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 workstation/network.nix create mode 100644 workstation/network.nix~ diff --git a/workstation/configuration.nix b/workstation/configuration.nix index f55dd03..b1fc700 100644 --- a/workstation/configuration.nix +++ b/workstation/configuration.nix @@ -182,17 +182,7 @@ ]; - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. + # Enable the OpenSSH daemon. services.openssh.enable = true; # zfs options diff --git a/workstation/network.nix b/workstation/network.nix new file mode 100644 index 0000000..351050a --- /dev/null +++ b/workstation/network.nix @@ -0,0 +1,38 @@ +{ pkgs, configs, ... }: +{ + systemd.network = { + enable = true; + netdevs = { + "10-bond0" = { + netdevConfig = { + Kind = "bond"; + Name = "bond0"; + }; + bondConfig = { + Mode = "802.3ad"; + TransmitHashPolicy = "layer3+4"; + }; + }; + }; + networks = { + "30-enp4s0" = { + matchConfig.Name = "enp4s0"; + DHCP = "ipv4"; + networkConfig.Bond = "bond0"; + }; + "30-enp6s0" = { + matchConfig.Name = "enp6s0"; + DHCP = "ipv4"; + networkConfig.Bond = "bond0"; + }; + "40-bond0" = { + matchConfig.Name = "bond0"; + linkConfig = { + RequiredForOnline = "carrier"; + }; + + networkConfig.LinkLocalAddressing = "no"; + }; + }; + }; +} diff --git a/workstation/network.nix~ b/workstation/network.nix~ new file mode 100644 index 0000000..a167edf --- /dev/null +++ b/workstation/network.nix~ @@ -0,0 +1,10 @@ +{ plgs, configs, ... }: +{ + systemd.network = { + enable = true; + networks."10-lan" = { + matchConfig.Name = "lan"; + networkConfig.DHCP = "ipv4"; + }; + }; +}