Sunday, September 4, 2011

BGP adjacency problem

In this post i detail a recent problem encountered with a flapping BGP adjacency and a number of ways to resolve.



R1 has a BGP adjacency with R2. However this is continually flapping (see below).




The routers are peering using Loopback 0s that are reachable via OSPF.     The issue arises because as the BGP peering comes up the Loopback prefixes are advertised over the BGP adjacency.  OSPF AD is 110 whereas the eBGP route AD is 20. Hence the Loopback routes becomes preferred over the BGP adjacency. This is a type of recursive loop and not allowed (Just as learning the destination of the tunnel over the tunnel itself).     The adjacency is dropped and the whole process starts again.

I have detailed three solutions to the problem here

1) Block the Loopback prefixes from being received

On R2

ip prefix-list ric seq 5 deny 1.1.1.1/32
ip prefix-list ric seq 10 permit 0.0.0.0/0 le 32

router bgp 2
    neighbor 1.1.1.1 prefix-list ric in

2) Modify the distance of OSPF to be preferred over an eBGP route

router ospf 1
distance  ospf intra-area 19

3) Make use of the BGP backdoor command to raise the AD of the BGP route to 200.

router bgp 1
net 2.2.2.2 mask 255.255.255.255 backdoor

Once the command is used the route to 2.2.2.2 shows up in the BGP table as a RIB failure.  Use of the show ip bgp rib command completes the verification.





























 









No comments: