From 293ddf3a4bf78d72fea4b8196e3bbc2d81b3f12e Mon Sep 17 00:00:00 2001 From: uvok cheetah Date: Fri, 19 Apr 2024 19:47:35 +0200 Subject: bird: Add rule to prefer direct neighbor --- roles/uvok_bird/templates/clearnet.conf.j2 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/uvok_bird/templates/clearnet.conf.j2 b/roles/uvok_bird/templates/clearnet.conf.j2 index 9f75798..420a8da 100644 --- a/roles/uvok_bird/templates/clearnet.conf.j2 +++ b/roles/uvok_bird/templates/clearnet.conf.j2 @@ -108,6 +108,13 @@ function reject_roa_rpki() } } +function prefer_direct_neighbor() +{ + if (bgp_path.len = 1) then + bgp_local_pref = bgp_local_pref + 700; +} + + function clearnet_common_import() { reject_bogon_asns(); reject_bogon_prefixes(); @@ -115,6 +122,7 @@ function clearnet_common_import() { reject_small_prefixes(); reject_problem_prefixes(); reject_roa_rpki(); + prefer_direct_neighbor(); honor_graceful_shutdown(); } -- cgit v1.2.3