make BGP dummy interface addresses configurable

This commit is contained in:
2025-11-01 23:37:24 +05:30
parent 226fe6577f
commit af582da8a5
2 changed files with 9 additions and 1 deletions

View File

@@ -94,6 +94,7 @@ Cost: $10/month + tax for two Linodes with pooled 2TB traffic quota.
"2001:db8:9f2b::4" "2001:db8:9f2b::4"
]; ];
advertisedSubnets = [ "2001:db8:a7c4::/56" ]; advertisedSubnets = [ "2001:db8:a7c4::/56" ];
extraAddresses = [ "2001:db8:0:ff::1/128" ]; # shared IP for WireGuard endpoint
routeMap = "primary"; # or "secondary" for the backup server routeMap = "primary"; # or "secondary" for the backup server
}; };
}; };

View File

@@ -79,6 +79,13 @@ in {
description = "List of IPv6 subnets to advertise via BGP"; description = "List of IPv6 subnets to advertise via BGP";
}; };
extraAddresses = mkOption {
type = types.listOf types.str;
default = [];
example = [ "2001:db8:0:ff::1/128" ];
description = "List of IP addresses to bind to the dummy interface for shared WireGuard endpoint or other HA services";
};
routeMap = mkOption { routeMap = mkOption {
type = types.enum [ "primary" "secondary" ]; type = types.enum [ "primary" "secondary" ];
description = "BGP route map type (primary/secondary for HA)"; description = "BGP route map type (primary/secondary for HA)";
@@ -140,7 +147,7 @@ in {
systemd.network.networks."20-shared-dummy" = mkIf cfg.bgp.enable { systemd.network.networks."20-shared-dummy" = mkIf cfg.bgp.enable {
matchConfig.Name = "shared0"; matchConfig.Name = "shared0";
address = [ "2600:3c08:e002:6cff::1/128" ]; address = cfg.bgp.extraAddresses;
}; };
boot.kernel.sysctl = { boot.kernel.sysctl = {