A practical walkthrough of configuring OSPF on a router to establish full network connectivity across a multi-VLAN topology. Covers process ID assignment, wildcard mask usage, and network statement configuration in a single OSPF area.
Configuring OSPF on Router
We're using the same topology here. I am consoled into router one, which I don't have connectivity to right now, and I don't have connectivity because there's no routing protocol that's set up. What's happening is I'm on this demo laptop and I can ping out and it will get to this router one, but that can't come back because this router 1 is not aware of any of these VLANs here.
So what we're going to do is set up OSPF on here. I already have OSPF set up on this switch right here, so I don't need to set up OSPF there, and I'm using the same commands on this router one because my network statement encompasses all of my networks within here. So it's going to encompass all of the interfaces and all of the networks, and I'm good to go.
Right down here I'm pinging 10.240.2.2 2, which is this interface on router 1 right here, so as soon as I have connectivity I should be able to successfully ping. That's a continuous ping.
Now what I'm going to do is get onto my router and get into the global configuration mode. I'm going to do the router ospf and then that process ID. We said the process ID is specific to these routers and it really doesn't matter what it is — we're not dealing with multiple processes, multiple OSPF processes, so we don't really need to worry about it. But I'm going to use 10 and be consistent across all of the different routers.
Then I'm into the router ospf. Now, still nothing is being sent out to other devices on here. Before I do this, I'm going to do a show ip route and let's just see what it looks like. You see the directly connected networks.
Now I'm going to type in my network statement. So network, and then it's the 10.0.0.0. We're doing a /8, and then for a subnet mask that would be a 255.0.0.0, but this is a wildcard mask, and as we mentioned it's the opposite, so I'm going to do 0.255.255.255. And then we do area. The area for this — we're just doing all one area for this topology, it's very simplistic and only needs one area, and the best practice is to be area zero. So I'm going to enter that in.
Now at this point in time it selects the interfaces that fall under that range, starts sending out information, and it's sending out the information from whatever networks fall into that range. We can see that our pings are successful now.
I can do the show ip route and I can see quite a few in there — all of the OSPF routes across the whole network. So now I have connectivity via OSPF.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →