From 1dbf6264ed1c5a0caac4c338f449dbc52c667911 Mon Sep 17 00:00:00 2001 From: 186526 Date: Tue, 3 Jan 2023 02:51:46 +0800 Subject: [PATCH] add allow local as --- lib/10-community-transit.conf | 1 + protocol/external_network.conf | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/10-community-transit.conf b/lib/10-community-transit.conf index 1cd5989..01d39f9 100644 --- a/lib/10-community-transit.conf +++ b/lib/10-community-transit.conf @@ -96,6 +96,7 @@ function transit_import_filter(int ASN) { pub_add_communities(ASN, 10); pub_preprocess_communities(); bgp_local_pref = 400 - bgp_path.len * 10; + if LOCAL_ASN ~ bgp_path then bgp_local_pref = 1; return true; } diff --git a/protocol/external_network.conf b/protocol/external_network.conf index bf084fb..e1d1d5e 100644 --- a/protocol/external_network.conf +++ b/protocol/external_network.conf @@ -1,6 +1,8 @@ template bgp pub_transit { local as LOCAL_ASN; + allow local as 1; + ipv6 { import where transit_import_filter(6939); export where transit_export_filter(6939);