BGP communities

Alexander Zubkov green at qrator.net
Mon Apr 6 17:32:09 CEST 2020


bgp_community is a special variable that contains route attribute for
bgp routes:
https://bird.network.cz/?get_doc&v=20&f=bird-6.html#bgp-attr

On Mon, Apr 6, 2020 at 5:18 PM Cybertinus <bird at cybertinus.nl> wrote:
>
> Hello Fabiano,
>
>
> BGP Communities are basically tags you add to a prefix that is received from, or send to, a peer. And in Bird you can do whatever you want with these communities. A community by itself has no meaning and has no influence on the routing decision whatsoever. It is the meaning you add to it in your configuration what makes them work.
>
> More information about communities: https://en.wikipedia.org/wiki/Border_Gateway_Protocol#Communities
>
>
> Kind regards,
> Cybertinus
>
>
> On 2020-04-06 17:03, Fabiano D'Agostino wrote:
>
> and how these kind of checks are handled?
> if (myas,peeras) ~ bgp_community  what is bgp_community?
>
> Thanks,
>
> Il giorno lun 6 apr 2020 alle ore 15:32 Fabiano D'Agostino <fabiano.dagostino96 at gmail.com> ha scritto:
>
> Thank you, but "if the route does not come from BGP then false"
> here I have:
> protocol pipe a {
>     table master;
>     mode transparent;
>     peer table a;
>     import all;
>     export where bgp_out(x); => this becomes false, what does this mean?
>     #export all;
> }
>
> Thanks,
>
> Il giorno lun 6 apr 2020 alle ore 10:50 Bernd Naumann <bena at spreadshirt.net> ha scritto:
>
> On 05.04.20 23:08, Fabiano D'Agostino wrote:
> > Good evening,
> > could someone explain me the meaning of these lines?
> >
> > function bgp_out(int peeras)
> > {
> > if ! (source = RTS_BGP ) then return false;
> > if peeras > 65535 then return true; ### communities do not support AS32
> > if (0,peeras) ~ bgp_community then return false;
> > if (myas,peeras) ~ bgp_community then return true;
> > if (0, myas) ~ bgp_community then return false;
> > return true;
> > }
> >
> > Thanks,
> >
> > Fabiano
> >
>
> Morning,
>
> I can not cover the whole section but as a start...
>
> * if the route does not come from BGP then false (routing table source?)
> * if the remote AS Number is greater 65535 (16 Bit) then "just" return
> true (see AS 32 Bit Numbers, and the non-support of older
> devices/implementations)
> * For the next 3 I'm not 100% sure how to read but I found
> https://bird-users.network.narkive.com/3uDbo6H9/any-ix-willing-to-share-their-config
>
> ```
> 0:XXXXX - Do not announce route to peer XXXXX
> 0:MyASN - Do not announce route to all peers
> MyASN:XXXXX - Announce route to peer XXXXX only
> MyASN:MyASN - Announce routes to all peers. This community is
> automatically added to all routes that are not
> tagged with any of MyASN:XXXXX communities.
> ```
>
> Maybe this helps a little bit.
>
> Bernd



More information about the Bird-users mailing list