From 0268ebd055c85f658ab428933f35e85027cc6354 Mon Sep 17 00:00:00 2001 From: 186526 Date: Sun, 19 Feb 2023 00:03:54 +0800 Subject: [PATCH] update internal network --- lib/20-community-net186.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/20-community-net186.conf b/lib/20-community-net186.conf index e8bf9f9..9b90ea1 100644 --- a/lib/20-community-net186.conf +++ b/lib/20-community-net186.conf @@ -8,7 +8,7 @@ function net186_import_filter(int POPID) if public_bgp_path.len = 1 then bgp_local_pref = 550; else if bgp_large_community ~ [(LOCAL_ASN, 110, 0), (LOCAL_ASN, 110, 2), (LOCAL_ASN, 110, 20)] then bgp_local_pref = 500; - else if bgp_large_community ~ [(LOCAL_ASN, 110, 1), (LOCAL_ASN, 110, 10)] then bgp_local_pref = 400; + else if bgp_large_community ~ [(LOCAL_ASN, 110, 10)] then bgp_local_pref = 400; else bgp_local_pref = 300; pub_route_controller_specific(); @@ -21,7 +21,8 @@ function net186_import_filter(int POPID) # Route is via or locate East Asia & Oceania if bgp_large_community ~ [(LOCAL_ASN, 122, 400..500), (LOCAL_ASN, 121, 400..500)] || POP ~ [400..500] then viaRegion = viaRegion + 1; - bgp_local_pref = bgp_local_pref - 50 * viaRegion; + if bgp_large_community !~ [(LOCAL_ASN, 110, 0), (LOCAL_ASN, 110, 2), (LOCAL_ASN, 110, 1)] then bgp_local_pref = bgp_local_pref - 50 * viaRegion; + else bgp_local_pref = bgp_local_pref - 100 * viaRegion; # Route is via China mainland but not advertise in China mainland. if (LOCAL_ASN, 122, 430) ~ bgp_large_community && REGION != 430 && (LOCAL_ASN, 121, 430) !~ bgp_large_community then return false;