From: Ondrej Zajicek Date: Tue, 24 Feb 2026 22:15:06 +0000 (+0100) Subject: BGP: Automatic peering based on discovered neighbors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ee9f93bd076c5cc425ceaec9acedbbb7c9021ec;p=thirdparty%2Fbird.git BGP: Automatic peering based on discovered neighbors Extend existing dynamic BGP code to support spawning of active BGP instances for discovered neighbors. The existence of such dynamic BGP instances is controlled by exporting information from a table containing neighbor entries through a newly introduced neighbor channel. This means that the feature will only work if there is another protocol responsible for discovering and announcing neighbor entries (e.g. RAdv with 'router discovery' enabled). Based on the patch from Matteo Perin , thanks! --- diff --git a/doc/bird.sgml b/doc/bird.sgml index 990aae8f3..25afe0707 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -3709,6 +3709,7 @@ together with their appropriate channels follows. @ @@ -3730,6 +3731,17 @@ policies of The BGP channels have additional config options (together with the common ones): @@ -4240,6 +4252,47 @@ protocol bgp { } +

Example configuration for BGP unnumbered automatic peering using router discovery: + +

+# Table for discovered peers +neighbor table peers; + +# RAdv protocol with router discovery enabled +protocol radv { + neighbors { table peers; }; # Export discovered peers to this table + + interface "eth*" { + # Normal RAdv configuration options... + router discovery yes; # Enable reception of ICMPv6 RAs + }; +} + +# Dynamic BGP with neighbor channel for automatic peering +protocol bgp bgp_root { + local as 65000; + neighbor range fe80::/64 external; # Accept link-local peers + dynamic name "bgp_auto_"; # Name spawned sessions with this prefix + dynamic name digits 2; # Number of digits in name after prefix + + ipv4 { + export all; + import all; + extended next hop; # Allow IPv6 next hops for IPv4 routes + }; + + ipv6 { + export all; + import all; + }; + + neighbors { + table peers; # Import peer discovery objects from this table + export all; # Allow all discovered peers to trigger sessions + }; +} + + BMP