switch working bond
This commit is contained in:
+3
-3
@@ -16,7 +16,7 @@
|
|||||||
./program-tmux.nix
|
./program-tmux.nix
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
./wireguard.nix
|
# ./wireguard.nix
|
||||||
./docker.nix
|
./docker.nix
|
||||||
./chrony.nix
|
./chrony.nix
|
||||||
./docker-device-mapper.nix
|
./docker-device-mapper.nix
|
||||||
@@ -29,9 +29,9 @@
|
|||||||
# --- KERNEL NETWORK CONFIGURATION ---
|
# --- KERNEL NETWORK CONFIGURATION ---
|
||||||
boot.kernel.sysctl = {
|
boot.kernel.sysctl = {
|
||||||
"net.ipv4.ip_forward" = 1;
|
"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.forwarding" = 1;
|
||||||
"net.ipv6.conf.all.accept_ra" = 2;
|
|
||||||
"net.ipv6.conf.default.accept_ra" = 2;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.kernelModules = [ "rbd" "nbd" ];
|
boot.kernelModules = [ "rbd" "nbd" ];
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ in
|
|||||||
networking.defaultGateway = {
|
networking.defaultGateway = {
|
||||||
address = "192.168.178.1";
|
address = "192.168.178.1";
|
||||||
# interface = primaryInterface.name;
|
# interface = primaryInterface.name;
|
||||||
interface = "bond0";
|
# interface = "bond0";
|
||||||
};
|
};
|
||||||
|
|
||||||
# 1. Generate Static IP Configurations
|
# 1. Generate Static IP Configurations
|
||||||
|
|||||||
+7
-6
@@ -3,18 +3,19 @@
|
|||||||
{
|
{
|
||||||
boot.kernelModules = [ "bonding" ];
|
boot.kernelModules = [ "bonding" ];
|
||||||
|
|
||||||
|
networking.defaultGateway.interface = "bond0";
|
||||||
|
|
||||||
networking.bonds.bond0 = {
|
networking.bonds.bond0 = {
|
||||||
interfaces = map (i: i.name) config.vars.interfaces;
|
interfaces = map (i: i.name) config.vars.interfaces;
|
||||||
driverOptions = {
|
driverOptions = {
|
||||||
mode = "active-backup";
|
# mode = "active-backup";
|
||||||
|
mode = "802.3ad";
|
||||||
miimon = "100";
|
miimon = "100";
|
||||||
# lacp_rate = "fast";
|
lacp_rate = "fast";
|
||||||
# xmit_hash_policy = "layer2+3";
|
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: {
|
networking.interfaces = lib.listToAttrs (map (iface: {
|
||||||
name = iface.name;
|
name = iface.name;
|
||||||
value = {
|
value = {
|
||||||
@@ -27,7 +28,7 @@
|
|||||||
bond0 = {
|
bond0 = {
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
ipv4.addresses = [{
|
ipv4.addresses = [{
|
||||||
address = "192.168.178.8";
|
address = config.vars.local_ip;
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user