Extracting octets/quads from IP addresses in filter expressions

Stefan Pisjak stefan.pisjak at nts.eu
Wed Apr 8 10:54:52 CEST 2026


Hi fellow bird users!

I've searched through the documentation/this mailing list, but I
haven't found anyone trying to build a similar filter so far.

I'm trying to build a filter to only allow BGP routes if the "host
part" of `ip from` matches the route that is being announced, e.g.:

10.0.1.2 is allowed to announce 10.100.1.2/32
10.0.1.3 is allowed to announce 10.100.1.3/32
[...]
10.0.X.Y is allowed to announce 10.100.X.Y/32


But as far as I can tell, it's not possible to somehow convert the type
ip to type quad or something like that. Is there a better way to build
this filter, or can you somehow create a new variable of the type ip
and modify it or convert the ip to a quad and then do the
manipulations?

Kind regards,
Stefan
DISCLAIMER: This communication may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message by mistake, please advise the sender by reply email and delete the message. Thank you.



More information about the Bird-users mailing list