<div dir="ltr">You can set route attributes when defining static routes.<div><br></div><div>E.g. we stamp route preference onto sets of static routes (faked out example):</div><div><br></div><div>protocol static MY_STATIC_PROTO {<br>    route <a href="http://192.0.2.0/24">192.0.2.0/24</a> via 10.0.0.1 {<br>        bgp_med = 90;<br>        preference = 101;<br>    };<br>}<br></div><div><br></div><div>I haven't tried setting BGP communities directly on static routes there, but give it a shot? Alternatively, if you want to set an alternate arbitrary tag, maybe you want to create a custom attribute (<a href="https://bird.network.cz/?get_doc&v=20&f=bird-5.html#ss5.5">https://bird.network.cz/?get_doc&v=20&f=bird-5.html#ss5.5</a>) that you mark on your static routes, that can be read on BGP export to decide which communities to apply?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 12, 2023 at 4:51 PM Alexander Zubkov via Bird-users <<a href="mailto:bird-users@network.cz">bird-users@network.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>Hi,<div dir="auto"><br></div><div dir="auto">Just look at the docs:</div><div dir="auto"><a href="https://bird.network.cz/?get_doc&v=20&f=bird-6.html#ss6.14" target="_blank">https://bird.network.cz/?get_doc&v=20&f=bird-6.html#ss6.14</a><br></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 12, 2023, 23:57 Valery Lutoshkin <<a href="mailto:vpluto@gmail.com" target="_blank">vpluto@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Helvetica,Arial;font-size:13px">Hi,</div><div style="font-family:Helvetica,Arial;font-size:13px"><br></div><p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">I use Bird 2.0.9 to spread a special list of prefixes (about 100k) via BGP to an unknown list of users (around 1k).</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">The prefixes are supposed to be marked by different communities (6 right now) and receivers should be able to filter them by those communities to use only prefixes they want.</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal;min-height:14px"><br></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">While only one community should be attached to the prefix, I use just 6 different files with prefixes and attach the proper community in the import processes like this: </p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">protocol static importbgp_1 {</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">        ipv4 { import filter {bgp_community.add((65000,1)); accept;}; };</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">        include "/tmp/prefixes_1.txt";</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">}</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">Lines in the prefixes_1 file look like this:</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">route <a href="http://1.3.7.7/32" rel="noreferrer" target="_blank">1.3.7.7/32</a> unreachable; </p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal;min-height:14px"><br></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">But when I need to attach several communities to the prefixes, I have to create 2^6=64 different static protocols and generate 64 different files.</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">And for 8 communities I will have to create 256 protocols and files.</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal;min-height:14px"><br></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">If I could add some marks to routes in the imported file, I would use those marks in the import filter to attach communities to the prefix. </p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal;min-height:14px"><br></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">But if I’m not mistaken, there is no way of doing that.</p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal;min-height:14px"><br></p>
<p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">If there is a different solution to this issue that I’m unaware of, would you please let me know.</p><p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal"><br></p><p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">Best regards,</p><p style="margin:0px;font-style:normal;font-variant:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:"Helvetica Neue";font-kerning:auto;font-feature-settings:normal">Valery</p><div></div></div>
</blockquote></div></div></div>
</blockquote></div>