From af582da8a5124e797c527fa68776f5993cc26b9a Mon Sep 17 00:00:00 2001 From: Konarak Date: Sat, 1 Nov 2025 23:37:24 +0530 Subject: [PATCH] make BGP dummy interface addresses configurable --- README.md | 1 + modules/network.nix | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cf5a1f..af138e7 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ Cost: $10/month + tax for two Linodes with pooled 2TB traffic quota. "2001:db8:9f2b::4" ]; 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 }; }; diff --git a/modules/network.nix b/modules/network.nix index abfcc20..e54ecc3 100644 --- a/modules/network.nix +++ b/modules/network.nix @@ -79,6 +79,13 @@ in { 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 { type = types.enum [ "primary" "secondary" ]; description = "BGP route map type (primary/secondary for HA)"; @@ -140,7 +147,7 @@ in { systemd.network.networks."20-shared-dummy" = mkIf cfg.bgp.enable { matchConfig.Name = "shared0"; - address = [ "2600:3c08:e002:6cff::1/128" ]; + address = cfg.bgp.extraAddresses; }; boot.kernel.sysctl = {