From 9752742d7666b06ffe26176e6f960da20431b2e0 Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 4 Sep 2022 21:10:33 +0100 Subject: [PATCH] bgp: force next-hop for OVH since I just can't talk to their router 2 --- ops/nixos/lib/bgp.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ops/nixos/lib/bgp.nix b/ops/nixos/lib/bgp.nix index 4166e1515e..46ec0dded0 100644 --- a/ops/nixos/lib/bgp.nix +++ b/ops/nixos/lib/bgp.nix @@ -15,6 +15,7 @@ let if ! (avoid_martians4()) then reject; ${if ix.remote.must_be_next_hop then "if (bgp_path.first != ${toString ix.remote.asn}) then reject;" else "# no next-hop requirement"} ${lib.concatMapStringsSep "\n" (asn: "if (bgp_path ~ [= * ${toString asn} * =]) then reject;") ix.remote.drop_asns} + if (bgp_path ~ [= * 16276 * =] && gw = 195.66.225.6) then gw = 195.66.224.220; # OVH must go via router 1; router 2 is bork. bgp_local_pref = ${toString ix.remote.bgp_local_pref}; accept; } @@ -25,6 +26,7 @@ let if ! (avoid_martians6()) then reject; ${if ix.remote.must_be_next_hop then "if (bgp_path.first != ${toString ix.remote.asn}) then reject;" else "# no next-hop requirement"} ${lib.concatMapStringsSep "\n" (asn: "if (bgp_path ~ [= * ${toString asn} * =]) then reject;") ix.remote.drop_asns} + if (bgp_path ~ [= * 16276 * =] && gw = 2001:7f8:4::3f94:2) then gw = 2001:7f8:4::3f94:1; # OVH must go via router 1; router 2 is bork. bgp_local_pref = ${toString ix.remote.bgp_local_pref}; accept; }