diff --git a/configuration.nix b/configuration.nix index 9157d82..af380d9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -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" ]; diff --git a/network-base.nix b/network-base.nix index f39e0eb..2df1032 100644 --- a/network-base.nix +++ b/network-base.nix @@ -20,7 +20,7 @@ in networking.defaultGateway = { address = "192.168.178.1"; # interface = primaryInterface.name; - interface = "bond0"; + # interface = "bond0"; }; # 1. Generate Static IP Configurations diff --git a/network-bond.nix b/network-bond.nix index f6a5930..ec215f5 100644 --- a/network-bond.nix +++ b/network-bond.nix @@ -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; }]; };