changing bgp_med attributes cause route been filited

Ondrej Zajicek santiago at crfreenet.org
Thu Jul 27 01:51:30 CEST 2023


On Thu, Jul 20, 2023 at 08:25:24PM +0800, Brandon Zhi wrote:
> Hi all,
> 
> I was doing research about selecting the best route on multiple nodes based
> on bgp_med attributes.
> 
> 
> My idea is to add bgp_med value between each node based on ping, and then
> bird will select the route which has the lowest bgp_med value (which is the
> total ping delay)
> 
> But some routes will be filled, which i don't want it.
> 
> I found that the code " bgp_med = bgp_med + bgp_med_ping + bgp_med_ping;"
> will cause some routes to be filtered.
> 
> Can someone tell me why? I only want to modify bgp_med and don't want my
> routes to be filtered.

Hi

Perhaps there are some error in logs about filter failures? I guess that
when bgp_med is not defined, then expression 'bgp_med + X' fails.

You could try something like:

  if (defined(bgp_med))
    bgp_med = bgp_med + X;
  else
    bgp_med = X;


And perhaps even better than use bgp_med for this is to use bgp_aigp
attribute and associated BGP options (aigp, cost).

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at 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."


More information about the Bird-users mailing list