1. Introduction
Section, you’ll learn about the last of our IGPs, our interior gateway routing protocols for the CCNA exam. That’s OSPF, the open, shortest path first protocol. We’ll start with a description of the characteristics of OSPF, and then we’ll move into doing basic configuration. After that, we’ll cover some more advanced topics like configuring, the router ID, passive interfaces, and the default route injection. Then we’ll move on to learning about the OSPF metric, which is the cost, how that works and how you can manipulate it. And finally, we’ll cover OSP SPF areas, which is how we can segment our larger Westpf networks into smaller areas to put less load on the routers. Okay, let’s.
2. OSPF Characteristics
In this lecture, you’ll learn about the characteristics of OSPF, and I’ll also do a comparison with our other interior gateway routing protocols of Rip and EIGRP. So OSPF stands for open, shortest path first. It’s a link state routing protocol as opposed to the distance method vector routing protocols of Rip and EIGRP. Like EIGRP, it supports large networks and has very fast convergence. Time messages are sent using multicast rather than broadcast, so it’s more efficient. And OSPF is an open standard protocol. It uses Dijkstra’s Shortest Path First algorithm to determine the best path to learned networks, so that’s where it gets its open SPF name from.
Okay, comparing OSPF with Rip and EIGRP rip has scalability limitations that we discussed in the earlier lectures. So it’s not typically used in production networks. It’s suitable for very small production networks or for lab or test environments. If you’ve got a lab and you’re not testing the routing protocol, you want to test something else. You just want to get the routing up and running quickly and easily, then Rip is a good choice for that, but not typically used in production networks because of scalability issues. So that means your choice for your IGP comes down to either OSPF or EIGRP.
Out of the two, OSPF is the most commonly used. It sports and large networks, and it has always been an open standard. It is supported on all vendors equipment, and there’s plenty of support for OSPF spotted by everybody. Loads of engineers understand it and are used to working on it, lots of documentation on the Internet, et cetera. EIGRP, however, can be simpler to implement and troubleshoot. But EIGRP was historically a Cisco proprietary protocol. It’s an open standard now, but there’s still very limited support on other vendors equipment. Most of our vendors equipment won’t support EIGRP. So if you wanted the simplicity of EIGRP, it meant that you were locked in to using only Cisco equipment. If you wanted to be able to use any vendor’s equipment, then your choice would be OSPF. So that’s why OSPF has been more popular than EIGRP. However, they’re both very similar. They’re both very good protocols. So if you want the simplicity, maybe you go with EIGRP. If you don’t want to have that Cisco vendor lock in, then you can go with OSPF. So OSPF is a link state routing protocol. With our link state routing protocols, each router describes itself and its interfaces to its directly connected neighbors. This information is then passed unchanged from one router to another. So that’s the difference between link state routing protocols and our distance vector routing protocols. Every router learns the full picture of the network, including every router, its interfaces, and what they connect to. OSPF routers use LSA link state advertisements to pass on the routing updates our OSPF operations. So when you enable OSPF on router, the first thing it will do will discover its directly connected neighbors and form adjacencies with them.
They will then share routes with each other by flooding the link state database. Once all of the potential routes are learned, the router will then compute the shortest path and the best routes will be installed in the routing table. After that, the routers will respond to network changes. For example, if any new links are added or if any links go down are different packet types that are used in OSPF. First one is the hello packet. As soon as you enable OSPF on an interface, it will start sending out and listening for hello packets. And when it receives a hello packet on that interface, it will form an adjacency with the neighbor.
Once the routers have formed adjacencies, they will send DBDs to each other. DBD is the database descriptor that includes information about all the networks that the routers know about. If a router is missing information about any of the networks it received in the DBD from a neighbor, it will send that neighbor an LSR, which is a link state request, asking for more information. The router will reply back with an LSA a link state advertisement other packets types we can have is an LSU a link state update that contains a list of LSAs which should be updated.
This is used during flooding. So for example, if a new link was added or if a link went down, that information needs to get flooded everywhere with an LSU. And finally we have the LSAC, which is the Acknowledgment message. Whenever a router receives a message from a neighbor, it will send an Acknowledgment back. So this makes sure that the pro recall is reliable. If a router sends out a packet and it doesn’t get an Acknowledgment, it will resend it. Okay, so that was our OSPF characteristics. In the next lecture, we’ll take a look at how to configure.
3. OSPF Basic Configuration
In this lecture, you’ll learn how to do a basic configuration of OSPF on our Cisco routers. So to enable OSPF, the top level command at Global Config is router OSPF and then a process ID. So you can see an example here. I’ve said router OSPF One. Different interface on a router can run in different instances or different process IDs of OSPF. And different instances have different link state databases, so they run separately. Only one instance is typically configured on OSPF. Routers multiple process IDs are very rarely used. It’s not normal to have different process IDs on the router. The process ID is locally significant, meaning it does not have to match on the neighbor router for them to form an adjacency. You’ll see what I mean about that coming up on the next slide. So in the example below, we’ve got three routers. R one, R two and R three, with R two in the middle. On R Three. Both interfaces have been put in process. ID One. On R Two, the left hand interface is in Process ID Two, the right hand interface is in Process Three, and on R One its left hand interface is in Process Four.
R two will form adjacencies both with R three and with R one. So even though the Process ID is different on the routers, that’s a locally significant number. It does not have to match on both sides. So the routers will still form adjacencies. In our example here, on R Two, the left hand and the right hand interfaces are in two different processes. So we’re going to have separate link state databases and information is not going to be shared between the two sides. So R One and R Three will not learn routes to each other because both sides are in different process IDs. On Router Two.
The way we would configure this is on R Two. We say Router OSPF Two at Global config and then network. Ten o. The Wild Card Mask 0255 Area Zero And then for the other interface, we say router westpf three and network 100 one. Okay? So that’s how you can have different processes for wespf running on the same router. It is absolutely not normal to do that. Very rare that you would see this. I’m just showing you it here so that you can fully understand what the process ID is. What is more normal is where all the routers in your network are all using the same process ID number. So you can see here now on routers R One, R Two and R Three, the same topology as before. We’ve configured OSPF process ID one on all interfaces. On R Two.
We see. Router OSPF One. Network Ten o and Network Ten One are both under process one. And now R One and R Three will learn routes to each other. Don’t worry about the area statement on the end here yet. We’re going to cover what areas are and how they work towards the end of this section. Okay, so we configure router OSPF and then usually we’ll use a process ID of one. The next command to use is the network command. This is pretty much the same as the network command that we had for EIGRP as well. So network and then the network address a space and then the wild card mask, which is the inverse of the subnet mask. And then specify the area. If you’ve got a small network, you can just put everything in area zero. Again, we’ll cover areas in more detail later on.
So network command, it uses a wild card mask rather than a subnet mask, which is the inverse of the subnet mask. So if your subnet mask was 255-2550, your wildcard mask would be 025-5255. If your subnet mask was two 5525-525-5252, your wildcard mask would be o three. To figure out the wild card mask, just subtract the octets in the subnet mask from two five five. Next thing in EIGRP, if you specify the network statement and you don’t include a wild card mask, it defaults to using the class four wildcard mask. For example 25 25 25 for a class A in OSPF, it does not default to doing that. You have to enter the wild card mask in OSPF. If you try answering a network statement without a wild card mask, it’s going to give you an error message. What the network command means is the same as it was in EIGRP.
Look for interfaces with an IP address which falls within that range and then enable OSPF on those interfaces, meaning send out and listen for OSPF hello messages and pair with adjacent OSPF routers. Once the adjacency has been formed, advertise the network and mask which is configured on those interfaces. So the same example as we had before for EIGRP. You see, we’ve got our one here, fast ethernet zero has got IP address ten 124, fast 10 is on the 1001 O 24 network and fast two is on the ten o 224 network. So we could put in three separate network statements to cover each of the interfaces, or we could just cover them all with just one network statement.
Actually, an example here, we just want to turn on OSPF for interfaces fast 10 and 20, we don’t want to include zero, so we configure a network command network ten 00:25 two five five area zero. So all interfaces that have got an IP address that begins with 100 and then anything after that we’re going to turn OSPF on for those interfaces so that will match on interface fast 10 and 20. Fast zero begins with ten one, so that is not included in the network statement. So we’re not going to turn OSPF on there. The networks that will be advertised are 100 100:24 because that’s the IP address net subnet configured on interface and 100 two O 24. We do not advertise ten O 16, which is what we configured in the network statement. Okay? The network statement does not say advertise this subnet.
The network statement says and look for interfaces which fall within this range. Enable OSPF on the interfaces and then advertise the subnet that is configured on that interface. Okay, so that’s how we do a basic configuration of OSPF. Moving on to actually verifying it. Now to see your OSPF configuration, we can do a Show run and then pipe it to section OSPF. That will show all of the OSPF commands in your running config, whether they’re under the main OSPF part of the configuration or at the interfacing level. So this is convenient to see all your OSPF commands. It’s easier than doing a Show run and trying to scroll down to the actual part of the config. Show IP protocols will show all the routing protocols that are running on the router.
You can see in the example here, we’re running OSPF with Process ID One. You can see other information like the networks is routing for the routing information sources which are the OSPF neighbors, et cetera. Show IP OSPF interface brief will show which interfaces have got OSPF enabled on them on this router, the Process ID for the interface, the area, the IP address, and mask the cost for the metric and how many neighbors are reachable through that interface. With the OSPF operations that run in the router, after you enable it, the first thing it does is it discovers neighbors and forms adjacencies. So if you’re going to verify that OSPF is working, it makes sense.
The first thing to check is that it has been able to form adjacencies. The command to check that is show. Ipospf, neighbor. Whenever I configure OSPF, the first command I always do after that, once I’ve configured both sides of the link, is Show Ipospf Neighbor. Check that the routers can see each other and they have formed an adjacency. You see the example here. The Neighbor ID is 100 two one, and it’s reachable interface faster for net zero. The next thing that happens with OSPF operations is the routers will flood the links database to see if routes have been learned from OSPF. You can use the Show IP OSPF database command that will show all the links that are available in that area and throughout the OSPF network. The next thing that happens is the routers will look at all the available possible paths and they will decide which is the best path using the shortest path first algorithm and put that best path into the routing table. So next command to verify is Show IP route and check that you’ve got OSPF routes in the routing table. Again, when I configure ISPF first command, I’ll use a Show IPF Neighbor check the adjacency has come up the next command. After that I’ll use a shoe IP route and check that OSPF routes are in the routing table. I won’t normally look at the database. Unless the routing table does not container routes. I was expecting. And then I’ll use that more as a troubleshooting command. Okay, so that was how to do a basic configuration of OSPF in the next lecture. We’ll actually do this in the lab.