add global route controller
parent
a9de9d9a89
commit
04edb208ee
|
@ -0,0 +1,3 @@
|
|||
function pub_route_controller_specific() {
|
||||
if 4837 ~ bgp_path && (200536, 120, 221) ~ bgp_large_community && REGION ~ [200..299] then bgp_local_pref = 114514;
|
||||
}
|
|
@ -98,6 +98,7 @@ function transit_import_filter(int ASN) {
|
|||
pub_preprocess_communities();
|
||||
bgp_local_pref = 400 - bgp_path.len * 10;
|
||||
if LOCAL_ASN ~ bgp_path then bgp_local_pref = 1;
|
||||
pub_route_controller_specific();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ function downstream_import_filter(int ASN) {
|
|||
pub_add_communities(ASN, 20);
|
||||
pub_preprocess_communities();
|
||||
bgp_local_pref = 500 - bgp_path.len * 10;
|
||||
pub_route_controller_specific();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function net186_import_filter(int POPID)
|
||||
int viaRegion;
|
||||
bgppath public_bgp_path;
|
||||
{
|
||||
{
|
||||
public_bgp_path = delete(bgp_path, [4200000000..4225479999]);
|
||||
|
||||
if (LOCAL_ASN, 122, REGION) !~ bgp_large_community then bgp_large_community.add((LOCAL_ASN, 122, REGION));
|
||||
|
@ -10,6 +10,8 @@ function net186_import_filter(int POPID)
|
|||
else if bgp_large_community ~ [(LOCAL_ASN, 110, 1), (LOCAL_ASN, 110, 10)] then bgp_local_pref = 400;
|
||||
else bgp_local_pref = 300;
|
||||
|
||||
pub_route_controller_specific();
|
||||
|
||||
viaRegion = 0;
|
||||
# Route is via Europe & Africa & Middle East
|
||||
if bgp_large_community ~ [(LOCAL_ASN, 122, 100), (LOCAL_ASN, 122, 300..310), (LOCAL_ASN, 122, 600), (LOCAL_ASN, 121, 100), (LOCAL_ASN, 121, 300..310), (LOCAL_ASN, 121, 600)] || POP ~ [100, 300..310, 600] then viaRegion = viaRegion + 1;
|
||||
|
|
|
@ -13,6 +13,7 @@ function direct_peer_import_filter(int ASN) {
|
|||
pub_add_communities(ASN, 0);
|
||||
pub_preprocess_communities();
|
||||
bgp_local_pref = 500 - bgp_path.len * 10;
|
||||
pub_route_controller_specific();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue