Back to Command Reference
Router ConfigDomain 6.0

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

Execution ModeRouter(config-router)#
Mask StandardInverse / Wildcard Mask
Mandatory TopologyHierarchical (Must have Area 0)
Modern Alternativeip ospf [id] area [id] (Interface level)

Syntax Breakdown

network [ip-address] [wildcard-mask] area [area-id]

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.

Router(config)# router ospf 1
Router(config-router)# network 192.168.10.0 0.0.0.255 area 0
%OSPF-5-ADJCHG: Process 1, Nbr 10.0.0.2 on GigabitEthernet0/1 from LOADING to FULL, Loading Done
! OSPF found an interface in that subnet, activated it, and instantly formed an adjacency with a neighbor.

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.

Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip address 10.55.100.1 255.255.255.252
Router(config-if)# exit
Router(config)# router ospf 1
Router(config-router)# network 10.55.100.1 0.0.0.0 area 0
! Because the wildcard is all zeros, OSPF searches for an interface with the exact IP 10.55.100.1 and activates it.

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.