10-18-2016 11:54 AM - edited 03-08-2019 07:50 AM
Community,
We are redistributing static routes in our OSPF environment (This is on a Nexus 9K platform). But what im noticing is that the metric for all static routes learned via OSPF is remaining at 20 and is not being incremented by the cost of each hop in the network. We manually adjusted the cost to be high (250) on our backhaul link, and it seems all other routes dynamically learned are adjusting their costs accordingly but the static routes being redistributed are not. if you notice below some routes are incrementing the cost while others are not, its staying at 20. Upon investigation I found that the routes learned that arent being incremented are static routes being redistributed. How can I make these routes increment their cost like all other routes?
Im getting ready to flip our backhaul link to a different link with a lower cost but i dont want a situation where all the static routes are going over the old link or are being load balanced while everything else is going over the new link. I want the static routes being advertised by ospf to have their cost incremented just like all the other routes.
router ospf 1
router-id 10.100.199.128
redistribute direct route-map Connected-Routes
redistribute static route-map Static-Routes
log-adjacency-changes detail
auto-cost reference-bandwidth 100 Gbps
passive-interface default
interface Vlan201
description DCI To QTS
no shutdown
no ip redirects
ip address 10.100.199.11/29
ip ospf cost 250
no ip ospf passive-interface
ip ospf mtu-ignore
ip router ospf 1 area 0.0.0.0
10.100.98.0/24, ubest/mbest: 1/0
*via 10.100.199.10, Vlan201, [110/350], 3w3d, ospf-1, intra
10.100.99.0/24, ubest/mbest: 1/0
*via 10.100.199.10, Vlan201, [110/351], 3w3d, ospf-1, intra
10.100.199.129/32, ubest/mbest: 1/0
*via 10.100.199.10, Vlan201, [110/251], 3w3d, ospf-1, intra
10.110.255.0/24, ubest/mbest: 1/0
*via 10.100.199.10, Vlan201, [110/20], 3w3d, ospf-1, type-2
10.120.0.0/16, ubest/mbest: 1/0
*via 10.100.199.10, Vlan201, [110/20], 3w3d, ospf-1, type-2
10.120.130.0/24, ubest/mbest: 1/0
Solved! Go to Solution.
10-18-2016 02:51 PM
Hello
default metric type when redistributing is E2 (metric doesn't increment). metric-type of E1 does. See link:
https://learningnetwork.cisco.com/thread/55532
hth
Andy
10-18-2016 03:08 PM
Or set the metric type in your route map:
http://www.cisco.com/web/techdoc/dc/reference/cli/nxos/commands/bgp/set_metric-type.html
10-18-2016 02:51 PM
Hello
default metric type when redistributing is E2 (metric doesn't increment). metric-type of E1 does. See link:
https://learningnetwork.cisco.com/thread/55532
hth
Andy
10-18-2016 03:03 PM
Andrew,
Thank you kindly for the response. I figured it had to do with the type 2 route. Do you know how to force them to type 1 on the NX-OS platform? I tried doing it in the OSPF config but was not able to.
Thanks.
10-18-2016 03:06 PM
Hi
From your posted config it would be something like:
redistribute static route-map Static-Routes metric-type 1
hth
Andy
10-18-2016 03:08 PM
Or set the metric type in your route map:
http://www.cisco.com/web/techdoc/dc/reference/cli/nxos/commands/bgp/set_metric-type.html
10-19-2016 08:04 AM
Andrew,
Thank you for this. So in this instance, will this work?
router ospf 1
router-id 10.100.199.128
redistribute direct route-map Connected-Routes
redistribute static route-map Static-Routes
route-map Static-Routes Permit 10
match ip address prefix-list Static
set metric-type type-1
10-19-2016 08:32 AM
That looks fine based on the config shown
Andy
10-19-2016 09:46 AM
Thanks Andy! Your help is much appreciated!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide