bgpwtf: add static v6 routes via bird
A customer was missing a static v6 route via their router. Since we
don't want to add them to networking.interfaces.routes.* (as this
restarts the whole scripted network stack in NixOS), we add them to
bird. This requires implementing hscloud.routing.static.
Change-Id: I0a205ed1e1f17a86de43aaf72ab6c2694a069112
diff --git a/bgpwtf/machines/edge01.waw.bgp.wtf.nix b/bgpwtf/machines/edge01.waw.bgp.wtf.nix
index ec45938..0f754f1 100644
--- a/bgpwtf/machines/edge01.waw.bgp.wtf.nix
+++ b/bgpwtf/machines/edge01.waw.bgp.wtf.nix
@@ -167,19 +167,23 @@
v6.default = { table = "aggregate"; address = "::"; prefixLength = 0; };
};
hscloud.routing.pipe = let
- copySourcesToKernel = sources: table: {
+ copySourcesToKernel = sources: table: extra: {
table = "master";
peerTable = table;
filterIn = ''
+ ${extra}
${concatStringsSep "\n" (map (v: "if source = RTS_${v} then accept;") sources)}
reject;
'';
};
in {
- v4."internet_to_kernel" = copySourcesToKernel ["BGP" "OSPF"] "internet";
- v4."aggregate_to_kernel" = copySourcesToKernel ["BGP" "OSPF"] "aggregate";
- v6."internet_to_kernel" = copySourcesToKernel ["BGP" "OSPF"] "internet";
- v6."aggregate_to_kernel" = copySourcesToKernel ["BGP" "OSPF"] "aggregate";
+ v4."internet_to_kernel" = copySourcesToKernel ["BGP" "OSPF"] "internet" "";
+ v4."aggregate_to_kernel" = copySourcesToKernel ["BGP" "OSPF"] "aggregate" "";
+ v6."internet_to_kernel" = copySourcesToKernel ["BGP" "OSPF"] "internet" "";
+ v6."aggregate_to_kernel" = copySourcesToKernel ["BGP" "OSPF"] "aggregate" ''
+ # Static v6 routes for customers.
+ if proto ~ "static_static_ipv6_customer_*" then accept;
+ '';
};
hscloud.routing.ospf.v6.main = {