BGP Origin Code Attribute

There are three BGP origin code attribute which are used in path selection.

  • IGP shown as i in bgp table.
  • EGP shown as e in bgp table.
  • Incomplete shown as ? in bgp table.

The bgp table can be checked using show ip bgp command

We will use the same topology which we have used in our basic BGP configuration post.

BGP origin code attribute

To learn about the origin codes we will do following:

  1. Publish Gi3 subnet of Router 3 via network command .
  2. Publish Gi6 subnet of Router 4 via redistribution.

i origin code:

A route will have origin code as i when it is entered into BPG using network command. We will run below command to start advertising the network into BGP.

R3#

R3(config)#router bgp 3
R3(config-router)#network 10.23.23.0 mask 255.255.255.252

Entire configuration of R3 is as follows:

R3#show run | sec bgp
router bgp 3
 bgp router-id interface Loopback0
 bgp log-neighbor-changes
 network 10.23.23.0 mask 255.255.255.252
 neighbor 4.4.4.4 remote-as 4
 neighbor 4.4.4.4 ebgp-multihop 2
 neighbor 4.4.4.4 update-source Loopback0

Now when we check the BGP route table of router 4 we will start seeing the network 10.23.23.0/30 with origin code as i.

R4#

R4#show ip bgp
BGP table version is 15, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
              t secondary path, L long-lived-stale,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>   10.23.23.0/30    3.3.3.3                  0             0 3 i <<<<
R4#

incomplete origin code ?:

A route will have origin code as ? when it is entered into BPG using by redistributing the network into BGP. In BGP any route (Static, Directly connected, IGP learned route) which are present in routing table can be advertised into BGP.

In BGP either we can redistribute all connected route or specific route with the help of route map

R4#

R4(config)#router bgp 4
R4(config-router)#redistribute connected

Entire configuration of R3 is as follows:

R4#show run | sec bgp
router bgp 4
 bgp router-id interface Loopback0
 bgp log-neighbor-changes
 redistribute connected
 neighbor 3.3.3.3 remote-as 3
 neighbor 3.3.3.3 ebgp-multihop 2
 neighbor 3.3.3.3 update-source Loopback0

Now when we will check routes on R3 BGP table we will see the routes are learned with ? as origin code

R3#show ip bgp
BGP table version is 22, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
              t secondary path, L long-lived-stale,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 r>   4.4.4.4/32       4.4.4.4                  0             0 4 ? <<<<
 *>   10.14.14.0/30    4.4.4.4                  0             0 4 ? <<<<

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.