From bb2fdc712b56c8471c819b7f4cb677090c972e61 Mon Sep 17 00:00:00 2001 From: 186526 Date: Fri, 20 Jan 2023 16:39:28 +0800 Subject: [PATCH] Update China mainland route policy --- lib/10-community-controller.conf | 2 +- lib/20-community-net186.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/10-community-controller.conf b/lib/10-community-controller.conf index 55f3902..776eb35 100644 --- a/lib/10-community-controller.conf +++ b/lib/10-community-controller.conf @@ -2,6 +2,6 @@ function pub_route_controller_specific() { if 4837 ~ bgp_path && (200536, 120, 221) ~ bgp_large_community && REGION ~ [200..299] then bgp_local_pref = 114514; if 174 ~ bgp_path && 4837 ~ bgp_path && (200536, 120, 101) ~ bgp_large_community && REGION = 100 then bgp_local_pref = 114514; if REGION = 400 && (200536, 121, 500) ~ bgp_large_community && (200536, 122, 410) ~ bgp_large_community then bgp_local_pref = bgp_local_pref + 6; - if REGION = 430 && (200536, 121, 430) !~ bgp_large_community && ((200536, 121, 400) ~ bgp_large_community || (200536, 122, 400) ~ bgp_large_community) then bgp_local_pref = bgp_local_pref + 30; + if REGION = 430 && (200536, 110, 10) ~ bgp_large_community && (200536, 121, 430) !~ bgp_large_community && ((200536, 121, 400) ~ bgp_large_community || (200536, 122, 400) ~ bgp_large_community) then bgp_local_pref = bgp_local_pref + 30; if REGION != 430 && (200536, 121, 430) ~ bgp_large_community then bgp_local_pref = bgp_local_pref + filter(bgp_large_community, [(LOCAL_ASN, 122, 430)]).len * 3; } \ No newline at end of file diff --git a/lib/20-community-net186.conf b/lib/20-community-net186.conf index 8f810c2..a67924b 100644 --- a/lib/20-community-net186.conf +++ b/lib/20-community-net186.conf @@ -23,7 +23,7 @@ function net186_import_filter(int POPID) bgp_local_pref = bgp_local_pref - 50 * viaRegion; # Route is via China mainland but not advertise in China mainland. - if (LOCAL_ASN, 122, 430) ~ bgp_large_community && REGION != 430 && (LOCAL_ASN, 120, 430) ~ bgp_large_community then return false; + if (LOCAL_ASN, 122, 430) ~ bgp_large_community && REGION != 430 && (LOCAL_ASN, 121, 430) !~ bgp_large_community then return false; bgp_local_pref = bgp_local_pref - filter(bgp_large_community, [(LOCAL_ASN, 122, *)]).len * 5;