22 Oct

Arista – dealing with inactive routes in BGP

In EOS, BGP implementation normally considers only active routes in RIB for advertisement to its peers.

In certain deployments, IGP protocol like OSPF may carry same set of prefixes as BGP (especially if we use OSPF to form iBGP). In addition, routes from OSPF and BGP may be mutually redistributed. As a result, when local BGP process advertises these prefixes to its neighbors, it would always choose OSPF routes over corresponding BGP routes (admin distance of OSPF is better than that of BGP).

For a Cisco network engineer, this is totally deviate from their normal understanding. In Cisco, if the similar situation happened, it only marked as rib failure, but the BGP prefixes are still advertised out to other BGP peer.

Coincidentally, I encountered this situation and I will share my findings and workaround for reference.

Option 1 – advertise-inactive

This is documented by Arista, basically it tells the BGP to advertised out prefixes even though it is inactive (inactive due to better AD is exist in other routing protocol).

Option 2 – override the AD for prefixes learnt from iBGP peer

ip prefix-list default-only seq 10 permit
route-map set-distance-for-default permit 10
    match ip address prefix-list default-only
    set distance 20
 route-map set-distance-for-default permit 20
router bgp 65999
   neighbor route-map set-distance-for-default in

For my case, the is not installed in BGP because the switch is also receiving the same prefix from OSPF. Above config will set the AD for to 20 (instead of 200) when it received the BGP update from the peer. I can set it to any value as long as it is lower than 110 (OSPF)