(modern digital music)
- [Instructor] In the last video, when I introduced you
to the concept of configuring OSPF
and showed you most of the commands you would need,
I verbally introduced the concept of OSPF Cost.
I want to have a special video just dedicated to that
because I think it's very important that
for each routing protocol you learn about,
that you're able to understand the metric type that's used
by that protocol so you can compare
and contrast them along the way.
So hopefully by this point, you've learned about RIP
and the routing metric for RIP is hop count.
And you've learned about EIRGP and the routing metric
for EIRGP is called distance.
Now the routing metric that we're gonna deal with, OSPF,
is called OSPF Cost.
So like Spanning-Tree,
if you've learned about Spanning-Tree,
this should be easy.
Because just like Spanning-Tree, cost is a value
that's derived from the interface bandwidth.
And just like Spanning-Tree, the greater the bandwidth,
the faster the interface, the lower the cost.
And just like in Spanning-Tree, if I have two paths
to a particular place, the lower cost is the better path.
Now, OSPF does not use the same formula as Spanning-Tree.
So, you don't have to worry about that
so that the numbers are not going to be the same.
As an example, review question.
In LAN switching with Spanning-Tree,
what was the Spanning-Tree Cost
of a fast ethernet interface,
so a 100 megabit per second fast ethernet interface.
Hopefully you answered the number 19.
Fast ethernet is 19th in the world of Spanning-Tree.
Well, in OSPF, the cost of a fast ethernet interface is one.
So, different formula.
And the cost of an OSPF interface will default
to be whatever you know, derived from the bandwidth,
but you can change that, you can explicitly configure
the cost of an interface or if you modify
the bandwidth of an interface, that implicitly
changes the cost as well.
So there are two ways that you can change it.
You can go on to an interface and use
the ip ospf cost command and then explicitly
set the value to whatever you want, or like I said,
by changing the bandwidth, that will also affect it.
And you can use the command show ip ospf interface
to actually see what the cost is of any given interface
and certainly when you look at an ospf route
in the routing table with the command show ip route,
or show ip route ospf.
You'll see what the total cumulative cost is
to reach any given destination.
So let's see an example of this.
So on our whiteboard here, we can see that
if we look from Switch-3's perspective,
and we look at his way of getting to the 3.2.3 network,
he actually has two equal cost paths.
He can get to there via Switch-2,
or you can get there via Router-3.
So if we actually go into Switch-3,
we take a look as routing table, that confirms that.
We can see right here, 3.2.3.0
and he's got two equal cost paths.
They both have a cost of two.
And that makes sense, because this is a fast ethernet link
so that's a cost of one, and this is a fast ethernet link,
so that gives us another cost of one.
So one plus one is two going this way.
One plus one is two going this way.
So let me start by saying, okay, maybe I want Switch-3
only to use this path.
So what I'm gonna do, I'm gonna go on to Switch-2.
I'm gonna go on to as fast ethernet, 0/3 interface
and I'm gonna raise the cost.
I'm gonna set the cost to five on that interface.
So then, this path will not be as preferable.
That will be a total cost of six.
This will be a cost of two.
And so Switch-3 will now only have one route
in his routing table.
So I'm gonna go to Switch-2, sorry, Switch-3
will have a single route in his writing table
going this way.
So now I'm gonna go to Switch-2.
I'm gonna go on a fast ethernet 0/3,
I'm gonna officially increase the cost to five.
Okay, so, #int fast 0/3,
#ip ospf cost,
actually, before I do it,
#do show ip ospf interface fast 0/3.
And you can see, by default, it's Cost: 1,
'cause fast ethernet.
Now I'm gonna type #ip ospf cost 5.
And now when I take a look at the output of that command,
now we can verify that the cost is five.
So, at this point if I go back to Switch-3,
he should now see a total cost of six going this way
and a cost of two going this way.
So only this path, the path via Router-3
should now be the only path to get to the 3.2.3 network.
(keyboard clicks)
And that's what we see.
Now there's only one path and it's via Router-3.
Now, let's just change it one more time.
So now what I want to do is I want to have
Switch-3 prefer this path.
I want this to be the better path.
So what I'm gonna do, is I'm gonna go under Router-3's
fast ethernet interface.
I'm gonna take the bandwidth and I'm gonna lower it
to some really small number.
Make this interface look like it's incredibly slow
by giving it a really low bandwidth.
And by making the bandwidth number really small,
that will make the cost really big.
Because remember, the larger the cost,
the less preferable it its.
So let's go on the Router-3 now
and change it's interface bandwidth.
(keyboard clicks)
Your fast paced ethernet 0/0,
#do sho int fast 0/0 so we can see right now,
it's current bandwidth is 100000 kbit/sec.
So if you actually do the math, that's one hundred million
bits per second.
So now I'm gonna say, #bandwidth.
How about we say, 2000 kilo bits per second, really slow.
Only 2000 bits per second.
So now if I type sho ip ospf int fast 0/0,
look at his cost now, 50000.
It was one before, and now it's 50000.
So we can see how modifying the bandwidth
clearly affects the OSPF Cost.
And lastly, if I go over to Switch-3,
now we can see that the 3.2.3 route has switched over.
It's now pointing at Switch-2, 2.3.2.22
as the next hop, because the cost of six
is certainly better than the cost of 50000 and one.
(modern digital music)