Fix: bgp route selection
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-12-28 01:14:15 +08:00
parent db8827f83e
commit dcfe9c677a
5 changed files with 50 additions and 23 deletions

View File

@ -12,14 +12,15 @@ function direct_peer_import_filter(int ASN) {
if !is_peer_route() then return false;
pub_add_communities(ASN, 0);
pub_preprocess_communities();
bgp_local_pref = 500 - bgp_path.len * 10;
return true;
}
function direct_peer_export_filter(int ASN) {
# Delete Self eBGP Confed Path.
bgp_path.delete([4200000000..4225479999]);
pub_process_path();
if !is_valid() then return false;
if !is_peer_route() then return false;
pub_add_communities(ASN, 10);
if pub_process_communities(ASN, 0) then return true;
else return false;
}