cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3728
Views
0
Helpful
7
Replies

BGP manipulate incoming metric of advertised default routes to get ECMP

jane11
Level 1
Level 1

Hello,

I've got two uplinks to my "ISP"[1] and get two default routes advertised via eBGP. One route arrives with a metric of 2, the other one without any metric.

 

# show ip bgp 0.0.0.0

BGP routing table entry for 0.0.0.0/0, version 2
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Multipath: eBGP iBGP
Advertised to update-groups: 2
65001, (received & used)
172.31.254.9 from 172.31.254.9 (172.31.2.2)
Origin IGP, metric 2, localpref 100, valid, external

65001, (received & used)
172.31.254.1 from 172.31.254.1 (172.31.2.1)
Origin IGP, localpref 100, valid, external, best

 

Now I'd like to do ECMP using both uplinks. Assume that the configuration on the side of the "ISP" cannot be changed. Therefore I'd like to get rid of the "metric 2". Unfortunately I couldn't find any "ignore MED" option and using a route-map to set the med/metric doesn't seem to work for incoming routes. I added the following config snippets:

 

ip prefix-list DEFAULT seq 5 permit 0.0.0.0/0

route-map METRIC-2 permit 10
 match ip address prefix-list DEFAULT
 set metric 2

neighbor 172.31.254.1 route-map METRIC-2 in

maximum-paths 2

and did "clear ip bgp 172.31.254.1 soft in". Unfortunately the metric stayed the same.

 

Any ideas how to achieve ECMP?

 

[1] I put that in quotes, long story...

1 Accepted Solution

Accepted Solutions

> If you will have problem in next try - try remove "match" string from first route-map statement and > check again(it will set MED on all routes from neighbor). Actually, that was my first approach. But after that didn't work I integrated the "match" clause due to most documentation/examples are including "match" statements. But I'll try again and give it some more time for convergence :) Thanks again!

View solution in original post

7 Replies 7

Hello,

 

You can still use the Weight attribute to manipulate the traffic.

 

ip prefix-list DEFAULT seq 5 permit 0.0.0.0/0

route-map Weight-10 permit 10
 match ip address prefix-list DEFAULT
 set weight 10

neighbor 172.31.254.1 route-map Weight-10 in
neighbor 172.21.254.9 route-map Weight-10 in

Wight is the very first Attributes when comes to the BGP path selection in Cisco devices.

 

Dear govindaraman.kaliyamoorthy, thanks for your suggestion. Afaik this would work for preferring one route over the other, but not for ECMP, due to the BGP path selection process continuing and then in step 6 selecting the route with(out) the metric again.

IBMeR
Level 1
Level 1

Strange. I tried your config and MED was set, but after ~30-60 seconds after soft reset.

Try again.

Dear IBMeR, thats a good hint. I probably didn't wait that long after a soft reset :) But I did a hard reset and the problem persisted. In the next maintenance windows I'll try again and wait longer. Thanks!

You made all right and this config don't have any mistakes - it must work if you don't have bug.

If you will have problem in next try - try remove "match" string from first route-map statement and check again(it will set MED on all routes from neighbor).

> If you will have problem in next try - try remove "match" string from first route-map statement and > check again(it will set MED on all routes from neighbor). Actually, that was my first approach. But after that didn't work I integrated the "match" clause due to most documentation/examples are including "match" statements. But I'll try again and give it some more time for convergence :) Thanks again!

this time it worked with exactly the above statements - for whatever reason... thanks again for your help @IBMeR