about summary refs log tree commit diff
path: root/machines
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2022-08-03 18:27:28 +0200
committeraszlig <aszlig@nix.build>2022-08-03 18:27:28 +0200
commitf70f08c3a287842c08777d4b2b047d925d4b6eff (patch)
tree13b2796395942eeb851b4ca35353861f127f8077 /machines
parent974bdc8dec5dc1a14452ad7e679fc5c57bf95ec6 (diff)
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 <aszlig@nix.build>
Diffstat (limited to 'machines')
-rw-r--r--machines/aszlig/slylandro.nix19
1 files changed, 17 insertions, 2 deletions
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";