router(*): Use unicast rather than multicast

Due to an unfathomable issue where I would need to recompile with full debug keepalived,
keepalived seems to be not seeing the multicast packets on the vrrp-router
and thus we need to fallback to the disgusting unicast solution.

Well, let's move on.
This commit is contained in:
Raito Bezarius 2024-01-12 04:22:34 +01:00
parent 683555e4eb
commit bcbfc91a11
3 changed files with 10 additions and 2 deletions

View file

@ -4,10 +4,11 @@
enable = true; enable = true;
enablePrimary = true; enablePrimary = true;
routerId = 1; routerId = 1;
virtualRouterId = 1; virtualRouterId = 51;
vip = "129.199.146.230"; vip = "129.199.146.230";
rip = "129.199.146.231"; rip = "129.199.146.231";
trunkPort.macAddress = "92:E3:9C:CE:EF:14"; trunkPort.macAddress = "92:E3:9C:CE:EF:14";
virtualNeighbors = [ 2 ];
}; };
# systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug"; # systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";

View file

@ -4,10 +4,11 @@
enable = true; enable = true;
enablePrimary = false; enablePrimary = false;
routerId = 2; routerId = 2;
virtualRouterId = 1; virtualRouterId = 51;
vip = "129.199.146.230"; vip = "129.199.146.230";
rip = "129.199.146.232"; rip = "129.199.146.232";
trunkPort.macAddress = "92:E3:9C:CE:EF:15"; trunkPort.macAddress = "92:E3:9C:CE:EF:15";
virtualNeighbors = [ 1 ];
}; };
# systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug"; # systemd.services."systemd-networkd".environment.SYSTEMD_LOG_LEVEL = "debug";

View file

@ -56,6 +56,11 @@ in
# As recommended per RFC. # As recommended per RFC.
default = if cfg.enablePrimary then 100 else 50; default = if cfg.enablePrimary then 100 else 50;
}; };
virtualNeighbors = mkOption {
type = types.listOf types.int;
description = "Virtual router neighbors in terms of router IDs";
default = [ ];
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -353,6 +358,7 @@ in
virtualIps = [{ addr = "${cfg.vip}/24"; dev = "swp"; scope = "global"; }]; virtualIps = [{ addr = "${cfg.vip}/24"; dev = "swp"; scope = "global"; }];
inherit (cfg) virtualRouterId; inherit (cfg) virtualRouterId;
noPreempt = !cfg.enablePrimary; noPreempt = !cfg.enablePrimary;
unicastPeers = map (n: "10.0.0.${toString n}") cfg.virtualNeighbors;
}; };
}; };
}; };