net186-config/lib/20-community-peer.conf

28 lines
956 B
Plaintext
Raw Normal View History

2022-12-26 15:41:18 +00:00
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;
2023-01-29 18:49:49 +00:00
if bgp_path ~ [ 7018, 3320, 3257, 6830, 3356, 2914, 5511, 3491, 1239, 6453, 6762, 1299, 12956, 701, 6461, 174, 6939] then {
return false;
}
2022-12-26 15:41:18 +00:00
return true;
}
2022-12-26 16:16:27 +00:00
function direct_peer_import_filter(int ASN) {
if !is_valid() then return false;
if !is_peer_route() then return false;
2022-12-26 15:41:18 +00:00
pub_add_communities(ASN, 0);
pub_preprocess_communities();
2022-12-27 17:14:15 +00:00
bgp_local_pref = 500 - bgp_path.len * 10;
2023-01-09 14:46:30 +00:00
pub_route_controller_specific();
return true;
2022-12-26 15:41:18 +00:00
}
2022-12-26 16:16:27 +00:00
function direct_peer_export_filter(int ASN) {
2022-12-27 17:14:15 +00:00
pub_process_path();
if !is_valid() then return false;
if !is_peer_route() then return false;
2023-01-29 18:49:49 +00:00
if !pub_is_downstream_route() then return false;
2022-12-28 01:51:41 +00:00
pub_add_communities(ASN, 30);
if pub_process_communities(ASN, 0) then return true;
else return false;
2022-12-26 15:41:18 +00:00
}