In the previous lesson, Weight decided the path on a single router and Local Preference steered the exit point of an entire AS.
After Weight and Local Preference, the next decision point in the BGP best-path algorithm is:
Prefer locally originated routes.
This rule applies when a router both owns a prefix (it has injected it into BGP itself) and receives the same prefix from a BGP neighbor. The router must decide which version to install.
The Scenario
Look at the topology below.
ISP1 advertises209.165.200.224/27to R1.
R1 already has this same prefix in its own LAN, and originates it locally into BGP through anetworkstatement.
Figure 1 – ISP1 advertises the prefix
In this scenario, R1:
Learns
209.165.200.224/27from ISP1 (AS 200)Also originates the same prefix internally through its own configuration
Without any extra configuration, check the BGP table directly:
R1# show bgp ipv4 unicast BGP table version is 9, local router ID is 10.0.11.1 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 *> 209.165.200.224/27 0.0.0.0 0 100 32768 i * 209.165.200.224/27 10.0.11.2 0 100 0 200 iTwo paths exist for the same prefix:
The locally originated route
Next Hop =
0.0.0.0(the router itself)Weight =
32768
The route learned from ISP1
Next Hop =
10.0.11.2Weight =
0
The best-path marker
*>is on the locally originated route.
Figure 2 – Locally originated preferred
Why Does This Happen?
Cisco IOS automatically assigns:
Weight = 32768 to locally originated routes.
Since Weight is the first attribute evaluated in the BGP decision process:
32768is much higher than0The local route wins immediately, before any other attribute is even considered
No additional configuration is needed to prefer the local route.
The behavior is built into how Cisco implements the best-path algorithm.Answer the question below
What weight does Cisco IOS automatically assign to locally originated routes?
After Weight, Local Preference, and locally originated routes, BGP evaluates:
Shortest AS-PATH wins.
The AS-PATH is the list of Autonomous Systems that a prefix has crossed before reaching you.
Equal AS-PATH Length
Look at the topology below.

Figure 3 – Equal AS path length
40 % Complete: you’re making great progress
Ready to pass your CCNP exam?