- [Instructor] In this video we want to
configure OSPF version two.
Now version two,
that's going to be used to route IP version four networks.
As we'll see in an upcoming video,
we'll need to OSPF for version three
if we want to route for IPv6 networks.
But here let's focus on OSPF version two.
And let's configure all three routers
to have full reach ability throughout the network.
We'll begin on R1
and I'll go into global configuration mode
and I'll say router OSPF one.
Now here that one is a locally significant process ID.
Unlike EIGRP where that was an autonomous system
and it had to match on our neighbor,
that's not the case here.
This does not need to match on a neighbor.
And it is not an autonomous system.
It's a locally significant process ID.
And I think it's a good idea to assign router IDs
to these routers.
I think it makes it easier to do troubleshooting later on.
So I'm going to say this router of R1
has an ID of
1.1.1.1
That's going to make it easy to recognize.
Now by the way, when I'm saying that,
I'm not saying that this router has that IP address.
You cannot ping 1.1.1.1.
I'm not advertising that network.
Instead, it's just the label.
It's the name of this router.
Even though it looks like an IP version for address,
we're not advertising that.
And now we want our two interfaces
to participate in OSPF.
And the one way we could do that
is with a network statement.
You know for that interface, gigabit 0/1.
I'm going to say network,
and the network connected to that interface
is 192.168.1.0.
It's got a 24 bit subnet mask.
So that means the wildcard mask would be o.o.o.o.255
And it belongs to area zero.
Let's talk about what we just did.
It looks like I gave a network statement
that said, advertise this network.
That's actually not what we did.
That's the result,
but that's not what I did with that command exactly.
That command specified an IP address space.
It specified this entire subnet.
And here's what we were really saying,
we're telling this router,
if you have an interface whose IP address
lives in this IP address space and that interfaces up,
then I want OSPF to advertise that interfaces network,
along with that interface sub-net mask whatever it may be.
Now, generally as a common practice,
we'll specify that network with the network statement,
but that's not really what we're doing.
I could have said network 192.168.1.1
with a 32 bit subnet mask.
However, it's just a common practice to specify
the network that we want to advertise,
but we're not really saying advertise this network.
And that's just one way we can make an interface participate
in this OSPF writing process.
Let me show you a different way.
Let's go into interface gigabit 0/2
because we're trying to make interfaces participate.
We could go into the interface itself and say,
Hey, I want you to participate in this OSPF process
as part of this area.
That's what we can do in interface configuration mode.
I'm going to say IP OSPF process ID one
you're in area zero, we'll say,
and that's another way of making that interface participate
in OSPF Oh, and something else here on router R1
notice gigabit 0/1
It's connecting out to switch SW1,
which we assume is then connecting out to end user devices.
In other words, we're not talking to another OSPF
speaking router out of that interface.
We're not trying to form a neighborship.
So is there a need to send or receive OSPF messages
like hello messages on that interface?
I would say no.
In fact, I would say it could be a security risk
if we don't have authentication configured.
So what we can do is say that,
that interface, I still want it to participate in OSPF,
I still want to advertise its network,
but I don't want it to send or receive OSPF messages
so we can make it a passive interface to do that.
Let's go back into router configuration mode.
I'll say router OSPF one.
And I'll say I've got a passive interface of gigabit 0/1
We're still advertising that interfaces network,
but we're not sending or receiving
OSPF messages on that interface.
Well, I think we're done on R1.
Let's go to R2,
R2 Will start out the same way.
We'll say router OSPF process ID one.
It did not have to match.
I just use one because it's easy to remember.
And R2 is an ABR,
It's an Area Border Router
because it's got one interface in area zero.
It's got another interface in area one,
and I'll say router-ID of 2.2.2.2
So we'll easily recognize in the show command output
that this is router R2
And I'll give a couple of network statements.
I'll say network one 192.0.2.0 for that network
off of gigabit 0/1
it's got a 30 bit subnet mask.
So that means the wildcard mask is 0.0.0.3
it's in areas zero.
The other network statement is going to specify area one.
Oh, notice we had an adjacency come up, excellent.
I'll say network 203.0.113.0 with a 30 bit subnet mask.
That's a wildcard mask again of 0.0.0.3
This time that interface is in area one,
and there's no opportunity to do
a passive interface command here
because both interfaces need to talk
to other OSPF speaking routers.
So let's move on to a router R3,
on router R3
Let's start out the same way.
Router OSPF one and the router ID you guessed it is
3.3.3.3
And just to make another point about that network statement,
I said, the network statement was not saying
advertise this network.
It was specifying an IP address space.
And if an interface that was up
had an IP address that belonged to that IP address space,
then that interfaces network would be advertised via OSPF
to prove that let's give a network statement
that encompasses all possible IP version four addresses.
That's a network address of all zeros
and a sub-net masK give a zero,
and that will make it a wildcard mask of
255.255.255.255
So let's give a network statement that encompasses
every possible IP version four address.
That's going to be 0.0.0.0 with a wildcard mask
of all 255
And both interfaces are in area one.
And there...
Oh, notice we just had an adjacency come up
almost instantly, great news,
but notice gigabit 0/2.
That's another opportunity
to give the passive interface command I think
because there are no other OSPF
speaking routers off of gigabit 0/2
I'll say passive interface gig 0/2.
And now let's give some verification commands
from the perspective of R3.
Can I reach everywhere on the network?
Have I learned about those networks
that R1 is connected to that I'm not connected to?
Let's see, let's do a show IP route command
and yes indeed I have.
I've learned about the 192.168.1.0/24 network.
That's connected off of gigabit 0/1 on R1
It was learned via OSPF,
that's what the O tells us,
but it came from a different area.
It was an inter area route.
That's what the IA stands for.
And we've also learned about the 192.0.2.0 network
connecting between R1 and R2.
And we see OSPF administrative distance of 110.
And the cost is currently being viewed as a cost of one
for every interface that we have to exit.
So as I go out of R3 that's cost of one,
and then I go out of R2 that's another cost of one.
And then I go out of R1 to get to that network.
Let's say this network here, 192.168.1.0
So it's one plus one plus one, that's a three,
That's where we get the cost of three.
Now we'll talk about in just a moment
that this is not perfect yet,
because if you notice the topology,
there's a 100 Meg link,
even though it's a gig interface,
I'm configured for a speed of 100 Meg between R2 and R3
but it's not giving me a different cost than for a gig link.
We need to address that,
but let's give a few more show commands first
and other verification commands.
For example, let's do a ping to 192.168.1.1
I want to make sure that I can reach that far interface
on the other side of R1.
Success, another super handy command is show IP protocols.
This is going to give us more detailed information
about whatever protocol we have configured
in our case, it's OSPF process ID one.
We see the router ID is all threes, 3.3.3.3
You see that I've got a passive interface configured
and I'm advertising for all possible networks.
And we see OSPF the default administrative distance of 110.
Let's take a look at the routes that OSPF knows about.
Let's do a show, IP OSPF Rib,
where rib is the route or routing information base.
These are the networks that OSPF has learned
now just because OSPF has learned about them.
that is not a guarantee that these networks
are going to be injected into the router's IP routing table.
In fact, only a couple of these are
we see that the greater than sign
indicates that we've injected these into the global rib,
which is the router's IP routing table.
These are the networks connected off of R1,
not directly connected to us.
The other networks we're directly connected to
and a connected network has an administrative distance
of a zero, which is way more believable
than OSPF administrative distance of 110.
So even though OSPF knows about directly connected networks,
when we look at the IP routing table,
it doesn't say we learned them from OSPF,
it says we learned them because we're directly connected.
Let's take a look at our interface.
Our OSPF interface configuration,
we'll say show IP OSPF interface,
and we'll do gigabit 0/1
And we see that we're in area one,
We see that we've got the default priority of one,
And for any sort of Ethernet interface,
we've got a default OSPF network type of broadcast.
But I see a couple of things here that are a bit confusing.
For example, it says, this is a cost of one.
And the cost remember is the reference bandwidth
divided by the interface speed.
And the reference bandwidth is 100 Meg.
So 100 Meg divided by 100 Meg,
that is a cost of one,
but everything else seemed to have a cost of one.
For example, if I look at gigabit 0/2,
that's a gig interface.
It also has a cost of one.
We're not distinguishing between fast ethernet
and gig interfaces.
And the reason is if I said the default reference bandwidth
of 100 Meg divided by a gig 1000 Meg,
that will be 0.1 and we can not have decimals.
It has to round up to the next integer.
So that's a cost of one.
In other words, by default fast ethernet interfaces
have the same cost as gig interfaces
and 10 gig interfaces and 40 gig interfaces
that's not good.
So in a moment, I'll show you how we can fix that
and make this more accurate.
But something else that I think is confusing,
let's look at that interface gig 0/1 again,
it says the designated router is R2.
It says we're the backup designated router.
We can further confirm that by doing a show,
IP OSPF neighbor command.
And it says our neighbor of R2.
Yeah, it's the DR.
Why is that?
The priorities are the same,
So we look to the router ID
and the highest router ID wins that DR election.
Why is R2 a DR I've got the higher router ID
R2 has got a router ID of 2.2.2.2
Mine's 3.3.3.3.
And the answer is, R2 already had the election,
and the election was over
before we ever configured OSPF on R3
And it had already determined
that it was the DR for that ethernet segment,
we can fix that by the way,
if I go to R2 and I'm just going to bounce that interface,
I'm going to go into interface gigabit 0/2,
and I'll say, shut down
and then I'll do a no shut shutdown,
lets bring it back up,
and our neighborship should be reestablished.
And that DR election will be conducted again.
Let's wait for the neighborship to reestablish.
There it is.
Let's go to R3 and let's once again say
show IP OSPF neighbor and notice this time,
Yeah, our neighbor is the BDR
because we have the higher router ID.
And one other thing we can check is our OSPF database.
I'm going to do a show IP OSPF database command,
and if you recall our discussion about LSAs,
this should make sense.
Every router in an area generates a type one LSA
for each directly connected network.
In other words, within an area,
we'll have one type one LSA for each network
and in area one we've just got two networks,
the one between R2 and R3 and the one off of R3
going out to switch two.
So I'm expecting to see two type one LSAs
and those are router LSAs and yes indeed,
there are two entries.
For type two LSAs,
those are R network LSAs,
we're going to have a type two LSA
for every network in an area that meets two criteria.
The first criteria is, it has to be a transit link.
In other words, it cannot just be going off to a switch
going off to end users.
And the second criteria is it has to be a link
on which a DR would be elected.
So it's probably not going to be
something like a point to point link.
Well, here we've only got one network
that meets both criteria,
the network off of gigabit 0/2 and R3,
that's not a transit link.
It's not going to another OSPF speaking router
so we're not going to have a type two LSA for that one.
The only network that qualifies
for a type two LSA in area one is
that link between R2 and R3
So I just expect one type two LSA,
and that's all we have.
And finally type three LSAs.
Those are going to be networks
that came in from a different area.
Those are our summary LSAs.
In an area zero, I've got two networks,
I've got the network between R1 and switch one.
I've got the network between R1 and R2.
I would expect two type three LSAs coming in from area zero.
And we see those exact network addresses right here.
So that all makes sense, great news,
but something that doesn't make sense just yet is
our cost seems to be wrong on that link between R2 and R3
And the reason is the default reference bandwidth
is just way too low In my opinion,
I think we should bump it up a little bit.
In fact, let's go over to R2 for a second
and let's give this command just to limit
some of the output.
Here's a little shortcut we can do.
I'm going to say show IP, OSPF interface.
And I'm going to pop that output to include
the word gig, which is going to show me
what interface we're talking about.
And then I'll give another pipe symbol,
which is a (indistinct) I'm going to say,
if it contains the word gig or contains the word cost
with a colon, show it on screen.
And this is going to tell us very easily that
gigabit 0/1 has a cost of one,
gigabit 0/2 has a cost of one.
Those should be different because they're different speeds.
Let's confirm that those really are their speeds.
Let's do a show run
and for gigabit 0/1, the speed is auto , great.
But for gigabit 0/2, the speed is 100, Hmm.
Let's fix that.
We need to set the reference bandwidth
and here's how we do that.
And by the way, when we set the reference bandwidth
to something other than the default,
we're told to do it on all routers.
So I'm just going to start on R1
and I'll go all the way across this network.
On R1, let's go into router configuration mode
for OSPF of process ID one.
And here's the command
to set a non-default reference bandwidth.
It's the auto cost to command,
I'll say auto-cost reference-bandwidth,
and then context sensitive help shows that
the unit of measure is in megabits per second.
And the default is 100,
100 Meg is the default.
If you think about it,
we should set this to a value
that's going to be equal to our greater than
our highest speed interface.
Otherwise we could have different interface speeds
having the same cost.
And I want to build in a little bit of room for growth here.
I want to accommodate one terabit per second,
and maybe even above that.
So just as a personal best practice recommendation,
I like to set this reference bandwidth
to two terabits per second,
which is 2 million Meg.
Since Meg is the unit of measure megabits per second,
I'm going to set 2 million as my reference bandwidth
I'll say 2000000 and we're done on R1.
Notice here's that caution I was telling you about.
It says it needs to be consistent across all routers.
Let's go back over to R2 router OSPF one,
and I'll say auto-cost reference-bandwidth
2 million, 2000000
One router to go.
That's R3,
we'll say router OSPF one auto-cost reference-bandwidth,
2 million, 2000000 great
We've now configured a non-default
and I think a much better reference bandwidth.
Let's go back to R2 and issue that same command again
on router R2, just a moment ago,
we saw that both interfaces had the same cost.
Let's try again.
Now that we've adjusted that reference bandwidth,
I'm going to say show IP OSPF interface.
We're going to pipe that output to include gig (indistinct)
or cost: Let's see what the costs are now.
We notice for gigabit ethernet 0/1,
which is running at a gig speed that has a cost of 2000.
That's what we get when we divide 2 million Meg,
by 1000 Meg, we get 2000.
So we set the reference bandwidth 2 million.
The interface speed is 1000 Meg is a unit of measure,
2 million divided by 1000 that is 2000.
However, for the interface configured
to run at 100 megabits per second,
here we have a cost of 20,000,
which is 2 million Meg divided by 100 Meg.
that gives us 20,000.
So this corrects our issue of having the calls
to be identical for different interface speeds.
And that's all look at the configuration
of OSPF version two,
which we can use to route IP version four networks.
But if we want to route IP version six networks
with OSPF, we need to use OSPF version three.
And we're going to check that out in an upcoming video.