Question about extracting values from bgp_ext_community in BIRD
yazan slaila
yazan.slaila at hotmail.com
Mon Sep 15 19:53:23 CEST 2025
Hello there,
I am currently working with BGP route filtering in BIRD daemon, specifically with the bgp_ext_community attribute.
I want to understand how to properly extract individual values from tuples inside the bgp_ext_community list. For example, when an extended community contains something like (rt, 1, 10), I need to store the third value (10) into a variable and use it in my filter logic.
I want to iterate with a for loop on the ext_community list (ec) and extract the last value. For example:
# Iterate through all extended communities
for ec c in bgp_ext_community do {
print "Yaz: " , c;
And the output:
bird: Started
bird: Yaz: (rt, 2, 70)
bird: Yaz: (rt, 3, 90)
bird: Yaz: (rt, 4, 80)
bird: Yaz: (rt, 5, 20)
I also tried accessing fields with .type or .val, but that seems unsupported --> c.type, or c.val
Could you please clarify:
1.
What is the correct way to iterate over bgp_ext_community in a filter?
1.
How can I extract individual values (e.g., asn, value) from a route target community like (rt, 1, 10)?
2.
Are there predefined functions or operators in BIRD to work with extended community tuples?
Any guidance or documentation pointers would be greatly appreciated.
Thank you for your time and for the excellent work on BIRD.
Best regards,
Yazan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20250915/0cbd71b4/attachment.htm>
More information about the Bird-users
mailing list