cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2931
Views
0
Helpful
7
Replies

BGP Rib-failure

noobieee7
Level 1
Level 1

Hi All,

My topology is as below:

Switch A -- Router A -- Upstream Router A

            |          |

            | __  Router B --Upstream Router B

Router A and Router B belongs to AS 1111

Upstream Router A and Upstream Router B belongs to AS 2222

Router A config

router bgp 1111
bgp log-neighbor-changes
neighbor 1.1.1.2 remote-as 1111
neighbor 2.2.2.2 remote-as 2222
!
address-family ipv4
  no synchronization
  neighbor 1.1.1.2 activate
  neighbor 1.1.1.2 next-hop-self
  neighbor 2.2.2.2 activate
  neighbor 2.2.2.2 route-map INTERNET-IN in
  neighbor 2.2.2.2 route-map INTERNET-OUT out
  no auto-summary
exit-address-family

router ospf 1
router-id 1.1.1.1
log-adjacency-changes
default-information originate

Both Upstream A and Upstream B are advertising default route into Router A and Router B.

Router B has similar configuration. The only difference is that on Router A, local preference for routes coming in from AS 2222 is set to 200 and on Router B, AS prepend are being set for routes advertised to AS 2222.

I am seeing the below on Router B.

BGP routing table entry for 0.0.0.0/0, version 11
Paths: (2 available, best #1, table default, RIB-failure(17))

Why is that happening? I thought that the default route learn from Upstream Router B at Router B has an AD of 20 and it should be the most preferred?

1 Accepted Solution

Accepted Solutions

Hello,

Just like to clarify on this, for all those ebgp and ibgp routes, 
irregardless of the AD (20 and 200), it will be determined at the 
LOC-rib level for BGP and the tie will be actually based on the tie 
breaker for BGP, in this case LP?

Correct. The BGP  will choose the best path for a destination according to its own rules,  and only then offers the best path to the routing table. Depending on  whether the best path is learned via iBGP or eBGP, the route will be  offered to the routing table with the respective AD (200 or 20). But for  selections in the LOC-rib, the AD is irrelevant.

Regarding  the wiki quote, I have a feeling that the description there is a strong  simplification of the (rather lengthy) BGP bestpath algorithm,  obviously shortened for clarity purposes. However, as you seem to go  into depth, I suggest reading the following document that discusses the  BGP bestpath algorithm in detail:

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml

Best regards,

Peter

View solution in original post

7 Replies 7

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

Would it be possible to show us the output of the following commands from both router A and router B?


show ip route

show ip bgp

show ip bgp rib-failure

Thanks!

Best regards,

Peter

Router A

show ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
  Known via "bgp 2222", distance 20, metric 0, candidate default path
  Tag 1111, type external
  Last update from 2.2.2.2 01:37:25 ago
  Routing Descriptor Blocks:
  * 2.2.2.2, from 2.2.2.2, 01:37:25 ago
      Route metric is 0, traffic share count is 1
      AS Hops 1
      MPLS label: none

show ip bgp
BGP table version is 23, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, x best-external
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0          2.2.2.2                 200      0 2222 i

show ip bgp rib-failure
Network            Next Hop                      RIB-failure   RIB-NH Matches

Router B

show ip route 0.0.0.0
Routing entry for 0.0.0.0/0, supernet
  Known via "ospf 1", distance 110, metric 1, candidate default path
  Tag 1, type extern 2, forward metric 40
  Last update from 4.4.4.1 on GigabitEthernet0/1/0, 01:40:31 ago
  Routing Descriptor Blocks:
  * 4.4.4.1, from 1.1.1.1, 01:40:31 ago, via GigabitEthernet0/1/0
      Route metric is 1, traffic share count is 1
      Route tag 1

show ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 11
Paths: (2 available, best #1, table default, RIB-failure(17))
Flag: 0x940
  Not advertised to any peer
  2222
    1.1.1.1 (metric 41) from 1.1.1.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 200, valid, internal, best
  2222, (received & used)
    5.5.5.2 from 5.5.5.2 (5.5.5.2)
      Origin IGP, localpref 100, valid, external

Hi,

Thanks, and please also just the plain output of the same commands without the 0.0.0.0 (in other words, use the commands just as I write them here, without being specific to the 0.0.0.0/0 route):

show ip route

show ip bgp

show ip bgp rib-failure

Best regards,

Peter

Hello,

I apologize, the output I have requested is probably not necessary anymore. The answer is here:

show ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 11
Paths: (2 available, best #1, table default, RIB-failure(17))
Flag: 0x940
  Not advertised to any peer
  2222
    1.1.1.1 (metric 41) from 1.1.1.1 (1.1.1.1)
      Origin IGP, metric 0, localpref 200, valid, internal, best
  2222, (received & used)
    5.5.5.2 from 5.5.5.2 (5.5.5.2)
      Origin IGP, localpref 100, valid, external

Note that it is the iBGP route that is assigned the highest local preference. The administrative distance (AD for short) at this point does not even exist. The administrative distance plays a role only after each routing protocol has chosen its own best candidate, and two different routing protocols are trying to insert the same network into the routing table.

So the BGP here selected the iBGP route received from 1.1.1.1 because its local preference is higher (step 2 in BGP best path algorithm, the step 1 being the weight attribute). So the BGP selected the iBGP route that would have the AD of 200. However, your routing table already contains a default route from OSPF with the AD of 110, therefore the OSPF here beats the BGP, and BGP reports a RIB-failure.

If you assign a higher local preference to the default route received from 5.5.5.2, it will win over OSPF.

Best regards,

Peter

Hi Peter,

Thanks!

I removed the route map that adjust the LP to be 200 and the default route's behavior is as what you have described.

Just like to clarify on this, for all those ebgp and ibgp routes, irregardless of the AD (20 and 200), it will be determined at the LOC-rib level for BGP and the tie will be actually based on the tie breaker for BGP, in this case LP?

I also found this statement from wiki

Once candidate routes are received from neighbors, the Loc-RIB  software applies additional tie-breakers to routes to the same  destination.

  1. If at least one route was learned from an external neighbor (i.e.,  the route was learned from EBGP), drop all routes learned from IBGP.
  2. Prefer the route with the lowest interior cost to the NEXT_HOP, according to the main Routing Table.  If two neighbors advertised the same route, but one neighbor is  reachable via a low-bitrate link and the other by a high-bitrate link,  and the interior routing protocol calculates lowest cost based on  highest bitrate, the route through the high-bitrate link would be  preferred and other routes dropped.

So in my case where the ebgp route was dropped instead of the ibgp route, it was due to the LP?

Hello,

Just like to clarify on this, for all those ebgp and ibgp routes, 
irregardless of the AD (20 and 200), it will be determined at the 
LOC-rib level for BGP and the tie will be actually based on the tie 
breaker for BGP, in this case LP?

Correct. The BGP  will choose the best path for a destination according to its own rules,  and only then offers the best path to the routing table. Depending on  whether the best path is learned via iBGP or eBGP, the route will be  offered to the routing table with the respective AD (200 or 20). But for  selections in the LOC-rib, the AD is irrelevant.

Regarding  the wiki quote, I have a feeling that the description there is a strong  simplification of the (rather lengthy) BGP bestpath algorithm,  obviously shortened for clarity purposes. However, as you seem to go  into depth, I suggest reading the following document that discusses the  BGP bestpath algorithm in detail:

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml

Best regards,

Peter

Hi Peter,

Many thanks for the explanation.

Regards,

Review Cisco Networking products for a $25 gift card