cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1743
Views
10
Helpful
8
Replies

BGP - Local Preference

PAUL CHEN
Level 1
Level 1

Hi,

I am trying to figure out why the route with the localPrf of 110 is chosen as the best route over the one with the localPrf of 200 ? I was under the impression that the route with the highest local preference is usually chosen. Any help appreciated.

The 'sh ip bgp' output is in the attached file.

Thanks.

8 Replies 8

jlunsford
Level 1
Level 1

I can't seem to grab that text file.

However, my first thought is, are both routes for the same size network? Or is one a more specific route, like a /24 and a /26 or something?

I'm sure its probably not something as simply as that, but without being able to see that text file or any other config information, it was the first obvious thing I could think of..

-Cheers

Here is the content of the file:

router_b#sh ip bgp

BGP table version is 3, local router ID is 172.16.1.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal

Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path

*> 0.0.0.0 10.0.0.4 110 0 100 i

* i 10.0.0.2 200 0 100 i

* i221.10.1.0 11.1.1.1 0 100 0 i

*> 0.0.0.0 0 32768 i

router_b#

It seems to pretty clearly be two advertisements for the same prefix.

Paul

Since the next hop is in the same subnet I am wondering if there is something in the peering arrangement that is affecting this. Perhaps it would be helpful if we could get the output of show ip bgp 0.0.0.0 and perhaps the complete bgp configuration.

[edit] it is a little easier to read in the file since the spacing of the fields shows relationships that are not so obvious with the acsii rendition of spacing in this post.

HTH

Rick

HTH

Rick

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Paul,

from your file:

*> 0.0.0.0 10.0.0.4 110 0 100 i

* i 10.0.0.2 200 0 100 i

the one with a greater local preference is received on an iBGP session, the one with a lower local preference comes from a direct eBGP session.

Have you disabled bgp sync ?

router bgp

no sync

on the router, otherwise it will wait to receive the same prefix 0.0.0.0/0 on an IGP protocol.

Hope to help

Giuseppe

I'll have to bow to Giuseppe's expertise on this matter, but I thought the sychronization with the local IGP only affected if the route was announced by BGP. I didn't think it affected whether or not the route would be picked up by the local routing table for use. (But I'm a novice at BGP)

I was thinking you might want to go one more step up the decision ladder. Is the next-hop (10.0.0.2) a reachable IP from that router?

If not, then you may need to add the route, or configure next-hop-self..

Please let us know what you find, I'm curious as to what the problem is.

-Cheers

It would definitely be easier if we had the output of the "show ip bgp 0.0.0.0" command.

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Hi Everyone,

Thanks for the input. Attached is the file with the output for sh ip bgp 0.0.0.0 and router_b's config.

I am trying to simulate a primary and backup link scenario.

AS 200 is advertising a default route to 2 routers in AS 100.

The intention is to have router_b as the backup link, hence the local preference of 110.

It appears it has chosen the best route based on the eBGP admin distance of 20 instead of the local preference.

Any comments appreciated.

Thanks,

Paul

Paul,

According to the output you provided, the issue is with synchronization. You need to configure "no synchronization" under the bgp process to make the path with the local preference of 200 preferred over the other.

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

CriscoSystems
Level 5
Level 5

In deciding on a BGP route, the decision process on a Cisco router is

Step 1. Is synchronization DISABLED? If yes, go to Step 2. If not, is the route available via IGP, static, or connected? If yes go to Step 2; if not, drop the route.

Step 2. Choose whichever route has the highest WEIGHT value.

Step 3. Choose the route with the highest local preference.

So if you've vetted the synchronization issues, make sure both routes have the same weight in the "sh ip bgp" command output. If they do, then I defer to the smarter folks here.

Check out policy maps assigned either to the neighbors or the interfaces.

Review Cisco Networking for a $25 gift card