
BGP route selction
Can please let me know on what criteria route to 6.6.6.6 is selcted via 155.1.37.7 ?
Rack1R3#sh ip bgp 6.6.6.6
BGP routing table entry for 6.6.6.6/32, version 46
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Flag: 0x820
Advertised to update-groups:
1 3 4
100
155.1.13.1 from 155.1.13.1 (150.1.1.1)
Origin IGP, localpref 100, valid, external
300 100
155.1.37.7 from 155.1.37.7 (150.1.77.77)
Origin IGP, localpref 100, valid, external, best <<<<<<<<=====
If shut the neighbour 155.1.13.1 and unshut it agin... and clear the BGP....then as BEST to reach 6.6.6.6 is 155.1.13.1
Rack1R3#conf t
Rack1R3(config)#router bg 200
Rack1R3(config-router)# neighbor 155.1.13.1 shutdown
Rack1R3(config-router)# no neighbor 155.1.13.1 shutdown
Rack1R3(config-router)#^Z
Rack1R3#clear ip bg *
Rack1R3#sh ip bgp 6.6.6.6
BGP routing table entry for 6.6.6.6/32, version 7
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Advertised to update-groups:
1 2 3
100
155.1.13.1 from 155.1.13.1 (150.1.1.1)
Origin IGP, localpref 100, valid, external, best <<<<<<<============
300 100
155.1.37.7 from 155.1.37.7 (150.1.77.77)
Origin IGP, localpref 100, valid, external
I have configured "AS-PATH ignore" in the BGP of R3.Below is the configuration on R3.
router bgp 200
no synchronization
bgp always-compare-med
bgp log-neighbor-changes
bgp bestpath as-path ignore
network 3.3.3.3 mask 255.255.255.255
network 155.1.13.0 mask 255.255.255.0
aggregate-address 10.0.0.0 255.255.252.0 summary-only
neighbor 155.1.0.5 send-community both
neighbor 155.1.0.5 soft-reconfiguration inbound
neighbor 155.1.0.5 route-map NEXTHOP in
neighbor 155.1.13.1 remote-as 100
neighbor 155.1.13.1 send-community both
neighbor 155.1.13.1 route-map TOAS_60 in
neighbor 155.1.37.7 remote-as 300
neighbor 155.1.37.7 send-community both
neighbor 155.1.37.7 advertise-map AS254 non-exist-map LINKS1/2
no auto-summary
is there any command to check on what criteria BGP best path is selected ?
/Ganpat
Comments
What is the IGP metric to both next-hop?
This is the order of path selection:
highest WEIGHT- you have same
highest LOCAL_PREF - you have same
shortest AS_PATH but you have as-path ignore, skips this step
lowest origin type, IGP origin type is prefer than EGP you have all IGP origin
Lowest MED : you have same
Prefer eBGP over iBGP : you have both eBGP peering
Prefer Lowest IGP metric of BGP next-hop: This could be the selection method
Please check IGP metric of BGP next-hop.
Metric details to next hop as
Rack1R3#sh ip route 155.1.13.1
Routing entry for 155.1.13.0/24
Known via "connected", distance 0, metric 0 (connected, via interface) ====>Metric 0
Redistributing via eigrp 100, rip
Advertised by rip
bgp 200
Routing Descriptor Blocks:
* directly connected, via Serial1/2
Route metric is 0, traffic share count is 1
Rack1R3#sh ip route 155.1.37.7
Routing entry for 155.1.37.0/24
Known via "connected", distance 0, metric 0 (connected, via interface)====>Metric 0
Redistributing via eigrp 100, rip
Advertised by rip
Routing Descriptor Blocks:
* directly connected, via FastEthernet0/0
Route metric is 0, traffic share count is 1
Looking like metric is zero..please suggest.
My guess is it is picking the oldest route. That is why the selection changes when you clear BGP on one peer.
its also good to remeber steps 11, 12 and 13 in the bgp path selection ..
11.Prefer the route that comes from the BGP router with the lowest router ID.
12, If the originator or router ID is the same for multiple paths, prefer the path with the minimum cluster list length.
13, Prefer the path that comes from the lowest neighbor address.
what i think (IMHO) is that is happening is this
First time you runb the command sh ip bgp , its the oldest , as daniel has said.
when you reset the peering then its step 13 , lowest neibhour.
you have seen two seperate route calculations with two seperate outcomes.
HTH
My guess is it is picking the oldest route. That is why the selection changes when you clear BGP on one peer.
INE - The Industry Leader in CCIE Preparation
http://www.INE.com
Subscription information may be found at:
http://www.ieoc.com/forums/ForumSubscriptions.aspx
Thats also my guess. When you use "maximum path 1" in OSPF for example, there also the oldest route should win.
Regards!
My vote is on oldest route
Here two same routes are learned via ebgp and upto oldest bgp routes in best path selection are same. So oldest route prefered as other are also mentioned in this post. We can overcome this behaviour by using "bgp bestpath compare-routerid" this command will allow us to prefer routes based on the router-id of the receiving routes. Lower router-id is prefered.
Here two same routes are learned via ebgp and upto oldest bgp routes in best path selection are same. So oldest route prefered as other are also mentioned in this post. We can overcome this behaviour by using "bgp bestpath compare-routerid" this command will allow us to prefer routes based on the router-id of the receiving routes. Lower router-id is prefered.
I agree. Oldest route. Here is a blog worth reading.
http://blog.ine.com/2011/10/12/understanding-bgp-med-and-bgp-deterministic-med/