• 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 advertises 209.165.200.224/27 to R1.
    R1 already has this same prefix in its own LAN, and originates it locally into BGP through a network statement.

    BGP route received from external AS example

    Figure 1 – ISP1 advertises the prefix

    In this scenario, R1:

    • Learns 209.165.200.224/27 from 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 i

    Two paths exist for the same prefix:

    1. The locally originated route

      • Next Hop = 0.0.0.0 (the router itself)

      • Weight = 32768

    2. The route learned from ISP1

      • Next Hop = 10.0.11.2

      • Weight = 0

    The best-path marker *> is on the locally originated route.

    BGP locally originated route preferred weight 32768

    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:

    • 32768 is much higher than 0

    • The 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?