#

Monday, August 21, 2017

BGP Path Selection by Origin Code

Origin code is the fifth BGP attribute in the list.. There are three origin codes you could see in the BGP table..

i - IGP for the networks you advertised using network command of BGP
e - EGP for an old routing protocol which is no longer used
? - Incomplete for the redistributed routes into BGP

Precedence comes like i > e > ? 
Because e is no longer seen,

i > ? , BGP advertised routes are preferred over redistributed routes..

Let's see an example..
















Basic BGP configuration is like the following..

R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 remote-as 2
R1(config-router)#neighbor 192.168.13.3 remote-as 2

R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.12.1 remote-as 1
R2(config-router)#network 10.10.10.0 mask 255.255.255.0
R2(config-router)#network 20.20.20.0 mask 255.255.255.0

R3(config)#router bgp 2
R3(config-router)#neighbor 192.168.13.1 remote-as 1
R3(config-router)#redistribute connected

Both 10.10.10.0/24 & 20.20.20.0/24 networks are advertised from R2 by the network command while same networks are redistributed to the BGP process by R3. Let's see the BGP table of R1..









You can see, for both the networks, R2's route has become the best route because of their origin code is 'i'.

Note:- 

Because I just redistributed all the connected routes in R3, you can see 192.168.13.0/24 is in BGP table and it is selected as the best route. But note the 'r' in front of the '>' mark. Which means a RIB failure. This is because 192.168.13.0/24 is connected to R1, it will not add the BGP route to routing table. You can verify it by looking the routing table of R1..




1 comment:

  1. trim atas infonya & kunjungi juga web saya salam berhasil selalu

    ReplyDelete