(futuristic music)
- So after all of this theory of OSPF we've been talking
about, let's finally get around to configuring this thing.
So let's talk about implementing OSPF.
So the initial configuration of OSPF is pretty simple,
few things I wanna call to your attention right here.
So, you would start out by configuring
at the global configuration level your command router,
OSPF and then a process-id.
Now I wanna make a distinct difference between
a process-id and an autonomous system number.
In EIGRP, at the global configuration level,
come on,
you typed router EIGRP,
and then you had to put your autonomous system number
right here.
And whatever number you put there as your
autonomous system number was very important
because you had to match on all the routers.
In EIGRP when a router sends out an EIGRP hello packet,
it includes the autonomous system number
as part of that hello packet
and those things have to match.
Well, in this particular case a process-id
is not sent in any OSPF packets,
it's simply a locally significant value.
That's it.
Now you might be wondering, Keith, what do you mean
a locally significant value?
When I use that term locally significant that means
only this router, only this device,
needs to be aware of that number,
it's not shared with any other device.
So, most of the time when people configure OSPF,
they use process-id number one.
You can use whatever you want.
I mean, theoretically, on router one you could use
process one, on router two you could use process two,
on router 99 you could use process 99.
It doesn't really matter, it does not have to match.
The main thing to remember is,
unless you have a real good reason for doing so,
you should only have one process of OSPF
running in your router and that's it.
As an example, let me contrast that with EIGRP.
Once again, with EIGRP, if I had a router right here,
let's say this is router x, y and z.
And let's say that y and z were part of company...
Let's say yz,
and then all of a sudden we acquire a new company.
So this is an acquisition.
And maybe we were already doing EIGRP in company yz,
and previously we were using autonomous system number 200.
So all the routers here were using 200.
All of a sudden this new aquistion we have, well,
they were also using EIGRP, but they were using
autonomous system number 77.
So, for the time being, router y actually has to have
two instances of EIGRP.
You have to type router EIGRP 200,
and so that's how he can exchange routes with
his own internal company and then also in router y,
you'd have EIGRP 77.
Totally different process that he can run with router x.
Now those two processes will not share routes.
They will be separate in router y.
We would have to redistribute between the two processes
tell one process sends his routes into the other,
and the other process sends his routes back.
That's something we'd have to do manually in router y,
otherwise they will stay separate and unique,
as if they were completely different routing protocols.
So that's the only time when you would really need
two instances of the same routing protocol,
running in one router.
Well that also holds true with OSPF.
In OSPF you should only have to have a single process
running in your router.
Only if you're in a situation like this,
would you possibly need more than one process,
but at the CCNA level just think to yourself
I'm only gonna type router OSPF some number and that's it,
and I'm never gonna do that command again.
I'm never gonna have to create another process.
One process is enough.
And then you use your network command.
Now in EIGRP, you had the option of using a wildcard mask.
In OSPF, it's not an option.
In OSPF you have to include a wildcard mask
after your prefix and then you also include the word
area and then the area number.
So as an example of that you might type network,
I'm just gonna shorten it, 25.70.00,
and then a wildcard mask that would be appropriate for that.
And then I would tell my router okay any links
that you have on yourself that begin with 25.70,
those links are gonna be part of AREA 1.
So that's an example of how you type the network command.
Now the router will come up with a router-id by itself,
but as you saw in the last video,
where we talked about designated routers
and backup designated routers,
you might want to deterministically set the router-id
so that you can influence which router will become the DR
or the BDR, and remember, every segment that needs a DR
is a unique segment.
In other words, if I'm a router with two ethernet segments,
on this segment, there's gonna be a DR,
it might be me, might be somebody else,
and on this segment right here, that's also ethernet,
there's gonna be another DR.
Might be me, might be somebody else,
but every broadcast segment or non-broadcast multi-access
segment needs a DR and a BDR.
Along those same lines you could also influence
the ip ospf priority on an interface.
Remember the default priority of OSPF on an interface is....
One. The default is one.
If you set the priority to zero, that actually means
this router can never become a DR on that interface,
it is disqualified from becoming a DR.
Now like it says here, both the router-id
and the priority, if you change them,
you need to restart your OSPF process.
It will not take those changes on the fly.
And then here's some verification commands we can use
to see what OSFP is doing.
So let's actually do an example of this in the lab.
So I'm gonna be using this typology right here,
and the routers that you see with the light blue circles,
router one, switch one, router two, switch three,
and router four, they have already been pre-configured
for OSPF so they're already up and running.
And I'm just gonna configure OSFP from scratch
on switch two and router three.
Now before I do that, let's for example,
let's go to router two and issue some
verification commands to see what he looks like already.
Router two.
Okay, so what command would I type to see if this router
has become fully adjacent with any other OSPF neighbors,
or if he's learned of any OSPF neighbors
in any other transitory state?
Hopefully you said show ip ospf neighbor,
and you can see he's got one neighbor 1.2.1.1,
that is switch one.
So remember, when switch one was coming up
with his router-id, first this you said was
do I have any loop backs?
No, I don't.
Okay, what interfaces do I have that are either
up-up, up-down or down-down?
These two right here.
Of these two interfaces, which one has
the highest ip address?
That would be this, one two one 11.
So switch one said I'm gonna create my OSPF router-id
of 1.2.1.11 and that's what we can see right here.
What do you think the router-id is gonna be of router one?
It should be it's loop back, right?
Because the very first this it's looked at is a loop back.
So let's go to router one and take a look.
Which is also gonna answer the question of
when I'm on a local router, how can I tell
what it's router-id is?
You can just do the command show ip ospf.
And right at the top it says here is my router-id.
In this case, just like we thought,
it's the loop back interface.
So, show ip ospf shows you a lot of good stuff,
as you can see right here.
And once again, we can use our favorite command,
show ip protocols, and that will give us some information
about ospf, shows you what your locally sigificant
process-id is, I just used the number one on all of mine.
It shows you what neighbors you have,
the administrative distance of ospf.
Going back here once again, because router one, switch one
and router two have already been pre-configured,
router two should have learned about this loop back
network one 11 one 11 one 11,
and he should have learned about one one one zero,
as ospf routes.
So let's take a look in his OSFP routing table,
of router two, show ip route.
And there we can see, there's that loop back network
that was learned via OSPF,
and here's that other network that was learned via OSPF.
And notice when a route is prefaced with just the letter O,
that means that it is an OSPF intra-area route.
What does that mean?
That means that this route actually lives in the same area
where this local router is.
In other words, router two says
okay the one 11 one 11 one 11 and the one one one,
they both reside in area one, and I live in area one.
So that is an intra-area route.
Now let's go ahead and configure switch two for OSPF.
And if you haven't already taken a screenshot of this,
I would recommend that you do so, so you can follow along.
So in switch two what I'm gonna do is I'm gonna have
three network statements, I'm gonna configure OSPF
then I'm gonna put the two two two network into area 1,
I'm gonna put the two three two network into area 0,
and I'm gonna put the three two three network
also into area 0, so my configuration will consist
of a total of four commands.
Router OSPF one, followed by three network statements,
and that will be all I need for switch two,
router ospf and you can see here
my process-id, locally significant value,
you've got quite a range of values you can choose from,
most people usually just start with one.
Now I'm gonna say network 2.2.2.0, with the appropriate
wildcard mask, and that's gonna be in area 1,
network 2.3.2.0 that's gonna be in area 0,
so right there, the fact that I have put
one link in area 1 and one or more links in area 0,
means this router is now an area border router.
And network 3.2.3.0 also in area 0.
Now how could I tell that this router,
now remember it's a switch, but it's a multi-layer switch,
I've enabled it for routing so I'm just calling it
a router, how do I know this device is running OSPF?
Well, once again show ip protocols and if OSPF
shows up here, which it does, I know it's running OSPF.
It also says right here it is an area border router,
so he knows that he's an area border router.
And this shows me the various networks,
where I've activated OSPF with the network command.
So now I'll just go ahead and put my light blue circle
on switch two, since I've just finished OSPF for him.
So at this point, if we go into let's say router four,
router four should now have at least a couple of networks
that are OSPF intra-area routes.
He should have learned about the two three two network,
and he should have learned about the three two three network
as intra-area routes.
So these two routes should show up simply as O's in R4.
And then R4 should also have learned about
all these routes over here in area 1,
and in R4's routing table, all of these will show up
as O I A in the routing table,
O I A standing for inter-area routes.
Routes that originate in some other area
that router four is not connected to.
Let's take a look at router four,
show ip route.
And there we have it, here are the intra-area routes,
that are part of his own area,
and OSPF as a metric uses cost, it uses cost,
which is based on interface bandwidth,
just like the spanning tree protocol.
The metric of OSPF is cost, it just uses
a completely different formula but the higher the bandwidth,
the lower the cost.
And here we see inter-area routes,
learned from a different area.
And those have a slightly higher cost,
'cause they're a little bit further away.
And at this point I think one other thing I wanna show you,
you can actually look at the database that contains
your OSPF lsa's, show ip ospf database.
And it show's you your different lsa's, now,
at the CCNA level, like I said, you don't have to know
about the specific kinds of lsa's, you don't have to know
what their names and type numbers are,
you don't even really need to be able to
interpret the output of this command.
I just wanted to show you that, it is available to you,
and once you get to the CCNP level and you start learning
about the details of lsa's then you'll start
going into gory detail about the output of
show ip ospf database and some various keywords
that you can add to it.
But I just wanted you to walk away from this video
knowing that you can go into the database
and see various things.
And, other than that we have gone through
all of these show commands here, oh, show ip ospf interface,
we haven't taken a look at that one yet,
show ip ospf interface.
And you can see, it'll show you every interface
that has been activated for OSPF,
because of a network command.
It shows you the interface,
it shows you what kind of network it is,
remember we talked about that in a previous section,
this is the broadcast interface,
it shows you the OSPF cost, remember,
cost is based on bandwidth.
If I went into the interface and I changed the bandwidth,
that would affect the ospf cost value.
So OSPF's metric is much simpler than EIGRP,
EIGRP used all sorts of factors to come up with
a complex metric called distance,
OSPF doesn't do that, OSPF just factors bandwidth
and that's it, and it comes up with a cost value.
It also shows you on a link who the designated router is,
so you can see that.
You can see this particular device, router four
is the backup designated router,
and you can see your interface priority.
A lot of good information from the output of this command.
And for troubleshooting OSPF,
probably one of the best debugs is debug ip ospf adjacency.
That is a great debug to find out, you know,
why do I not have a neighbor?
If I'm looking at a topology diagram and I say,
well, router one and router two should be neighbors
with each other but, when I do show ip ospf neighbor,
they're not seeing each other.
Great debug to turn on, debug ip ospf adjacency,
will tell you what's going on
and why they are not neighbors,
debug ip packets I would recommend
that you not use that debug.
That debug can be very verbose, give you gobs of output
in just a couple of seconds,
probably not a good idea to turn that one on.
(futuristic music)