<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="FR" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US">Do you have some ideas then?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">De :
</span></b><span style="color:black">Bird-users <bird-users-bounces@network.cz> de la part de Maxime Peim (mpeim) via Bird-users <bird-users@network.cz><br>
<b>Date : </b>lundi, 26 mai 2025 à 22:30<br>
<b>À : </b>Yakimus // Netassist NOC <yakimus@netassist.ua><br>
<b>Cc : </b>bird-users@network.cz <bird-users@network.cz><br>
<b>Objet : </b>Re: BIRD performance in a dynamic scenario<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Sure !</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Configuration example:</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">```</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">ipv4 table table_1;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">protocol bgp {</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> local 10.0.0.1 as 65000 ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> neighbor range 0.0.0.0/0 internal</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> dynamic name "peer_";</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> dynamic name digits 4;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> router id 10.0.0.1;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> strict bind;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> ipv4 {</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> table table_1;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> import filter import_policy_filter;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> export all;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> next hop address 10.0.0.1;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> };</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">}</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">function get_community_from_peer_address(ip addr) -> pair {<br>
case addr {<br>
10.0.1.1: (1,1) ;<br>
10.0.2.1: (245, 12434) ;<br>
…</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> else : (0, 0) ;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> }<br>
}</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Filter import_policy_filter {</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> pair comm = get_community_from_peer_address(from);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> bgp_community.add(comm);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">}<br>
```</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I want to modify the route attributes based on the peer, but from a dynamic neighborship.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt">You could argue that could just add a new `bgp` protocol with the correct neighbor address and filter but I work on a porject where we don’t about all the peers in advance and adding/removing multiple bgp/static/l3vpn
protocols for each peers tends to slow down the process of configuration reloading. Hence I found a solution of having those functions with switch cases which allow me to do minimal changes in the configuration file. However, I found it a bit hacky and wanted
your view on that.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">De :
</span></b><span style="color:black">Yakimus // Netassist NOC <yakimus@netassist.ua><br>
<b>Date : </b>lundi, 26 mai 2025 à 22:15<br>
<b>À : </b>Maxime Peim (mpeim) <mpeim@cisco.com><br>
<b>Cc : </b>bird-users@network.cz <bird-users@network.cz><br>
<b>Objet : </b>Re: BIRD performance in a dynamic scenario</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt">Please clarify how do you describe the configuration for your dynamic peers?
<br>
<br>
-- <br>
Mykola Yakymenko<br>
NETassist<br>
<br>
On Mon, May 26, 2025 at 06:40:33PM +0000, Maxime Peim (mpeim) wrote:<br>
> Any idea if there is a way for dynamic neighbours?<br>
> <br>
> De : Bird-users <bird-users-bounces@network.cz> de la part de Maxime Peim (mpeim) via Bird-users <bird-users@network.cz><br>
> Date : mercredi, 21 mai 2025 à 14:32<br>
> À : Yakimus // Netassist NOC <yakimus@netassist.ua><br>
> Cc : bird-users@network.cz <bird-users@network.cz><br>
> Objet : Re: BIRD performance in a dynamic scenario<br>
> Indeed, if you know the peer in advance, right ?<br>
> What about dynamic neighbor ?<br>
> <br>
> De : Yakimus // Netassist NOC <yakimus@netassist.ua><br>
> Date : mardi, 20 mai 2025 à 15:56<br>
> À : Maxime Peim (mpeim) <mpeim@cisco.com><br>
> Cc : bird-users@network.cz <bird-users@network.cz><br>
> Objet : Re: BIRD performance in a dynamic scenario<br>
> Hello!<br>
> <br>
> You can add the comunity directly in the inbound filters of the peer<br>
> <br>
> --<br>
> Mykola Yakymenko<br>
> NETassist<br>
> <br>
> On Tue, May 20, 2025 at 07:43:28AM +0000, Maxime Peim (mpeim) via Bird-users wrote:<br>
> > Hi everyone,<br>
> ><br>
> > First of all, thanks a lot for BIRD !<br>
> ><br>
> > I have some questions about the dynamicity of BIRD wiht BGP.<br>
> > In a scenario where routes needs to be updated accondingly depending on some external informations, I find out that those informations would need to be written into the BIRD configuration file.<br>
> ><br>
> > As an example, if we need to add a bgp community based on the peer address (already known), we would need something like that :<br>
> ><br>
> > ```bird<br>
> > function get_community_from_peer_address(ip addr) -> pair {<br>
> > case addr {<br>
> > <addr1> : (1,1) ;<br>
> > <addr2> : (245, 12434) ;<br>
> > …<br>
> > else : (0, 0) ;<br>
> > }<br>
> > }<br>
> > ```<br>
> ><br>
> > And we could update that function if needed in the future but the configuration will need to be parsed each time.<br>
> > If the rate of update is high, it can become a bootleneck.<br>
> ><br>
> > So I would like to know if I am going the right direction doing that way ?<br>
> > Is there a plan for a direct API to BIRD internals instead of passing a configuration file ?<br>
> ><br>
> > Thanks in advance for your answer,<br>
> > Maxime Peim<br>
> ></span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>