Course contents

Module 3: Path SelectionLesson 3.5 (5 of 13 in this module)14 of 43 in the BGP course

Attribute: ORIGIN

Every BGP route says how it first entered BGP. That small note, ORIGIN, usually sits unnoticed in the output until it breaks a tie.

Advanced · 9 min read

You'll learn to name the three ORIGIN codes, say which command sets each, and explain when ORIGIN decides a best path.

What ORIGIN records

ORIGIN is a well-known mandatory attribute. It records how the route first entered BGP. The router that originates the route sets it, and every other router passes it on unchanged.

One UPDATE: path attributes plus the prefixes they describe
One UPDATE: path attributes plus the prefixes they describeAn illustrative UPDATE from ISP A to R1. The path attributes ORIGIN, AS_PATH, NEXT_HOP and MED apply to the prefix 203.0.113.0/24 listed as network layer reachability information.UPDATE from ISP A to R1Path attributesNLRI (the destinations)ORIGIN: i (IGP)AS_PATH: 64501NEXT_HOP: 192.0.2.1MED: 0203.0.113.0/24One UPDATE can listseveral prefixes thatshare these attributes

On small screens, swipe sideways or focus the diagram and use the arrow keys.

A teaching view, not a byte-accurate capture. The attributes travel once and apply to every prefix listed beside them.
The three ORIGIN codes
The three ORIGIN codesEach code shows how the route started.i IGPSet by the network commandMost common, most preferrede EGPLearned from the old EGP protocolRare today? incompleteSet by redistributionOrigin cannot be shown

On small screens, swipe sideways or focus the diagram and use the arrow keys.

IGP is preferred over EGP, and EGP over incomplete.

Which command sets which code

The network command gives IGP, because you are telling BGP to advertise a prefix that exists in the routing table. Redistribution gives incomplete, because BGP only knows the route came from another source. aggregate-address gives IGP.

router bgp 64500 address-family ipv4 unicast network 198.51.100.0 mask 255.255.255.0 redistribute connected route-map CONNECTED-TO-BGP

The network line creates an IGP-origin route. The redistribute line creates incomplete-origin routes for whatever the route map permits.

Where ORIGIN decides

ORIGIN is step 5 of best-path selection on Cisco IOS XE, after AS path length and before MED. It only matters when weight, local preference, locally originated status and AS path length all tie, so it breaks ties between a route that was originated with network and the same prefix learned as redistributed.

How a Cisco router chooses one best path
How a Cisco router chooses one best pathTen rows. A path must first be valid with a reachable next hop. Then Cisco IOS XE compares weight, local preference, local origination, AS_PATH length, origin, MED, eBGP over iBGP, IGP metric to the next hop and finally the tie-breakers. The first difference decides.Gate: the path must be valid, with a reachable next hop and not filtered1Weighthighest wins (Cisco only, local to this router)2LOCAL_PREFhighest wins (shared inside the AS)3Locally originatedpreferred over paths learned from peers4AS_PATH lengthshortest wins5ORIGINlowest wins: IGP, then EGP, then incomplete6MEDlowest wins (same neighbouring AS by default)7eBGP over iBGPan external path beats an internal one8IGP metric to next hoplowest wins9Tie-breakersoldest eBGP path, lowest router ID, lowest neighbour IPFirst difference wins. Steps 1 and 2 are the ones you configure most often.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The comparison stops at the first step where the paths differ. Later steps are never reached for that prefix.

In practice the most common cause of an unexpected incomplete origin is redistribution that leaks into the path. Replace it with the network command, or set the origin explicitly.

route-map SET-ORIGIN permit 10 set origin igp ! router bgp 64500 address-family ipv4 unicast redistribute static route-map SET-ORIGIN

Redistributes a static route and marks it IGP, so it competes on equal terms with network-originated routes.

Reading ORIGIN

Illustrative Cisco IOS XE output written for this lesson, not a router capture
R1#show ip bgp
     Network          Next Hop            Metric LocPrf Weight Path
 *>  198.51.100.0/24  0.0.0.0                  0         32768 i
 *>  203.0.113.0/24   192.0.2.1                0             0 64501 i
 *>  192.0.2.128/25   0.0.0.0                  0         32768 ?
The code is the last character on each line. 198.51.100.0/24 came from the network command (i). 203.0.113.0/24 originated as IGP in AS 64501. 192.0.2.128/25 was redistributed here, so it shows a question mark.

Check your understanding

Predict · scenario 1

A route shows ? at the end of its line in show ip bgp. What does that mean?

Predict · scenario 2

Which origin does the network command set?

Predict · scenario 3

Two paths tie on weight, local preference and AS path length. One is IGP and one is incomplete. Which wins?

FAQ

Why is there an EGP origin?
EGP was an older exterior protocol that BGP replaced. The code remains in the specification, but you will almost never see it on modern routers.
Is the incomplete origin a problem?
Not by itself. It means the route was redistributed, so BGP cannot say how it originated. It is simply the least preferred of the three when other things tie.
Can I change ORIGIN?
Yes, with set origin in a route map, though it is rarely needed. The usual fix for an unwanted incomplete origin is to use the network command instead of redistribution.