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.
| Link | First endpoint | Second endpoint |
|---|---|---|
| R1–R2 | R1 GigabitEthernet1: 192.0.2.1/30 | R2 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
endR2
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
endInspect 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 iR1’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-familyR1# 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 iThe 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-familyR1# clear ip bgp 192.0.2.2 soft inR1# 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 iLocal 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 Loopback10The 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-familyR1# clear ip bgp 192.0.2.2 soft inR1# 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 iKey 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.
Protocol and command references
Best-path comparison rules · BGP path attributes · Router-symbol attribution.