switch working bond

This commit is contained in:
2026-02-09 23:38:15 +01:00
parent 1e52bf6b9d
commit 97f7f127c3
3 changed files with 11 additions and 10 deletions
+3 -3
View File
@@ -16,7 +16,7 @@
./program-tmux.nix
# Services
./wireguard.nix
# ./wireguard.nix
./docker.nix
./chrony.nix
./docker-device-mapper.nix
@@ -29,9 +29,9 @@
# --- KERNEL NETWORK CONFIGURATION ---
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
"net.ipv4.conf.all.rp_filter" = 1;
"net.ipv4.conf.default.rp_filter" = 1;
"net.ipv6.conf.all.forwarding" = 1;
"net.ipv6.conf.all.accept_ra" = 2;
"net.ipv6.conf.default.accept_ra" = 2;
};
boot.kernelModules = [ "rbd" "nbd" ];
+1 -1
View File
@@ -20,7 +20,7 @@ in
networking.defaultGateway = {
address = "192.168.178.1";
# interface = primaryInterface.name;
interface = "bond0";
# interface = "bond0";
};
# 1. Generate Static IP Configurations
+7 -6
View File
@@ -3,18 +3,19 @@
{
boot.kernelModules = [ "bonding" ];
networking.defaultGateway.interface = "bond0";
networking.bonds.bond0 = {
interfaces = map (i: i.name) config.vars.interfaces;
driverOptions = {
mode = "active-backup";
# mode = "active-backup";
mode = "802.3ad";
miimon = "100";
# lacp_rate = "fast";
# xmit_hash_policy = "layer2+3";
lacp_rate = "fast";
xmit_hash_policy = "layer2+3";
};
};
# 1. Generate the physical interfaces config (slaves)
# 2. Merge it with the bond0 config
networking.interfaces = lib.listToAttrs (map (iface: {
name = iface.name;
value = {
@@ -27,7 +28,7 @@
bond0 = {
useDHCP = false;
ipv4.addresses = [{
address = "192.168.178.8";
address = config.vars.local_ip;
prefixLength = 24;
}];
};