This commit is contained in:
2025-08-15 12:25:44 +00:00
parent ded46ebce2
commit db35c08fc6
9 changed files with 67 additions and 14 deletions

22
modules/keepalived.nix Normal file
View File

@@ -0,0 +1,22 @@
{ config, pkgs, lib, ... }:
with lib; let
NetworkInterface = config.custom._Networkinterface;
VIP_Priority = config.custom.VIP_Priority;
in {
services.keepalived = {
enable = true;
openFirewall = true;
vrrpInstances.VIP_250 = {
interface = "${NetworkInterface}";
virtualRouterId = 51;
priority = VIP_Priority;
unicastPeers = ["192.168.4.226" "192.168.4.227" "192.168.4.228" "192.168.4.36"];
virtualIps = [{addr = "192.168.4.250/22";}];
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ]; # optional
}