Update: update filter

production
186526 2022-12-30 01:38:04 +08:00
parent d59bc5feb1
commit 02e2a82814
1 changed files with 8 additions and 2 deletions

View File

@ -85,7 +85,10 @@ function pub_process_path() {
# Route is via or locate East Asia & Oceania # 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); if bgp_large_community ~ [(LOCAL_ASN, 122, 400..500), (LOCAL_ASN, 121, 200..299)] then bgp_path.prepend(LOCAL_ASN);
# Self PoP # 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) { function transit_import_filter(int ASN) {
@ -100,7 +103,10 @@ function transit_export_filter(int ASN) {
pub_process_path(); pub_process_path();
if !is_valid() then return false; if !is_valid() then return false;
if bgp_large_community ~ [(LOCAL_ASN, 110, 0), (LOCAL_ASN, 110, 10)] 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); pub_add_communities(ASN, 30);
if pub_process_communities(ASN, 10) then return true; if pub_process_communities(ASN, 10) then return true;
else return false; else return false;