BGP Origin Code Attribute explained

I think you have a typo
In your example you have
Lets see what R2 thinks of this

R1#show ip bgp
^^

This is confusing because R1 will prefer the locally originated route by virtue of the path selection algorithm step 3
The output is clearly from R2 but the prompt is R1

Stuart

Hi Stuart,

I see I haven’t replied to this before. Thanks for reporting, it has been fixed.

Hi,

please could we prefer origin code (?) over (i) ?

Hi Rawaz

Unfortunately, you can’t change the logic to prefer incomplete (?) over IGP (I).

However, you shouldn’t want this…if you want to influence your routing, it’s best to use any of the other BGP attributes.

Rene

hi
so how i can prefer one path over another using BGP origin code ?

BR//

Hi Ason,

You shouldn’t :slight_smile: It’s best to use any of the other attributes to make a decision like weight, local preference, AS path, etc.

Rene

Hi,
R1 and R3 has same loopback interface ip 1.1.1.1

how is it possible ip address in same network

Thanks

Hello Sims

In this lab, Rene is using loopbacks to represent the same network. In a production network, you would have a switch connected to both R1 and R3, and you would have both routers on the same subnet/VLAN. However, in this case, in order to advertise the same network, Rene used loopback addresses. The important thing here is that both R1 and R3 have routes to the 1.1.1.0/24 network, and that is what is being advertised. Strictly speaking, he could have configured one loopback as 1.1.1.1 and the other as 1.1.1.2 but it would not change the results of this lab specifically.

I hope this has been helpful!

Laz

Hi Rene,

I am still not clear on the differences between originate and the origin attributes,…I dont see them in the list,but its there in the post that you put on the path selection…Can you please help me understand ?

Hello Vasanth

Different lists will use slightly different names for various attributes. What is named Originate in Rene’s list is described as “Prefer the path that was locally originated via a network or aggregate BGP subcommand or through redistribution from an IGP” by Cisco. Similarly, what is described as Origin Code by Rene, is described as “Prefer the path with the lowest origin type” by Cisco.

For a clearer understanding of the difference between these two particular attributes, take a look at the following post.

I hope this has been helpful!

Laz

Hi Rene
thanks for excellent presentation on the BGP basics
Just need your help to understand this origin codes correctly

as per origin code topic it’s mentioned
? is incomplete and redistributed routes from IGP and completely understand this but “i " for IGP but “i” will be referring to prefixes advertised with network statement command in BGP config ?
not 'i” as an IGP right ?

/thanks
ragu

Hello Ragu

Yes, it can get a bit confusing with the terminology and the sources of information. Let me try to clarify.

An origin code of i does indeed mean IGP, as in interior gateway protocol. Why is that term used even though it refers to networks added using the network command? Well, it comes from the fact that in order for a prefix to appear in the BGP table and be advertised, it must first exist in the local routing table. And how are prefixes placed in the local routing table? Via an IGP (or via static or directly connected routers of course). So if you enter the network command on R1, a prerequisite of that network being advertised to R2 is that it must be in the local (R1’s) routing table. I know it’s not a completely airtight argument, but that’s where the choice of the origin code name comes from.

Alternatively, when redistributing, the source could be anything. An IGP, a route map, directly connected networks, or another instance of BGP, so the ? is appropriate to use there.

I hope this has been helpful!

Laz