From 02e2a82814e3dd58255a6743717f798eaa555809 Mon Sep 17 00:00:00 2001 From: 186526 Date: Fri, 30 Dec 2022 01:38:04 +0800 Subject: [PATCH] Update: update filter --- lib/10-community-transit.conf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/10-community-transit.conf b/lib/10-community-transit.conf index 63ef336..1cd5989 100644 --- a/lib/10-community-transit.conf +++ b/lib/10-community-transit.conf @@ -85,7 +85,10 @@ function pub_process_path() { # Route is via or locate East Asia & Oceania if bgp_large_community ~ [(LOCAL_ASN, 122, 400..500), (LOCAL_ASN, 121, 200..299)] then bgp_path.prepend(LOCAL_ASN); # Self PoP - if (LOCAL_ASN, 120, POP) ~ bgp_large_community then bgp_path.delete(LOCAL_ASN); + if (LOCAL_ASN, 120, POP) ~ bgp_large_community then { + bgp_path.delete(LOCAL_ASN); + bgp_path.prepend(LOCAL_ASN); + } } function transit_import_filter(int ASN) { @@ -100,7 +103,10 @@ function transit_export_filter(int ASN) { pub_process_path(); if !is_valid() then return false; if bgp_large_community ~ [(LOCAL_ASN, 110, 0), (LOCAL_ASN, 110, 10)] then return false; - if bgp_path.last !~ DOWNSTREAM_ASN && source = RTS_BGP then return false; + if bgp_path.last !~ DOWNSTREAM_ASN && source = RTS_BGP then { + print "transit exporter: for ", net, " ASN ", bgp_path.last; + return false; + } pub_add_communities(ASN, 30); if pub_process_communities(ASN, 10) then return true; else return false;