BGP Default local preference and its appearance in the BGP table
The default value for local preference in a BGP topology is 100. The local preference value will appear in the BGP table only if the information about that prefix was received from an iBGP peer. If not, the local preference value in the BGP table will be blank.
For example, refer to the following topology:
All local preference values remain at their default values. BGP has been configured such that R1 has eBGP peerings with R2 and R3, and R2, R3, and R4 have been configured as iBGP peers.
The BGP table of R4 appears as follows:
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
The LocPrf value in the BGP table appears in both entries. Since the LocPrf is the same, the tie-breaking BGP - Attributes and path selection|BGP attribute is the lower next hop IP address of 2.2.2.2.
The BGP table of R2 is as follows:
R2#show ip bgp BGP table version is 2, local router ID is 2.2.2.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, t secondary path, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path * i 1.1.1.0/24 192.168.13.1 0 100 0 1 i *> 192.168.12.1 0 0 1 i
In this case, the LocPrf column is only populated for the prefix that was learned from an iBGP peer. The column is left blank for the prefix learned via the eBGP peer, but it is still set to 100 by default. The tie-breaking BGP attribute in this case is the preference of eBGP over iBGP.
Similarly, the BGP table of R3 is as follows:
R3#show ip bgp BGP table version is 2, local router ID is 3.3.3.3 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, t secondary path, Origin codes: i - IGP, e - EGP, ? - incomplete RPKI validation codes: V valid, I invalid, N Not found Network Next Hop Metric LocPrf Weight Path * i 1.1.1.0/24 192.168.12.1 0 100 0 1 i *> 192.168.13.1 0 0 1 i
Once again, the LocPref column is only populated in the prefix learned via iBGP. Again, the eBGP over iBGP preference is used as the tie-breaking BGP attribute.
Links
https://networklessons.com/bgp/how-to-configure-bgp-local-preference-attribute