From cb3707c9e8b261d2ee5ba1995798237191aa2b41 Mon Sep 17 00:00:00 2001 From: Alex Denes Date: Sun, 10 Nov 2024 18:19:00 +0000 Subject: [PATCH] Add thetford and peers --- .../downstream/peers/thetford.conf | 9 ++++ thetford-mines.canada/bird.conf | 7 +++ thetford-mines.canada/v6gw/bird.conf | 48 +++++++++++++++++++ .../v6gw/peers/mika.frankfurt.conf | 12 +++++ 4 files changed, 76 insertions(+) create mode 100644 mika.frankfurt.vultr/downstream/peers/thetford.conf create mode 100644 thetford-mines.canada/bird.conf create mode 100644 thetford-mines.canada/v6gw/bird.conf create mode 100644 thetford-mines.canada/v6gw/peers/mika.frankfurt.conf diff --git a/mika.frankfurt.vultr/downstream/peers/thetford.conf b/mika.frankfurt.vultr/downstream/peers/thetford.conf new file mode 100644 index 0000000..c2db9f8 --- /dev/null +++ b/mika.frankfurt.vultr/downstream/peers/thetford.conf @@ -0,0 +1,9 @@ +protocol bgp thetford from downstream_peer { + local as DOWNSTREAM_OWN_AS; + neighbor fe80::2 as 4200000002; + interface "caskd-thetford"; + ipv6 { + import all; + export none; + }; +} diff --git a/thetford-mines.canada/bird.conf b/thetford-mines.canada/bird.conf new file mode 100644 index 0000000..35633d6 --- /dev/null +++ b/thetford-mines.canada/bird.conf @@ -0,0 +1,7 @@ +log stderr all; +debug protocols { states, routes, filters, interfaces }; +router id 127.0.0.1; + +protocol device { scan time 10; } + +include "/etc/bird/v6gw/bird.conf"; diff --git a/thetford-mines.canada/v6gw/bird.conf b/thetford-mines.canada/v6gw/bird.conf new file mode 100644 index 0000000..db0d42f --- /dev/null +++ b/thetford-mines.canada/v6gw/bird.conf @@ -0,0 +1,48 @@ +define V6GW_EXPORTABLE_NETSET = [ + 2a04:5b81:2060:b00b::/64, + 2a04:5b81:2060:d00d::/64, + 2a04:5b81:2060:f33d::/64 +]; + +define V6GW_OWN_AS = 4200000002; +function v6gw_is_selfnet() { + return net ~ V6GW_EXPORTABLE_NETSET; +} + +ipv6 table v6gw; + +protocol direct v6gw_direct { + vrf "vrf-v6"; + check link yes; + ipv6 { table v6gw; }; +} + +protocol kernel v6gw_kernel { + vrf "vrf-v6"; + kernel table 10; + scan time 20; + learn; + merge paths 64; + + ipv6 { + table v6gw; + import filter { + if !v6gw_is_selfnet() then reject; # Only import valid networks + if source != RTS_STATIC then reject; # Don't import non-static routes + accept; + }; + export none; + }; +} + +template bgp v6gwpeer { + vrf "vrf-v6"; + local as V6GW_OWN_AS; + path metric 1; + + ipv6 { + table v6gw; + }; +} + +include "/etc/bird/v6gw/peers/*"; diff --git a/thetford-mines.canada/v6gw/peers/mika.frankfurt.conf b/thetford-mines.canada/v6gw/peers/mika.frankfurt.conf new file mode 100644 index 0000000..abfd148 --- /dev/null +++ b/thetford-mines.canada/v6gw/peers/mika.frankfurt.conf @@ -0,0 +1,12 @@ +protocol bgp mika_frankfurt from v6gwpeer { + neighbor fe80::1 as 4200000000; + interface "vultrbgp"; + ipv6 { + import none; + export filter { + if !v6gw_is_selfnet() then reject; + reject; + #accept; + }; + }; +}