emerg: update filter which is leaking route now
continuous-integration/drone/push Build is passing Details

This commit is contained in:
186526 2023-01-28 03:23:07 +08:00
parent 486fcecfec
commit 9c129e6d80
4 changed files with 7 additions and 6 deletions

View File

@ -4,4 +4,9 @@ function pub_route_controller_specific() {
if REGION = 400 && (200536, 121, 500) ~ bgp_large_community && (200536, 122, 410) ~ bgp_large_community then bgp_local_pref = bgp_local_pref + 6;
if REGION = 430 && (200536, 110, 10) ~ bgp_large_community && (200536, 121, 430) !~ bgp_large_community && ((200536, 121, 400) ~ bgp_large_community || (200536, 122, 400) ~ bgp_large_community) then bgp_local_pref = bgp_local_pref + 30;
if REGION != 430 && (200536, 121, 430) ~ bgp_large_community then bgp_local_pref = bgp_local_pref + filter(bgp_large_community, [(LOCAL_ASN, 122, 430)]).len * 3;
}
function pub_is_downstream_route() {
if delete(bgp_path, DOWNSTREAM_ASN).len != 0 then return false;
return true;
}

View File

@ -106,7 +106,7 @@ 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 {
if !pub_is_downstream_route() && source = RTS_BGP then {
print "transit exporter: for ", net, " ASN ", bgp_path.last;
return false;
}

View File

@ -1,9 +1,7 @@
function is_peer_route() {
if (LOCAL_ASN, 110, 0) ~ bgp_large_community then return false;
if (LOCAL_ASN, 110, 10) ~ bgp_large_community then return false;
if bgp_path ~ [ 7018, 3320, 3257, 6830, 3356, 2914, 5511, 3491, 1239, 6453, 6762, 1299, 12956, 701, 6461, 174, 6939] then {
return false;
}
if !pub_is_downstream_route() then return false;
return true;
}

View File

@ -1,8 +1,6 @@
template bgp pub_transit {
local as LOCAL_ASN;
allow local as 1;
ipv6 {
import where transit_import_filter(6939);
export where transit_export_filter(6939);