TechKnowSurge
Cisco CCNA 3.4
VideoNetworkFree

DEMO: Configuring OSPF Networks

OSPF network statements and wildcard masks control which router interfaces participate in the routing process, and understanding how to scope them correctly is essential for managing network connectivity.

Complete this video to capture a CTF flag worth 1 point.

About this video

OSPF network statements are configured under the OSPF routing process and use wildcard masks to define which interfaces will send and receive OSPF packets. The wildcard mask is the bitwise inverse of the subnet mask — a /28 network, for example, produces a wildcard mask of 0.0.0.15, because the four host bits that remain after 28 network bits translate to binary values 8+4+2+1 equaling 15. Getting this calculation right determines whether a given interface falls within the scope of the network statement and therefore participates in OSPF adjacency formation and route advertisement. Three approaches to enabling an interface in OSPF are demonstrated using a lab topology of a Layer 3 switch and three routers all running OSPF process 10 in area 0. The first is a broad network statement covering the entire 10.0.0.0/8 space, which automatically includes all interfaces on all Layer 3 devices. The second is a subnet-specific statement that targets only the /28 network connecting two devices, enabling OSPF on just that segment. The third uses the exact interface IP address with an all-zero wildcard mask, which matches a single host and precisely targets one interface with no ambiguity. Beyond network statements, OSPF participation can also be configured directly on an interface using the ip ospf command with the process ID and area number. This approach eliminates the need for a network statement entirely and produces equivalent results — the interface begins sending and receiving OSPF packets immediately. Both methods are valid in production environments, and understanding how they interact gives network engineers precise control over which paths participate in OSPF and how routing information propagates through the network.

What you'll learn

What's covered

OSPF Network Statements

Aligned to

Cisco CCNA
3.4 Configure and verify single area OSPFv2

Key terms

Open Shortest Path First
OSPF
A link-state interior gateway routing protocol that maintains a complete map of the network topology and uses Dijkstra's Shortest Path First algorithm to calculate optimal, loop-free routes. OSPF divides networks into hierarchical areas to improve scalability and supports VLSM and rapid convergence.
Wildcard Mask
A 32-bit mask used in ACL statements and OSPF network commands where a 0 bit means the corresponding address bit must match and a 1 bit means it can be anything. Wildcard masks are the inverse of subnet masks and allow a single statement to match an entire range of IP addresses.
OSPF Network Statement
A configuration command that identifies which interfaces and directly connected networks will participate in the OSPF routing process.
OSPF Area
A logical grouping of routers and networks within OSPF used to limit routing update traffic and scale large networks; Area 0 is the backbone area required in all OSPF deployments.
ip ospf process-id area Command
An interface-mode command that enables OSPF directly on a specific interface, serving as an alternative to the router-mode network statement.
Routing Protocol
A protocol used by routers to communicate and share routing information to determine the best path for data.

Transcript

This is the network that we're working with. I have a switch here which is a layer 3 switch, and three routers, router 1, 2 and 3. I'm consoled into router 1, because what we're going to do here is actually going to break connectivity, so I'm going to console into it rather than SSH into it. Down here I'm pinging 10.2.0.5, which is this far switch right here, and I'm also pinging 10.240.0.2, which is the interface right here. So what I'm going to do is I'm going to play around with some different network statements.

All of these layer 3 devices have OSPF running, and they're using this network 10.0.0.0 0.255.255.255 area 0. So that network statement includes all of my networks in here, which includes all of the interfaces of these layer 3 devices, so that gives it full connectivity.

Removing the broad network statement

But let's first of all cut that. So I'm going to get into the global, actually let's do a show ip route just to take a look. You can see it's learning quite a few routes here. But I'm going to get into the global configuration mode, and I'm going to get into the router ospf 10, and I'm going to do a no on this statement right here. So I'll copy that, I'll paste it into here, and there we have it.

So now what we can do is do show ip route, and we no longer have those OSPF connectivities. The OSPF still has this process ID of 10, but it's not communicating out any of these interfaces, and so now we've lost connectivity everywhere.

A network statement with a wildcard mask

So what I'm going to do next is going to do a different network statement. The network statement I'm going to do is for the interface 10.0, excuse me, it's 240.0.0 is the interface. So we can see between HQ and R1 that is the network right there. And I'm going to do a wildcard mask of 0.0.0 dot, and then we've got to figure out what the last part of this is. I do have the answer over here, but what this is is this is a slash 28 here. And we can see that right here this network is a 10.240.2.0/28.

So if we were going to take the network mask out we would have 28 ones, which would leave us four zeros. And then what we do is we translate that into a wildcard mask, which would be the flip of that. So this is the wildcard mask right here, and that equates to 0.0.0, and then I've got to figure this out. Here's the 8 is turned on, plus the 4, so that's 12, plus the 2, which is 14, plus the 1, which is 15. So that would be dot 15. So I'm going to enter dot 15 in there, and then area 0.

So what we're turning on here is this interface right here, so messages will be sent out now to switch 1, which is going to give us connectivity between R1 and this switch, but it's not going to give us connectivity to the rest of this network. So let's see that play out in action. Remember this ping right here, 10.240.0.2, so that comes live, but this 10.2.0.5 is not coming live, because we do not have anything running between this router and the rest of the network, so it's not aware of this last network over here.

A network statement for a single interface

All right, so next let's get this interface up and running and configure that one. So I can do network, and 10 dot 240, and that network is 2, and the IP address of that is right here, is dot two. So this time rather than doing 10.240.2.2, so just the interface. And when I specify just an interface, just a single host, then the wildcard mask is going to be all zeros, because there's no variable bits in there. So I'll put that as area 0, and I'm going to hit enter for that.

And I'm going to take a look at my ip route here, and I can see it's already populated with more networks. These are the networks from this switch, so that was there before, but the one that we're looking for is this one right here, 10.2.0.0/24. That's the far end. So now I'm pinging that far end here, I got full connectivity throughout my network. So I could either specify the network that these are part of, the whole network, the big scope of the 10.0.0.0, or the specific interface.

The interface statement

There is one other command that I'm going to show you, and to do that I'm going to take this command back off. That's for this interface associated with 10.240.2.2, so that's the interface right there. So so far we've been using network statements, the big network statement, the actual subnet that we are working with, and the specific interface. But now what I'm going to do is I'm actually going to get into the interface, and we're going to change the interface.

So I'm going to get into interface, and this is serial 0 0 0 as I believe what the interface is. And it doesn't like that, so let's do show ip interface brief and just see what the interface is. So serial 0 1 0, okay, so that's the interface right there. So I'm going to get into interface serial 0 1 0, and then we are going to then specify the command ip ospf and the OSPF process. So we're using the OSPF process of 10, and the area, and so far we just have one area, and the recommendation for that is to be zero, so we can do area 0, and then we hit enter right there.

So now we've turned off the network statement. Let me pull up my picture here. I've turned off the network statement, or the interface statement, for this right here, and then we got onto the interface and created that ip ospf 10 area 0 there. And we can see that it's come live here. So we are good to go, we are now communicating across it, it is sending and receiving these OSPF packets out this interface.

So we can use network statements or this interface statement to specify which interfaces we want to participate in OSPF. With the network statement we can do a really broad statement, as long as it includes that interface. We could do just the subnet that the interface is a part of, or we could do the specific IP address for that interface.

About TechKnowSurge

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 →