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
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 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 ?
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.
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 ?
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 had a question about the Origin attribute in the BGP best path selection process. Letās assume for a second that the Weight and Local Pref values are equal. Lets also assume we will never see a route originated by EGP. My understanding is that if a router learns about the same route from 2 or more separate neighbors, it will prefer the route with an origin of āinternal (i)ā over a route with an āincomplete (?)ā origin correct? if so, under what circumstances could this occur?
Assuming all previous BGP attributes are equal, once you get to the origin code, there are indeed three origin codes to choose from. These origin codes indicate from where the router has learned the route:
IGP (shows up as i)
EGP (shows up as e)
Incomplete (shows up as ?)
As you say, assuming you never see EGP since it is obsolete, you will prefer the route that was learned (originated from) an IGP rather than Incomplete.
IGP simply means that you used the network command in the BGP router to get that prefix into the BGP table. A prerequisite to get a prefix in the BGP table, is to have that prefix in the local routing table, and the only way to get it there is via an IGP or static routing. IGP includes both.
Incomplete indicates that the prefix was redistributed into BGP.
The following lesson shows examples of both of these cases:
The origin codes of IGP and Incomplete are specifically defined. If you have a route that is redistributed into BGP from another protocol, then by definition it has an origin code of incomplete. You canāt simply change how BGP determines the origin code.
However, you can change the way in which you advertise a particular route. If a route is redistributed into BGP, it will appear with an origin code of incomplete. However if you are able to use the BGP network command to advertise it, then that prefix will appear with an origin of IGP. Remember, to use the network command and have BGP advertise it, the prefix must first be found in the local routing table.
is it normal to get the 192.168.13.0 network due to redistribute connected on R2? since i is preferable e, e i preferable than ? why i get i as best route?
Iām not sure I understand what you mean. First of all, I assume you mean the 192.168.23.0 network correct?
Secondly, in the lesson, you can see that it is the route via 192.168.12.1 that is the best route:
R2#show ip bgp
BGP table version is 4, local router ID is 192.168.23.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 1.1.1.0/24 192.168.23.3 0 0 1 ?
*> 192.168.12.1 0 0 1 i
Note the ā>ā symbol appears where the āiā is and not where the ā?ā is.
Does that make sense? I hope Iāve answered your question, if not please clarify and Iāll do my best to help you out.