TechKnowSurge
Cisco CCNA 3.4 Cisco CCNA 1.6
VideoNetworkFree

OSPF Networks

The OSPF network statement serves two distinct purposes: activating OSPF hello packets on matching interfaces and including those networks in link-state advertisements to neighboring routers. Understanding both functions is essential for correctly configuring OSPF on multi-VLAN environments.

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

About this video

The OSPF network statement has two distinct and equally important functions that network engineers must understand before deploying OSPF in a production environment. First, it activates OSPF on any local interface whose IP address falls within the specified network range, causing that interface to begin sending hello packets in an attempt to discover and form adjacencies with neighboring OSPF-capable devices. Second, once an adjacency is established, the matching network prefix is included in the router's link-state advertisements, making that network reachable to the rest of the OSPF domain. This content demonstrates these two behaviors using a headquarters distribution switch configured with multiple VLANs — specifically VLANs 9, 10, 20, and 30 — and walks through the effect of entering each network statement individually rather than using a broad wildcard mask that encompasses all interfaces at once. By observing each statement in isolation, the behavior becomes predictable and repeatable: each entry causes hello packets to flood the corresponding VLAN and adds that subnet to outbound link-state advertisements sent to an established neighbor such as R1. An important operational consideration emerges from this approach: sending hello packets into end-user VLANs introduces a security risk, as devices on those segments could potentially respond and participate in the OSPF process. While advertising those networks to the routing domain is generally desirable, activating OSPF on interfaces facing end users warrants additional controls such as passive interfaces. Recognizing the dual role of the network statement is foundational to making deliberate, secure OSPF design decisions.

What you'll learn

What's covered

OSPF Network Statement

Aligned to

Cisco CCNA
3.4 Configure and verify single area OSPFv2
1.6 Configure and verify IPv4 addressing and subnetting

Key terms

Open Systems Interconnection Model
OSI
A conceptual framework that standardizes network communication into seven distinct layers.
Routing Protocol
A protocol used by routers to communicate and share routing information to determine the best path for data.
Router
A network device that forwards data packets between networks based on IP addresses.
Subnet Mask
A 32-bit number that divides an IP address into network and host portions.
OSPF Network Statement
A configuration command that identifies which interfaces and directly connected networks will participate in the OSPF routing process.
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 Hello Packet
A message sent by an OSPF-enabled interface to discover and maintain adjacencies with neighboring OSPF routers.
OSPF Adjacency
A relationship formed between two OSPF neighbors after exchanging hello packets, enabling them to share link-state routing information.

Transcript

The network statement

We're going to get a little more in depth into that network statement in our OSPF commands and what that network statement means. We're going to take a look at this HQ SW1 and its networks here, and how it is applied to OSPF.

In my last demo I typed in router ospf 10 and then 10.0.0.08, so it really encompassed everything. But let's do it line by line and see what would happen if we entered these in line by line.

VLAN 9

The network 10.1.240.0, with a wildcard mask of 0.0.0.7, is actually this network right here, so this is VLAN 9. The actual interface, this dot one, is a switch virtual interface on VLAN 9.

So what this statement does is, number one, it says that that VLAN 9 interface will now send out hello messages on it. It's going to try to find a device on that link right there that is also speaking OSPF for area zero. That's the first thing that it does.

The second thing that it does is this network right here will then be part of the advertisements that it sends out once it establishes an adjacency.

VLAN 10

Let's take a look at another one of these. We type this command in: network 10.1.10.0 24. So that's VLAN 10. This laptop is on it right here, and this demo Pi is on it, and this switch is on it — in fact all of these switches are on it, so that VLAN.

Two things happen with it. Number one, that VLAN is going to be sent hellos, trying to discover other OSPF devices on that network. So now we're sending these hello messages into VLAN 10. We may not want that — if somebody's sitting on that network, they could actually start responding and participate in this OSPF network, so that could be concerning.

But what we do want to have happen is that network now will be advertised out to those devices it establishes adjacencies with. So it established an adjacency — because of this statement it sent out hello and established an adjacency with R1 — so now it's going to let R1 know that in fact it has this 10.1.10.0 network, and R1 is going to become aware of that network.

VLAN 20 and VLAN 30

Now we send out another network statement. Work through that process: when we enter this in, what two things will happen?

What's going to happen when we enter in this statement is that number one, now this switch one is going to send out hello messages on VLAN 20 to try to discover different OSPF devices on there. And number two, in its advertisement, since it's created this adjacency with R1, it's going to send out a link state advertisement saying that it has access to 10.1.20.0 network, so R1 becomes aware of this network.

Finally we entered in this command right here, and you can see the pattern: VLAN 30 will now get hello packets that are coming into it to try to establish adjacency, and R1 will become aware of this 10.1.30.0 network.

What the statement does

When we specify all of those interfaces on this switch one, they will then have these hello packets sent out on them — and we may not want that, by the way — and in addition to that, all of these networks are going to get advertised out so that they're reachable by the rest of the network, which is something we probably do want.

So that is the OSPF network statement: it serves two different purposes.

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 →