RSS

OFPF Cost Tuning

Share this page:

NLRI - Network Layer Reachability Information

OSPF routes are mainly classified based on their metric, where the Metric and Cost are calculated based only on the Link Bandwidth.

Cost = 100/(BW[Mbps])

There are two things you could play with here:

 1. Set the REFERENCE BW (because with the formula above the Max cost value is 1, and we dont want the same values for 100M and 10G link)

**  (config-router)#auto-cost reference-bandwidth 10000**

   *10000 is 10000 Mbps

  * Dont forget to clear the OSPF process in order for the changes to take effect:
 
**  #clear ip ospf process**

 2. Change the COST in the Interface Configuration

**  (config-if)#ip ospf cost 20**

   and check the result:

**    Cisqueros_R1#show ip ospf inter Lo0 | i Cost    **
**    Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 20**

Then check the metric on the OSPF Neighbor:

Cisqueros_R2#show ip route 1.0.0.0
Routing entry for 1.0.0.0/8
**  Known via “ospf 1”, distance 110, metric 84, type intra area <— METRIC 84**
**  Last update from 10.1.12.1 on Serial1/0.21, 00:02:31 ago**
**  Routing Descriptor Blocks:**
**  * 10.1.12.1, from 1.1.1.1, 00:02:31 ago, via Serial1/0.21**
**      Route metric is 84, traffic share count is 1**

Metric is 84, which is the cost of the Serial interface between routers 1 and 2, and the Cost of the Loopback0 interface on Router 1.

Default cost of the Loopback interface is 1, so it actually increased for 20-1 = 19