From b4c4a41b2b9f7ac70fec575c7badef0ec937f1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Fri, 18 Jun 2021 21:37:08 +0000 Subject: space_server: bird: export prefixes based on communities We only announce a prefix, if we have recieved it from a customer connection or if we originate it our self. This way we avoid announcing prefixes matching the earlier used, prefix list if we haven't recieved it via the customer connection. This is important for multi-homed labicolo customers. --- roles/space_server/files/bird.conf | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/roles/space_server/files/bird.conf b/roles/space_server/files/bird.conf index a23a7bf..c387b8c 100644 --- a/roles/space_server/files/bird.conf +++ b/roles/space_server/files/bird.conf @@ -84,18 +84,17 @@ function is_default_route() { return false; } -function is_customer_route() { - case net.type { - NET_IP4: if net ~ local_prefixes_v4 then return true; - NET_IP6: if net ~ local_prefixes_v6 then return true; - } - return false; +function is_propagated_route(){ + return bgp_large_community ~ [ + (local_asn, lc_f_type, lc_type_customer), + (local_asn, lc_f_type, lc_type_originate) + ]; } filter kernel_export { if source !~ [ RTS_BGP, RTS_STATIC ] then reject; if is_default_route() then accept; - if is_customer_route() then accept; + if is_propagated_route() then accept; reject; } @@ -114,7 +113,7 @@ filter transit_import { } filter transit_export { - if is_customer_route() then accept; + if is_propagated_route() then accept; reject; } -- cgit v1.2.1