How to Configure BGP Weight Attribute

Hello Anoop

At first glance, this confused me as well! It took me a while but I finally realized what’s going on.

First of all, the default local preference for BGP is 100. So if you see a blank in the LocPrf column of the BGP table, you can put in a 100 there. Based on this, you can see that since the local preference is the same, the tie-breaking attribute is eBGP vs iBGP.

Now the next question that came to mind is, why does the local preference appear in the entry for 3.3.3.3 and not in the entry for 192.168.12.1? Well, the local preference value will only appear if that value has been retrieved from an iBGP peer. Remember, the local preference is a value that is shared among iBGP routers. Therefore, the 100 in the first entry, is the local preference that is sent from R3. There is no local preference value received from R1 because that’s an eBGP relationship, so no value is entered in the table, but the default is 100.

Now if you take a look at the BGP table of R4, you will see that the LocPrf column is populated like so:

R4#show ip bgp 
BGP table version is 2, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i1.1.1.0/24       3.3.3.3                  0    100      0 1 i
*>i                 2.2.2.2                  0    100      0 1 i

You see the LocPrf of 100 for both neighbors because they have been advertised as such over the iBGP peering.

I hope this has been helpful!

Laz