From 98c3e0be9f7fb476e50354a6b1dc0d9d2819c67c Mon Sep 17 00:00:00 2001 From: 186526 Date: Wed, 28 Dec 2022 09:51:41 +0800 Subject: [PATCH] Add: (LOCAL_ASN, 110, 30) --- lib/10-community-transit.conf | 5 ++++- lib/20-community-downstream.conf | 2 +- lib/20-community-peer.conf | 2 +- readme.md | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/10-community-transit.conf b/lib/10-community-transit.conf index e37a3ae..dc4371b 100644 --- a/lib/10-community-transit.conf +++ b/lib/10-community-transit.conf @@ -21,6 +21,9 @@ function pub_add_communities(int ASN; int PeerType) { # DOWNSTREAM } else if (PeerType=20) then { if bgp_large_community !~ [(LOCAL_ASN, 110, *)] then bgp_large_community.add((LOCAL_ASN, 110, 20)); + # Self Route + } else if (PeerType=30) then { + if bgp_large_community !~ [(LOCAL_ASN, 110, *)] then bgp_large_community.add((LOCAL_ASN, 110, 30)); } # Finished (LOCAL_ASN, 110, *); @@ -98,7 +101,7 @@ function transit_export_filter(int ASN) { if !is_valid() then return false; if bgp_large_community ~ [(LOCAL_ASN, 110, 0), (LOCAL_ASN, 110, 10)] then return false; if bgp_path.last !~ DOWNSTREAM_ASN && source = RTS_BGP then return false; - pub_add_communities(ASN, 10); + pub_add_communities(ASN, 30); if pub_process_communities(ASN, 10) then return true; else return false; } \ No newline at end of file diff --git a/lib/20-community-downstream.conf b/lib/20-community-downstream.conf index ceb80cb..0367008 100644 --- a/lib/20-community-downstream.conf +++ b/lib/20-community-downstream.conf @@ -10,7 +10,7 @@ function downstream_import_filter(int ASN) { function downstream_export_filter(int ASN) { pub_process_path(); if !is_valid() then return false; - pub_add_communities(ASN, 10); + pub_add_communities(ASN, 30); if pub_process_communities(ASN, 20) then return true; else return false; } \ No newline at end of file diff --git a/lib/20-community-peer.conf b/lib/20-community-peer.conf index 180a51d..be8cb8b 100644 --- a/lib/20-community-peer.conf +++ b/lib/20-community-peer.conf @@ -20,7 +20,7 @@ function direct_peer_export_filter(int ASN) { pub_process_path(); if !is_valid() then return false; if !is_peer_route() then return false; - pub_add_communities(ASN, 10); + pub_add_communities(ASN, 30); if pub_process_communities(ASN, 0) then return true; else return false; } \ No newline at end of file diff --git a/readme.md b/readme.md index 39bf0f7..5abdbd8 100644 --- a/readme.md +++ b/readme.md @@ -30,6 +30,7 @@ | (LOCAL_ASN, 110, 2) | Route learn from direct peer | | (LOCAL_ASN, 110, 10) | Route learn from upstream | | (LOCAL_ASN, 110, 20) | Route learn from downstream | +| (LOCAL_ASN, 110, 30) | Route from 186526 Network | | (LOCAL_ASN, 120, `this PoP`) | Route learn on `this PoP` | | (LOCAL_ASN, 121, `this region`) | Route learn in `this region` | | (LOCAL_ASN, 122, `this region`) | Route is passed through `this region` in 186526 Network |