BGP extented communities checks
Hi folks! I have played with extended communities with some of my peers, and have written this function below to facilitate my checks. On the examples found on github (https://gitlab.labs.nic.cz/labs/bird/wikis/Route_server_with_community_based... and https://gitlab.labs.nic.cz/labs/bird/wikis/Route_server_with_community_based...) I have noticed that RO are used : if (ro,myas,peeras) ~ bgp_ext_community then return true; bgp_ext_community.delete([(ro,0,*)]); But according to my tests, RT should be used. Did anybody made the same ascertainment? ----- ### Chek if the community or ext_community is present function is_community(int left; int right) { if right > 65535 then { #Check of the extended community for 32b ASN if (rt,left,right) ~ bgp_ext_community then return true; } else { #Check of the extended (and not ext) community for 16b ASN if ((left,right) ~ bgp_community) || ((rt,left,right) ~ bgp_ext_community) then return true; } return false; } ---- Cheers, -- Arnaud Fenioux Network Engineer - FranceIX
On Thu, May 21, 2015 at 11:37:23PM +0200, Arnaud Fenioux wrote:
Hi folks!
I have played with extended communities with some of my peers, and have written this function below to facilitate my checks.
On the examples found on github (https://gitlab.labs.nic.cz/labs/bird/wikis/Route_server_with_community_based... and https://gitlab.labs.nic.cz/labs/bird/wikis/Route_server_with_community_based...)
I have noticed that RO are used : if (ro,myas,peeras) ~ bgp_ext_community then return true; bgp_ext_community.delete([(ro,0,*)]);
But according to my tests, RT should be used. Did anybody made the same ascertainment?
Hi Well, you could use either RT or RO, they are just different classes of extended communities. But semantically, using RT makes more sense. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On 22 May 2015, at 10:52, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Thu, May 21, 2015 at 11:37:23PM +0200, Arnaud Fenioux wrote:
Hi folks!
I have played with extended communities with some of my peers, and have written this function below to facilitate my checks.
On the examples found on github (https://gitlab.labs.nic.cz/labs/bird/wikis/Route_server_with_community_based... and https://gitlab.labs.nic.cz/labs/bird/wikis/Route_server_with_community_based...)
I have noticed that RO are used : if (ro,myas,peeras) ~ bgp_ext_community then return true; bgp_ext_community.delete([(ro,0,*)]);
But according to my tests, RT should be used. Did anybody made the same ascertainment?
Hi
Well, you could use either RT or RO, they are just different classes of extended communities. But semantically, using RT makes more sense.
Hello Ondrej, Thank you for your answer, So, I’m surprised RO are not working for me! Could someone update the GitHub examples, as RT seams more logical, and works like expected? Thanks -- Arnaud Fenioux Network Engineer - FranceIX
On Thu, May 28, 2015 at 11:48:25AM +0200, Arnaud Fenioux wrote:
Thank you for your answer, So, I’m surprised RO are not working for me!
What do you mean by RO were not working for you? RO communities were set in routes but matching expressions return bad results?
Could someone update the GitHub examples, as RT seams more logical, and works like expected?
Perhaps i will fix this. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On 2 Jun 2015, at 11:26, Ondrej Zajicek <santiago@crfreenet.org> wrote:
On Thu, May 28, 2015 at 11:48:25AM +0200, Arnaud Fenioux wrote:
So, I’m surprised RO are not working for me!
What do you mean by RO were not working for you? RO communities were set in routes but matching expressions return bad results?
Indeed, I had extended communities set in the routes by my peers, but in order to match them correctly in my filters I had to use RT and not RO. Arnaud
Could someone update the GitHub examples, as RT seams more logical, and works like expected?
Perhaps i will fix this.
-- Elen sila lumenn' omentielvo
Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (2)
-
Arnaud Fenioux -
Ondrej Zajicek