BGP Origin Code
Read the final i, e or ? as an attribute of route origination, not as the internal or external type of the BGP session.
Network and origination
Use the same three-router AS arrangement as the prepend lab. Begin with the baseline network statements below, then on R3 replace only the target network statement with filtered connected redistribution.
| Link | First endpoint | Second endpoint |
|---|---|---|
| R1–R2 | R1 GigabitEthernet1: 192.0.2.1/30 | R2 GigabitEthernet1: 192.0.2.2/30 |
| R2–R3 | R2 GigabitEthernet2: 192.0.2.5/30 | R3 GigabitEthernet1: 192.0.2.6/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 198.51.100.1 255.255.255.0
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
network 198.51.100.0 mask 255.255.255.0
exit-address-family
endR2
hostname R2
ip cef
interface Loopback0
ip address 10.255.0.2 255.255.255.255
exit
interface GigabitEthernet1
ip address 192.0.2.2 255.255.255.252
no shutdown
exit
interface GigabitEthernet2
ip address 192.0.2.5 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
neighbor 192.0.2.6 remote-as 65010
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.1 activate
neighbor 192.0.2.6 activate
exit-address-family
endR3
hostname R3
ip cef
interface Loopback0
ip address 10.255.0.3 255.255.255.255
exit
interface Loopback10
ip address 198.51.100.3 255.255.255.0
exit
interface GigabitEthernet1
ip address 192.0.2.6 255.255.255.252
no shutdown
exit
router bgp 65010
bgp router-id 10.255.0.3
no bgp default ipv4-unicast
neighbor 192.0.2.5 remote-as 65020
address-family ipv4 unicast
no auto-summary
neighbor 192.0.2.5 activate
network 198.51.100.0 mask 255.255.255.0
exit-address-family
endip prefix-list TARGET seq 5 permit 198.51.100.0/24
route-map CONNECTED-TARGET permit 10
match ip address prefix-list TARGET
set metric 0
exit
route-map CONNECTED-TARGET deny 20
exitrouter bgp 65010
address-family ipv4 unicast
no network 198.51.100.0 mask 255.255.255.0
redistribute connected route-map CONNECTED-TARGET
exit-address-familyThe prefix-list filter permits only the /24. R1 still uses network origination. Leave AS-path length, local preference, weight and MED tied to isolate ORIGIN.
Compare origin codes
R2# show ip bgp 198.51.100.0/24
Network Next Hop Metric LocPrf Weight Path
*> 198.51.100.0/24 192.0.2.1 0 0 65010 i
* 192.0.2.6 0 0 65010 ?| Code | Meaning | Preference when earlier checks tie |
|---|---|---|
| i | IGP origin, normally created by network origination | First |
| e | Historical EGP origin | Second |
| ? | Incomplete origin, normally created by redistribution | Third |
R2 prefers the i path here. Incomplete does not mean corrupt or unreachable; it describes how the route was introduced. Policies can set the value explicitly.
Change origin with policy
In a separate lab policy experiment, set R1’s exported origin to incomplete and R3’s exported origin to IGP. On R1:
ip prefix-list TARGET seq 5 permit 198.51.100.0/24
route-map ORIGIN-TEST permit 10
match ip address prefix-list TARGET
set origin incomplete
exit
route-map ORIGIN-TEST permit 20
exitrouter bgp 65010
address-family ipv4 unicast
neighbor 192.0.2.2 route-map ORIGIN-TEST out
exit-address-familyOn R3:
ip prefix-list TARGET seq 5 permit 198.51.100.0/24
route-map ORIGIN-TEST permit 10
match ip address prefix-list TARGET
set origin igp
exit
route-map ORIGIN-TEST permit 20
exitrouter bgp 65010
address-family ipv4 unicast
neighbor 192.0.2.5 route-map ORIGIN-TEST out
exit-address-familyR1# clear ip bgp 192.0.2.2 soft out
R3# clear ip bgp 192.0.2.5 soft outR2# show ip bgp 198.51.100.0/24
Network Next Hop Metric LocPrf Weight Path
* 198.51.100.0/24 192.0.2.1 0 0 65010 ?
*> 192.0.2.6 0 0 65010 iInterpret the result
Both candidates are external paths at R2, even though one ends in i. A leading i in the status area would identify an internal path; the trailing i is ORIGIN. ORIGIN also differs from “locally originated on this router,” which is checked earlier. It does not name the source AS; the ordinary AS sequence supplies that information.
Restore the experiment
Detach the test policy from each originator; keep R3’s filtered redistribution to return to the original i-versus-? comparison.
R1
router bgp 65010
address-family ipv4 unicast
no neighbor 192.0.2.2 route-map ORIGIN-TEST out
exit-address-familyR3
router bgp 65010
address-family ipv4 unicast
no neighbor 192.0.2.5 route-map ORIGIN-TEST out
exit-address-familyR1# clear ip bgp 192.0.2.2 soft out
R3# clear ip bgp 192.0.2.5 soft outR2# show ip bgp 198.51.100.0/24
Network Next Hop Metric LocPrf Weight Path
*> 198.51.100.0/24 192.0.2.1 0 0 65010 i
* 192.0.2.6 0 0 65010 ?Key Takeaways
- The trailing i, e or ? is the ORIGIN attribute.
- When earlier checks tie, i is preferred to e, and e to ?.
- Network origination normally produces i; redistribution normally produces ?.
- Incomplete origin does not mean that a path is corrupt or unusable.
- Leading internal-path status, local origination and the source AS are separate concepts.
Protocol and command references
Best-path comparison rules · BGP path attributes · Router-symbol attribution.