PacketLab
BGP · Attributes and Path Selection

Locally Originated Routes

Distinguish a path this router originates from one it learns, and separate that local decision from the ORIGIN attribute.

Two-router example

Both routers have the same test /32 on separate Loopback10 interfaces, but unique Loopback0 router IDs. Initially only R2 originates it into BGP. This duplicate destination is deliberate for the comparison; it is not a recommendation to duplicate infrastructure identities.

Lab topologyIllustrative network
.1 / .2 · eBGPR1AS 65010R2AS 65020
Solid lines: physical links. Link labels use the last octet of 192.0.2.x; every link is a separate /30. AS labels identify the protocol relationship. Loopback0 is 10.255.0.N/32 for router RN. Exact interfaces and subnets are listed below.
LinkFirst endpointSecond endpoint
R1–R2R1 GigabitEthernet1: 192.0.2.1/30R2 GigabitEthernet1: 192.0.2.2/30
Complete baseline configurations

R1

hostname R1
ip cef
interface Loopback0
 ip address 10.255.0.1 255.255.255.255
exit
interface Loopback10
 ip address 203.0.113.12 255.255.255.255
exit
interface GigabitEthernet1
 ip address 192.0.2.1 255.255.255.252
 no shutdown
exit
router bgp 65010
 bgp router-id 10.255.0.1
 no bgp default ipv4-unicast
 neighbor 192.0.2.2 remote-as 65020
 address-family ipv4 unicast
  no auto-summary
  neighbor 192.0.2.2 activate
 exit-address-family
end

R2

hostname R2
ip cef
interface Loopback0
 ip address 10.255.0.2 255.255.255.255
exit
interface Loopback10
 ip address 203.0.113.12 255.255.255.255
exit
interface GigabitEthernet1
 ip address 192.0.2.2 255.255.255.252
 no shutdown
exit
router bgp 65020
 bgp router-id 10.255.0.2
 no bgp default ipv4-unicast
 neighbor 192.0.2.1 remote-as 65010
 address-family ipv4 unicast
  no auto-summary
  neighbor 192.0.2.1 activate
  network 203.0.113.12 mask 255.255.255.255
 exit-address-family
end
Outputs are illustrative, not recorded router results. Each lesson is a separate lab. Allow updates to converge after changes; the selected baseline path is an example when all earlier criteria tie.

Inspect the learned path

R1# show ip bgp 203.0.113.12/32
     Network          Next Hop        Metric LocPrf Weight Path
r>   203.0.113.12/32  192.0.2.2            0             0 65020 i

R1’s only BGP candidate is the remote path. The r indicates it loses IP-table installation to R1’s connected /32. A path can be best in BGP while not installed for forwarding.

Originate locally

On R1, select the exact connected /32 with a network statement.

router bgp 65010
 address-family ipv4 unicast
  network 203.0.113.12 mask 255.255.255.255
 exit-address-family
R1# show ip bgp 203.0.113.12/32
     Network          Next Hop        Metric LocPrf Weight Path
*>   203.0.113.12/32  0.0.0.0              0         32768 i
*                     192.0.2.2            0             0 65020 i

The local path appears with next hop 0.0.0.0 and default weight 32768. This first comparison already wins on weight; it alone does not prove the later local-origination comparison was reached. Network origination, redistribution and aggregation can all create local BGP paths.

Isolate local origination

For a controlled second experiment, on R1 set the received neighbor’s weight to the same 32768. Both paths now also have effective local preference 100.

router bgp 65010
 address-family ipv4 unicast
  neighbor 192.0.2.2 weight 32768
 exit-address-family
R1# clear ip bgp 192.0.2.2 soft in
R1# show ip bgp 203.0.113.12/32
     Network          Next Hop        Metric LocPrf Weight Path
*>   203.0.113.12/32  0.0.0.0              0         32768 i
*                     192.0.2.2            0         32768 65020 i

Local origination is now the first decisive comparison. It is a property of the candidate on this router, not a separate transmitted attribute. The final i is the ORIGIN code and has a different meaning.

Check route installation

R1# show ip route 203.0.113.12
Routing entry for 203.0.113.12/32
  Known via "connected", distance 0, metric 0
  * directly connected, via Loopback10

The connected route remains installed throughout this experiment; changing BGP’s candidate does not replace it. Restore the starting comparison by removing R1’s network statement and resetting the neighbor weight to 0.

router bgp 65010
 address-family ipv4 unicast
  no network 203.0.113.12 mask 255.255.255.255
  neighbor 192.0.2.2 weight 0
 exit-address-family
R1# clear ip bgp 192.0.2.2 soft in
R1# show ip bgp 203.0.113.12/32
     Network          Next Hop        Metric LocPrf Weight Path
r>   203.0.113.12/32  192.0.2.2            0             0 65020 i

Key Takeaways

  • A router can originate BGP routes using a network statement, redistribution or aggregation.
  • A local candidate normally appears with next hop 0.0.0.0.
  • Default local weight can decide before the local-origination comparison is reached.
  • Tie weight and effective local preference to isolate the local-origination step.
  • Local origination is distinct from the transmitted ORIGIN code and from IP-route installation.

Local Origination Quiz

Six questions · four options each · select one answer per question. Submit all answers to see your score and explanations.

1. Which next hop normally marks local origination in this table?
2. A local route has weight 32768 and a learned route has 0. What decides first?
3. Why set the received neighbor weight to 32768 in the controlled experiment?
4. Is local origination the same as trailing ORIGIN code i?
5. Why does the connected route remain installed on R1?
6. Which can create a local BGP candidate?
Protocol and command references

Best-path comparison rules · BGP path attributes · Router-symbol attribution.