0% found this document useful (0 votes)
33 views9 pages

Best Path Selection in BGP Using - BGP Path Attributes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views9 pages

Best Path Selection in BGP Using - BGP Path Attributes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Best path selection in BGP using – BGP path attributes

Why did R1 router choose 10.1.1.2 as a best path/best route, let’s see it below the sample topology.

BGP configuration –

#show ip bgp – bgp table


Why did R1 router choose 10.1.1.2 as a best path – as you know that bgp select as a best path on the
basis of path attribute –

1. Next hop reach ability


2. Weight
3. Local preference
4. Self advertised prefix ( originate - 0.0.0.0)
5. AS path length ---prefer less AS path
6. Origin code
7. MED ( metric )
8. External over internal
9. IGP cost to reach next hop
10. Lower NBR router-id (in case of IBGP)
11. Oldest path (in case of EBGP)
12. Lower NBR ip address.

Condition 1

1. Both ip addresses are reachable from R1 (10.1.1.2 and 10.1.2.2 then election will not done on
the basis of next hop)
2. For receiving prefix weight is 0 (since we’re getting same weight -0 then election will be not
done on the basis of weight)
3. We’re getting same local preference – 100 for receiving prefix from IBGP NBR , still election will
not be done.
4. For self advertised both prefix are receiving from both NBR then it will be able to decide.
5. For AS path – we’re getting same AS from both NBR then it will not be able to decide which
path is best path.
6. Origin code – both prefix are receiving from I then it will not be able to decide.
7. For MED – we’re getting 0 metric then it will not be able to decide.
8. External over internal – Both prefixes are internal then it will not be able to decide which path is
best path.
9. IGP cost to reach next hop – we didn’t run any IGP protocol yet then it will not be able to decide.
10. For lower NBR router-id ( In case of IBGP) - in the topology both NBR are IBGP NBR and finally
here it will be able to decide which path is the best for on the basis of lower NBR router-id.

Lets open it in details –


R1#show ip bgp 8.8.8.8 255.255.255.0
You can check the router-id from below the commands –

R1#show ip bgp neighbors

Now let’s prove it that what does it actually prefer on the basis of the lowest NBR ID, so far I have seen
that R1 router was selected as the best path from the R2 Router.
Now I’m about to change router-id of R3 and we want R1 router is select as a best path from R3 Router,
using the below command.

➢ R3(config)#router bgp 65501


R3(config-router)#bgp router-id 3.3.3.3

After changing router-id on R3 router, you will see the output that R1 router selecting as a best path
from R3 router, and now it has been proved that R1 router is selecting as a best path on the basis of
lowest NBR router-id.

Now there is one interesting point is that if you will be configured router-id same on the both router ( R2
and R3) then see what will happen.

➢ R2(config)#router bgp 65501


R2(config-router)#bgp router-id 3.3.3.3

Note – if router id will be same then bgp will check – lower NBR ip address,

Lets check it on R1 router – what have we discussed, it is getting same.


As you can see that to reach the destination, R1 router has preferred lower NBR IP address.

Now check, from which path R1 router is installed in the own routing table.

Now lest move on R4 router –

R4 router is compared path on the basis of oldest path, lets prove it using below command, is it correct
or not.
➢ R4(config)#router bgp 200
R4(config-router)#neighbor 20.20.20.2 shutdown

➢ R1#show run | section bgp


➢ router bgp 65501
➢ no synchronization
➢ bgp log-neighbor-changes
➢ network 192.168.1.0
➢ neighbor 10.1.1.2 remote-as 65501
➢ neighbor 10.1.2.2 remote-as 65501
➢ no auto-summary
➢ R1#
➢ R2#show run | section bgp
➢ router bgp 65501
➢ no synchronization
➢ bgp router-id 2.2.2.2
➢ bgp log-neighbor-changes
➢ neighbor 10.1.1.1 remote-as 65501
➢ neighbor 10.1.1.1 next-hop-self
➢ neighbor 20.20.20.1 remote-as 200
➢ no auto-summary

➢ R3#show run | section bgp


➢ router bgp 65501
➢ no synchronization
➢ bgp router-id 3.3.3.3
➢ bgp log-neighbor-changes
➢ neighbor 10.1.2.1 remote-as 65501
➢ neighbor 10.1.2.1 next-hop-self
➢ neighbor 30.30.30.1 remote-as 200
➢ no auto-summary
➢ R3#

➢ R4#show run | section bgp


➢ router bgp 200
➢ no synchronization
➢ bgp log-neighbor-changes
➢ network 8.8.8.0 mask 255.255.255.0
➢ neighbor 20.20.20.2 remote-as 65501
➢ neighbor 30.30.30.2 remote-as 65501
➢ no auto-summary
➢ R4#

➢ R1#traceroute 8.8.8.8 source loopback 1


➢ Type escape sequence to abort.
➢ Tracing the route to 8.8.8.8
➢ 1 10.1.1.2 48 msec 16 msec 4 msec
➢ 2 20.20.20.1 12 msec 44 msec 32 msec
➢ R1#
R1#ping 8.8.8.8 source loopback 1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:

Packet sent with a source address of 192.168.1.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 12/21/32 ms

R1#

Thank you

Umesh Prajapati

You might also like