Master IP Addressing and Subnetting: The Ultimate Course for Network Engineers—Limited Time Offer: $100 Course for FREE!

Hey there, fellow Network Engineers! Tired of feeling lost in the world of IP addressing and subnetting? Look no further! My course, "Mastering IP Addressing and Subnetting," is here to give you the skills and confidence you need to tackle any subnetting challenge. And the best part? For a limited time, I'm offering it for free to my website visitors and subscribers with the code "year2023" at checkout. Don't miss out on this opportunity to level up your networking game.

Click now to check out the course!

OSPF Cost Manipulation

OSPF Cost Manipulation
The equation used for cost manipulation in OSPF is :-

OSPF Cost=Reference Bandwidth/Interface Bandwidth

It simply means that we can manipulate any one of the three parameters to
adjust our OSPF cost.
First of all we can apply the OSPF cost straight by the “ip ospf cost [1-65535]”
to the particular interface.Example:-
R1#conf t
R1(conf)#interface Serial0/0
R1(conf-if)#ip ospf cost 20

Second way to accomplish this by changing the Reference Bandwidth and this is done
under OSPF process:-
R1(conf)#router ospf 1
R1(config-router)#auto-cost reference bandwidth 20000

By default,OSPF calculates the cost of an interface by dividing the bandwidth
of the interface into 100 million(10 to the power 8).
So now our formula look like this:-

OSPF Cost=100000000/interface BW in BPS

NOTE:-Whenever you change Reference Bandwidth make sure it should be same across

all routers in your OSPF domain,also the router will prompt for this:-

R1(config-router)#auto-cost reference-bandwidth 20000
% OSPF: Reference bandwidth is changed.
        Please ensure reference bandwidth is consistent across all routers.

Also by default router will take auto-cost reference bandwidth in MBPS.

Rack1R1(config-router)#auto-cost reference-bandwidth ?
  <1-4294967>  The reference bandwidth in terms of Mbits per second

So thus using the default value and your network has interfaces with the bandwidth
greater than 100 million is not recommended,the reason is simple because OSPF
cannot differentiate between 100 mbps interface and an interface greater than
100 mbps,as in the above example “ip ospf cost”command enables you to change the
OSPF cost for an interface,but the better way to do this is to change the default
reference value.But always change the default behaviour of any protocol with
caution,so here in our scenario we need to change the default Reference cost in
every OSPF router in our routing domain.

The third way is also simple as here we need to manipulate the interface bandwidth,
to get our desired OSPF cost,it is simply done by the command:-
R1(conf)#interface Serial 0/0
R1(conf-if)#bandwidth [the numerical value]

Some Common OSPF Costs:-
Fast Ethernet=1
Gig Ethernet=1
10 Gig Ethernet=1

Afroz Ahmad
Afroz Ahmad

"Hey there, network enthusiasts! My name is Afroz, and I've been a CCIE for over 14 years. I work as a Network Designer, and my true passion is teaching others about the industry and sharing my knowledge through my blog and courses. I know the struggles of navigating the complex world of networking, but I firmly believe that teaching makes you a better learner and reinforces understanding. So, whether you're just starting out or a seasoned veteran, join me on this journey of learning and discovery, it will be worth it, and who knows, you might even have some fun along the way!"

Articles: 83

Leave a Reply

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