cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
6600
Views
5
Helpful
7
Replies

OSPF Static route redistribution cost help

Craddockc
Level 3
Level 3

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


2 Accepted Solutions

Accepted Solutions

andrewswanson
Level 7
Level 7

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

View solution in original post

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

View solution in original post

7 Replies 7

andrewswanson
Level 7
Level 7

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

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.

Hi

From your posted config it would be something like:

redistribute static route-map Static-Routes metric-type 1

hth

Andy

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

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

That looks fine based on the config shown

Andy

Thanks Andy! Your help is much appreciated!