Files
net186-config/lib/20-community-peer.conf
186526 9c129e6d80
All checks were successful
continuous-integration/drone/push Build is passing
emerg: update filter which is leaking route now
2023-01-28 15:19:05 +08:00

25 lines
800 B
Plaintext

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 !pub_is_downstream_route() then return false;
return true;
}
function direct_peer_import_filter(int ASN) {
if !is_valid() then return false;
if !is_peer_route() then return false;
pub_add_communities(ASN, 0);
pub_preprocess_communities();
bgp_local_pref = 500 - bgp_path.len * 10;
pub_route_controller_specific();
return true;
}
function direct_peer_export_filter(int ASN) {
pub_process_path();
if !is_valid() then return false;
if !is_peer_route() then return false;
pub_add_communities(ASN, 30);
if pub_process_communities(ASN, 0) then return true;
else return false;
}