handling of unreachable routes with gateway direct

Alexander Zubkov green at qrator.net
Thu Oct 1 11:19:24 CEST 2020


Hello,

We have some routes that are passed via transit bird bgp-daemons
without installing them to the kernel. And for some of these routes we
need to keep their next hop attribute, because it is meaningful on the
destination host, but may be unreachable on those transit hosts.
If we have "gateway recursive" sessions with these transit hosts, then
such routes are accepted, just marked unreachable, but we can work
with them. And if we make the sessions "gateway direct", then such
routes are ignored by the bird with "Invalid NEXT_HOP attribute"
messages in log. Looks like it is caused by this piece of code in
proto/bgp/packets.c in function bgp_apply_next_hop():

    if (!nbr || (nbr->scope == SCOPE_HOST))
      WITHDRAW(BAD_NEXT_HOP);

It seems reasonable, of course, but it breaks things for our case. So
I want to suggest some changes to make our setup possible. At the
moment, I consider the possibility of adding something like "gateway
<direct_with_recursive_fallback>" so that it would behave like
"gateway direct", but in the case of a non-reachable neighbour, it
would switch to recursive logic. What do you think? Whether this is a
good idea or maybe you can suggest some better variants?

We have a couple of reasons why we want "gateway direct":
We want to avoid double recursion, which is not allowed - we might
have some other recursive routes that use direct routes received in
this session. We could make separate sessions for direct and transit
routes, but I'm not sure that the whole thing would be simpler.
And there is an issue with next-hop resolution when we have the same
ips on different interfaces. As I understand, bird daemon currently
does not support that case.


More information about the Bird-users mailing list