network [ip] [wildcard] area [id]
Instructs the OSPF process to scan the router's interfaces. If an interface's IP address falls within the specified network and wildcard mask range, OSPF activates on that interface, begins transmitting Hello packets to find neighbors, and injects that interface's local subnet into the OSPF database.
Quick Reference
Router(config-router)#(Must have Area 0)ip ospf [id] area [id] (Interface level)Syntax Breakdown
The Wildcard Mask Logic
A wildcard mask is the exact inverse of a subnet mask. It uses binary 0s and 1s to tell the router which parts of the IP address to strictly check, and which parts to ignore.
- 0 = "Care" Bit. The router must match this octet exactly.
- 255 = "Don't Care" Bit. The router accepts any number in this octet.
For example, a wildcard mask of 0.0.0.255 means: "The first three octets of the interface IP must match the network statement exactly, but the last octet can be anything from 0 to 255."
CLI Deployment Scenarios
Scenario 1: Subnet-Based Injection
You want to enable OSPF on any interface that belongs to the 192.168.10.0 /24 network and assign those interfaces to the backbone area.
Scenario 2: The "Quad-Zero" Interface Specific Hack
Instead of calculating wildcard math, network engineers frequently use the 0.0.0.0 wildcard mask to target the exact IP address of a specific interface, ensuring they never accidentally activate OSPF on the wrong port.
CCNA Exam Gotchas
The Subtraction Trick
If the CCNA gives you a subnet mask of 255.255.255.240 and asks for the OSPF network command, use this mathematical trick to find the wildcard: Subtract the subnet mask from 255.255.255.255. 255 . 255 . 255 . 255
- 255 . 255 . 255 . 240
-----------------------
0 . 0 . 0 . 15
The Backbone (Area 0) Requirement
OSPF is a hierarchical protocol. The CCNA will often present a topology where Area 1 connects to Area 2, but neither connects to Area 0. This topology will fail to route traffic. All standard areas must physically (or virtually) touch Area 0 to inject their routes into the global database.