Using as set a list of routes to advertise
Maria Matejka
maria.matejka at nic.cz
Wed May 10 11:46:23 CEST 2023
Hello!
On 5/10/23 11:13, William wrote:
> Hi All,
> I've been digging around trying to find a nice way of doing it but can't
> seem to find a valid answer.
>
> Is there a way to use a prefix set to create static routes?
No, this is not possible and implementing this would be surprisingly
difficult as the prefix sets are implemented as a compressed trie
optimized for fast lookup and not enumeration.
Also imagine this:
define my_route_set = [ 2001:db8/32+ ]; # note the plus sign
protocol static { ipv6; route my_route_set via 2001:db8::dead:beef; }
This short code would generate approx. 7.9e28 routes.
If you could elaborate more precisely what you are trying to achieve as
a whole result, we may try to help you find how to do it in the way BIRD
is designed.
Maria
> Ideally though being able to specify the set as the route to be added
> would be ideal. An alternative of something like a "for" loop that
> iterate through the set and adds the routes to the table would suffice.
>
> For example:
>
> define my_route_set = [ 10.1.2.3/24, 172.20.4.2/24, 10.200.0.0/23 ];
>
> protocol static route_set {
> ipv4 {
> table Some_Routes;
> }
> route my_route_set via 192.168.55.2; # downstream static gateway
> }
>
> The prefix set is used to define the subnets for a remote node and used
> in import/export filters via BGP upstream. Being able to re-use the set
> without having to split it out would be hugely advantageous.
>
> I want to avoid having the neighbour device provide the routes via a
> routing protocol where it can be avoided.
>
> TIA.
>
> Regards,
> William
More information about the Bird-users
mailing list