BGP Origin Code Attribute explained

The BGP Origin Code is one of the attributes that is used for path selection. There are three origin codes that the BGP table can show:

  • IGP (shows up as i)
  • EGP (shows up as e)
  • Incomplete (shows up as ?)

You will see IGP when you use the network command for BGP. It means you advertised the network yourself in BGP. EGP is historical and you won’t see it in the BGP table anymore. EGP is an old routing protocol we don’t use it anymore. Incomplete means you have redistributed something into BGP. Here’s a demonstration:

bgp as path prepend lab
Above you can see the topology that I will use. R1 and R3 are in AS1 and connected to R2 in AS2. Both routers have a loopback0 interface with network configured on it.

R1(config)#router bgp 1
R1(config-router)#neighbor remote-as 2
R3(config)#router bgp 1
R3(config-router)#neighbor remote-as 2
R2(config)#router bgp 2
R2(config-router)#neighbor remote-as 1
R2(config-router)#neighbor remote-as 1

First we’ll configure BGP. Next step is to get network in the BGP table:

R1(config)#router bgp 1
R1(config-router)#network mask
R3(config)#router bgp 1
R3(config-router)#redistribute connected

On R1 I’ll advertise network in BGP with the network command, on R3 we’ll redistribute it. Let’s see what R2 thinks of this…

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 739 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

523 Sign Ups in the last 30 days

100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Forum Replies

  1. Hi Hamood,

    That’s right, if you redistribute it into BGP then it will show up with a ?. This is no problem though. It basically means that BGP doesn’t “know” where it came from.


  2. Hi Rene,

    what happen if the BGP router receive a route with the same path and origin code ?


    Hussein Sameer

  3. Hi Hussein,

    There’s a long list that BGP uses to select the best path, this is from the website:

    1. Prefer the path with the highest WEIGHT.

      Note: WEIGHT is a Cisco-specific parameter. It is local to the router on which it is configured.

    2. Prefer the path with the highest LOCAL_PREF.

      Note: A path without LOCAL_PREF is considered to have had the value set with the bgp default local-preferencecommand, or to have a value of 100 by default.

    3. Prefer the path that was locally originated via a network or aggregate BGP subcommand or through redistribution fr
    ... Continue reading in our forum

  4. 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


  5. 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.

    ... Continue reading in our forum

25 more replies! Ask a question or join the discussion by visiting our Community Forum