From f70f08c3a287842c08777d4b2b047d925d4b6eff Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 3 Aug 2022 18:27:28 +0200 Subject: slylandro: Use bonding for WiFi/Ethernet This is mainly because I want to have a seamless transition between both, at least in theory. Whether this will work out to be so smooth when trying it on various networks out there remains to be seen, but let's try it :-) Signed-off-by: aszlig --- machines/aszlig/slylandro.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'machines/aszlig') diff --git a/machines/aszlig/slylandro.nix b/machines/aszlig/slylandro.nix index cb52496f..108910fb 100644 --- a/machines/aszlig/slylandro.nix +++ b/machines/aszlig/slylandro.nix @@ -27,8 +27,23 @@ networking.hostName = "slylandro"; networking.wireless.enable = lib.mkForce true; - networking.interfaces.enp1s0.useDHCP = true; - networking.interfaces.wlp3s0.useDHCP = true; + networking.interfaces.bond0.useDHCP = true; + + # This is because the "primary" option below is only supported for the + # scripted networking configuration. + systemd.network.networks."40-enp1s0" = { + networkConfig.PrimarySlave = true; + }; + + networking.bonds.bond0 = { + interfaces = [ "enp1s0" "wlp3s0" ]; + driverOptions = { + miimon = "1000"; + mode = "active-backup"; + primary = "enp1s0"; + primary_reselect = "always"; + }; + }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/DF50-CD44"; -- cgit 1.4.1