philciccone
asked on
BGP outbound routing, same length AS-Paths, round-robin selection?
I have a Cisco 7507 that is peering with 2 providers via BGP direclty. One provider has more direct routes then the other causing me to have to do some as-path prepends to balance out the AS-Paths a bit. After doing so, I have many routes that are now the same AS-path but still favor provider-A over provider-B. I know that I can set metrics (MEDs) to override and break a tie on equal AS-Paths, but I dont want to just to the extreme. I need to randomly allow some to provider-A and some to provider-B when the AS-Paths are equal.
One suggestion was to change the bgp bestpath method to "bgp bestpath compare-routerid" which I did so the new IOS default rule of the oldest route wins is now disabled. Still did not seem to change the flow, even after a BGP session reset with both peers.
Example:
cyberweb-rtr1#show ip bgp 6.10.0.0
BGP routing table entry for 6.10.0.0/15, version 22
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Not advertised to any peer
6347 3561 701 668
64.240.248.157 from 64.240.248.157 (209.83.159.11)
Origin IGP, metric 100, localpref 100, valid, external
Community: 2131695819
7018 7018 701 668
12.125.190.189 from 12.125.190.189 (12.123.192.15)
Origin IGP, metric 100, localpref 100, valid, external, best
Community: 2131696490
Both have the same path, metric, local-pref and weight and they are both eBGP routes. But it seems every route will always perfer the AS-path of 7018 (AT&T) and never AS# 6347 (Savvis / CW).
Any ideas that I may have missed to force a more random / round robin / distributed approach when AS-Paths are equal for outbound routing?
Thanks.
Phil
One suggestion was to change the bgp bestpath method to "bgp bestpath compare-routerid" which I did so the new IOS default rule of the oldest route wins is now disabled. Still did not seem to change the flow, even after a BGP session reset with both peers.
Example:
cyberweb-rtr1#show ip bgp 6.10.0.0
BGP routing table entry for 6.10.0.0/15, version 22
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Not advertised to any peer
6347 3561 701 668
64.240.248.157 from 64.240.248.157 (209.83.159.11)
Origin IGP, metric 100, localpref 100, valid, external
Community: 2131695819
7018 7018 701 668
12.125.190.189 from 12.125.190.189 (12.123.192.15)
Origin IGP, metric 100, localpref 100, valid, external, best
Community: 2131696490
Both have the same path, metric, local-pref and weight and they are both eBGP routes. But it seems every route will always perfer the AS-path of 7018 (AT&T) and never AS# 6347 (Savvis / CW).
Any ideas that I may have missed to force a more random / round robin / distributed approach when AS-Paths are equal for outbound routing?
Thanks.
Phil
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am a bit embarassed because of my mistake "The bottom line is: there is no automatic way to do load balance if you have distinct AS neighbors. There will be always one and only one route installed for each network.": you've found a very cleaver way to use "bgp always-compare-med" to go around this.
Cheers.
Cheers.
ASKER
Thanks for the vote of confidence, maybe you can use this technique one day.
Thanks again.
Phil
Thanks again.
Phil
ASKER
Here is what I did to do the same thing:
- 1st, made an access list that matched exactly 1/2 of the internet IPs:
ip access-list extended halfinternet
permit ip 0.1.0.0 255.254.255.255 any
!
- 2nd, defined my 1st inbound route-map to match the IPs giving a metric of 50 and a 2nd route-map to set the remainder to a metric of 100.
route-map SAVVIS-IN permit 10
match ip address halfinternet
set metric 50
!
route-map SAVVIS-IN permit 20
set metric 100
!
- 3rd defined the same concept with the other BGP neighbor only this time assigned the MEDs in opposite priority.
route-map ATT-IN permit 10
match ip address halfinternet
set metric 100
!
route-map ATT-IN permit 20
set metric 50
!
- Last, defined the BGP parameters to compare MED across AS#s:
router bgp xxxx
bgp always-compare-med
bgp deterministic-med
!
So esentially, this means if the 2nd IP octet is odd favor Savvis and if its even favor AT&T only if the AS paths are the same length. Seems to work quite well.
Example from the BGP table showing the magic that happened here: :)
*> 6.1.0.0/16 64.240.248.157 50 0 6347 3561 701 668 i
* 12.125.190.189 100 0 7018 7018 701 668 i
* 6.2.0.0/22 64.240.248.157 100 0 6347 3561 701 668 i
*> 12.125.190.189 50 0 7018 7018 701 668 i
I appreciate the suggestion, and I hope this thread may now help others with the two answers on the table. I would have to imagine others have had a similar problem configuring BGP.