OSPF Metric Calculations & Tuning

    • Analyse the LSDB to find all possible routes to reach the subnet.
    • Per route, add the interface cost for all outgoing interfaces in that route.
    • Pick the route with the lowest cost.
      • Cost is derived from the egress interface bandwith.


  • Locates subnets via interface Type 1 LSA and any Type 2 LSA
  • Uses SPF to find all paths for each subnet
  • Calculates the OSPF interface cost for the routes, and picks the lowest cost

Inter-Area Routes

  • From the router’s point of view it only knows the subnet via Type 3 LSA. Doesn’t know the topology
  • ABR sends the cost of the subnet in the area
  • With multiple ABRs between area’s you can modify the cost to control outgoing routing

Priority of route Selection

  • Intra-Area
    • within the same area (via Type 1 LSA via Type 2 LSA).
  • Inter-Area
    • From another area (via Type 3 LSA).
  • External
    • Redistribution, doesn’t live in the OSPF domain (via Type 5 LSA).
  • Route Hirarchy:
    • O > O IA > E1 > E2 > N1 > N2

OSPF Metric tuning

show ip ospf interface
show ip ospf interface brief

  • change reference bandwidth
    • Reference-bandwith / interface-bandwith
    • default reference-bandwith 100Mbps/  (Default is 100/100 = 1)
    • auto-cost reference-bandwidth bandwidth
  • Setting bandwidth
    • (config-if)#bandwidth (value)
    • Not recommended because of other protocols and QoS.
  • Config cost directly
    • (config)#ip ospf cost (value)
    • More controllable but more work
R1#sh ip ospf int loopback 1
Loopback1 is up, line protocol is up
 Internet Address, Area 1
 Process ID 1, Router ID, Network Type LOOPBACK, Cost: 1
 Enabled by interface config, including secondary ip addresses
 Loopback interface is treated as a stub Host

Add a Comment

Your email address will not be published. Required fields are marked *

Reload Image