Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

OSPF Cost calculation


I am having 3 sites/locations (SITE-A,B & C), SITE-A is having two routers, SITE-B is having 1 router & SITE-C is having 2 routers

I am having 4 subnets at SITE-A out of 4 2 nos each are connected behind each router.

I had attached the current OSPF cost diagram.

My question is that i want the 2 subnets across each router at SITE-A to be equally loadbalanced on the WAN link to SITE-B by manipulating the OSPF cost.

Pls suggest the ospf cost calculation

New Member

Re: OSPF Cost calculation


(Not getting much clearity of the issue, but trying to answer something...)

While going from source to destination, you need to calculate the cost of exit interfaces on each of the OSPF neighbors in the path...

f.e. if there are two ospf routers betn source and destn n/w, and each router i/f (to destination) has got ospf cost of 10, then total cost of that path will be 20.

Try to calculate like this and config total cost of your desired paths to be equal...


Dhiren Shah

New Member

Re: OSPF Cost calculation

Hi Dhiren,

Thanks for the reply what i am basically trying to achieve is equal loadbalancing from Subnets active on each routers (2nos) on site a towards site b i mean any traffic from subnet a configured on site a router 1 towards single site b router should be equally load balanced from the primary wan link from site a router 1 & also via site a router 2 as i also have another link from site a router 2 for site b.

The same should happen for the subnets configured on site a router 2.

I am sorry i uploaded the wrong ospf cost diagram kindly refer the new ospf network diagram

Super Bronze

Re: OSPF Cost calculation

From your diagram, not clear which routers are at each site.

Also, there might be some confusion over equal costing.

In your "new" diagram, RIL-1 and 2 are equal costed to BT. However, once traffic hits RIL-1 or 2, it will go directly to BT. Assuming you want to use both RIL-1/2 from their subnets, you'll need to balance how traffic gets to these routers. This could be done with GLBP or another LAN gateway router (with equal costing) that connects to both RIL-1 and 2.

In your "old" diagram, traffic that starts at RIL-1 would also go directly to BT. Traffic that starts at RIL-2 would see two equal cost paths, RIL-2 to BT and via RIL-1 to BT, and would use both. In this design, you could make RIL-2 the primary gateway via HSRP (with preempt) and have RIL-1 as the backup.


Although you can manipulate OSPF costs, if GLBP is supported, it's less of a head ache, I believe, to maintain.

New Member

Re: OSPF Cost calculation

Hi Hitesh,

Agreed with the comments by Joseph...

Try it out that way,plz..