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

OSPF - prefer one path for one route

jack.leung
Level 1
Level 1

Hey all,

OSPF question. My core switch sees Router A and Router B as DROTHERS and is learning say 10.10.10.0/24 from both. How do I force it to prefer one path wthout impacting any other route it learns?

5 Replies 5

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Jack,

OSPF metric is calculated as sum of all costs to destination

The easier way to do this is to increase OSPF cost on router RB if you want to prefer RA route

on RB

int typex/y

desc shared subnet with RA (not with router RC)

ip ospf cost 100

you don't need to change anything on the shared segment between the three routers.

that would make RA to be preferred because OSPF metric is cumulative cost over all path including the cost declared in router LSA by originating router

the value of 100 is simply for example you just need to add 1 to natural cost of link

you can check it with

sh ip ospf interface typex/y

typex/y is only a placeholder

Hope to help

Giuseppe

Thanks, Giuseppe. So there is no way to do this specifically for one route right because OSPF uses cost and that applies to interface and all routes participating in OSPF?

Blank post with unexpected error while posting !!

Thanks, Giuseppe. So there is no way to do this specifically for one route right because OSPF uses cost and that applies to interface and all routes participating in OSPF?

Hi,

Guiseppe suggested the easy way to configure and to get the route from RA,As (OSPF) uses cost as the metric calculated, based on the bandwidth of the link.The cost of a link is calculated by dividing the reference bandwidth (100 Mbps by default) by the interface bandwidth. The total cost to a destination is the cost of the individual links in the path to the destination. The cost of the outbound interface toward the destination is used.

To explicitly specify the cost of an interface, issue the ip ospf cost command in interface configuration mode.

Hope to Help !!

Ganesh.H

Remember to rate the helpful post

Hello Jack,

>> Thanks, Giuseppe. So there is no way to do this specifically for one route right because OSPF uses cost and that applies to interface and all routes participating in OSPF?

This comes from the link state nature of OSPF that deals with link and link states and not only with IP prefixes, so the offset-list supported in RIPv2 or EIGRP is not supported here.

RIPv2 and EIGRP supports metric manipulation for selected routes using offset-list but this does not happen in OSPF or ISIS.

To be noted that by changing cost on the client Vlan shared between RA and RB you  are not affecting other IP prefixes associated to other interfaces running OSPF.

I also recommend network ... area  + passive-interface instead of using redistribute connected.

First method allows for route control at area border, second method creates unnecessary external routes that cannot be selectively filtered at area border.

Hope to help

Giuseppe

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card