cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
996
Views
0
Helpful
4
Replies

dual bgp routers with dual uplinks (primary/secondary) default route selection

kvescovi
Level 1
Level 1

I have two routers with a crossover (ibgp 65300) between.  R01 is supposed to be the primary route to default 10.35.128.89.  R02 terminates the back up link to another provider with neighbor 10.34.9.101.  Default information from the core is announced across each path to r01 and r02.  With default local pref of 100 between them, why isn't r02 choosing the default path of the iBGP crossover though r01 (10.35.128.89) as the best route?

r02#sho ip bgp
BGP table version is 71, local router ID is 10.127.24.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  0.0.0.0          10.34.9.101                            0 2828 65294 65269 i
 * i                  10.35.128.89             0    100      0 1 65299 65269 i
 *>  10.34.9.100/30   0.0.0.0                  0         32768 ?
 *>i 10.35.128.88/30  10.127.24.17             0    100      0 ?
 *>  10.96.0.0/16     10.34.9.101                            0 2828 65294 65269 ?
 * i                  10.35.128.89             0    100      0 1 65299 65269 ?
 *>  10.96.158.20/30  10.34.9.101                            0 2828 65294 65269 ?
 * i                  10.35.128.89             0    100      0 1 65299 65269 ?
 * i 10.127.24.0/21   10.127.24.17             0    100      0 i
 *>                   0.0.0.0                            32768 i
 s>i 10.127.24.1/32   10.127.24.17             0    100      0 ?
 s>  10.127.24.2/32   0.0.0.0                  0         32768 ?
 s>  10.127.24.16/30  0.0.0.0                  0         32768 ?
 s>  10.127.25.0/24   0.0.0.0                  0         32768 ?
 s>  10.127.30.0/24   0.0.0.0                  0         32768 ?
 s>  10.127.31.0/24   0.0.0.0                  0         32768 ?
r02#
4 Replies 4

nagasheshu2010
Level 1
Level 1

Hi Kvescovi,

This is because of the 7th criteria in the BGP selection process I.e, EBGP route over IBGP route.

Explanations:

1. Compar Weight - same

2.Compare LP - same

3.Is the Path Locally Originated? - Not both

4.Compare AS Path - Same

5. Compare origin - None of the two routes are neither learned using network command of BGP or redistributed into BGP. (one is EBGP route and second IBGP route)

6.Compare MED - Same

7. Compare neighbor type - EBGP nieghbor route preferred over IBGP neighbor route 

Solution - Change the AS path in secondary router for incoming routes to something higher than the primary routes AS path.

use aspath prepend in option.

configuration example

route-map PREPEND_IN permit 10
set as-path prepend 65300 65300


router bgp 65300
neighbor 10.35.128.89 route-map PREPEND in

clear ip bgp neighbor 10.35.128.89 soft in

hope this helps.

Thanks,

Nagasheshu.

Actually the iBGP neighbor is 10.127.24.1 and it's gateway is 10.35.128.89 which brings me to the local preference for 10.35.128.89.  It is 100 (default).  But there is no local pref for 10.34.9.101.  So it still chooses ebgp over ibgp (rule 7). So where am I interpreting the output incorrectly? I look at it as having a local pref of 100.

Thanks

LP for the IBGP route is not showing up for some reason, but there is default LP of 100.

Nagendra Kumar Nainar
Cisco Employee
Cisco Employee

Hi,

From the output, I assume 10.34.9.101 is eBGP neighbor and 10.35.128.89 is iBGP neighbor?. It is expected as the weight, Local-pref, AS-PATH (count), MED are same, it prefers eBGP learnt over iBGP learnt.

-Nagendra