200-301 · IP Connectivity · Updated August 3, 2026
Single-Area OSPFv2: Configuration, Wildcards, and Verification
Single-area OSPFv2 (Open Shortest Path First version 2) puts every router and every link into one area, normally area 0, so there is no area border router and no inter-area summarization to reason about. Configuration comes down to four decisions: which process ID to use locally, which interfaces to enable OSPF on, what router ID each device carries, and which interfaces should listen without advertising. Everything else runs on defaults that the exam expects you to know by number.
Process configuration
R1(config)#router ospf 1
R1(config-router)#
The value after router ospf is the process ID, valid from 1 to 65535. It identifies one OSPF instance inside this router and it is never compared against a neighbor. Two routers running process 1 and process 77 form an adjacency without complaint. Matching the numbers across a site is an operational convention, not a protocol requirement, and an exam item that claims process IDs must agree is testing exactly that misconception.
Interface activation
The classic method is the network statement, which takes an address, a wildcard mask, and an area:
R1(config-router)#network 10.1.1.0 0.0.0.255 area 0
R1(config-router)#network 192.168.10.4 0.0.0.3 area 0
The statement does not advertise a network. It selects local interfaces. Any interface whose IP address falls inside the range described by the address and wildcard is brought into OSPF: the router starts sending hellos out of it, and it advertises that interface’s connected subnet using the subnet’s real mask, not the wildcard.
A wildcard mask is the bitwise inverse of a subnet mask. A 0 bit means the corresponding address bit must match; a 1 bit means it is a don’t-care. Derive it by subtracting each subnet mask octet from 255:
- 255.255.255.0 becomes 0.0.0.255
- 255.255.255.252 becomes 0.0.0.3
- 255.255.240.0 becomes 0.0.15.255
- 255.255.255.255 becomes 0.0.0.0
That last one is the precise form. network 10.1.1.1 0.0.0.0 area 0 matches exactly one interface, the one holding 10.1.1.1, and it is the safest way to enable OSPF on a specific link without accidentally catching a second interface in the same range.
The interface-level alternative skips the wildcard arithmetic entirely:
R1(config)#interface GigabitEthernet0/1
R1(config-if)#ip ospf 1 area 0
| Aspect | network under the process | ip ospf <pid> area <n> under the interface |
|---|---|---|
| Where it is entered | R1(config-router)# | R1(config-if)# |
| Selection method | Wildcard match against interface addresses | Explicit, one interface at a time |
| Risk of catching an extra interface | Real, if the wildcard is loose | None |
| Effect if the interface is renumbered | May silently fall out of OSPF | Unaffected |
| Precedence when both are configured | Loses | Wins |
Both methods produce identical protocol behavior. The interface command is preferred in current practice, and both appear on the exam.
Router ID selection
Every OSPF router carries a 32-bit router ID written in dotted-decimal form. IOS chooses it in this order:
- The
router-idvalue configured under the process. - Otherwise, the highest IP address on any up loopback interface.
- Otherwise, the highest IP address on any up non-loopback interface.
R1(config-router)#router-id 1.1.1.1
The router ID is selected once, when the process starts, and it does not follow later changes. Adding a loopback or configuring router-id on a running process has no effect until you issue clear ip ospf process and confirm, which tears down every adjacency. Loopbacks are used for the second rule because they never go down, which keeps the ID stable across physical link failures.
Passive interfaces
A passive interface stops sending hellos and therefore never forms an adjacency, but OSPF still advertises that interface’s subnet to the rest of the area. That is exactly what a user-facing LAN or a server VLAN needs: the prefix is reachable, and no hostile device on the segment can bring up a neighbor relationship.
R1(config-router)#passive-interface GigabitEthernet0/2
On a router with many LANs and few transit links, invert the logic:
R1(config-router)#passive-interface default
R1(config-router)#no passive-interface GigabitEthernet0/0
Cost and reference bandwidth
OSPF cost is computed as reference bandwidth divided by interface bandwidth, rounded down, with a minimum of 1. The default reference bandwidth is 100 Mbps (100,000,000 bits per second), so a 10 Mbps link costs 10, a 100 Mbps link costs 1, and a 1 Gbps link, a 10 Gbps link, and a 100 Gbps link all cost 1 as well. Anything at or above 100 Mbps is indistinguishable to the default calculation.
R1(config-router)#auto-cost reference-bandwidth 10000
That sets the reference to 10,000 Mbps, making 10 Gbps cost 1, 1 Gbps cost 10, and 100 Mbps cost 100. The value must be identical on every router in the area, because cost is used when comparing paths built from links on several devices. A single interface can also be overridden directly with ip ospf cost 25 under the interface, which ignores the bandwidth calculation.
Timers and distance
On broadcast and point-to-point network types the hello interval is 10 seconds and the dead interval is 40 seconds, four times the hello. OSPF’s administrative distance is 110 for all route types. That number is what a backup static route has to be compared against: to hold a static path in reserve behind OSPF, its distance must be set above 110, which is the design covered in floating static routes. Leaving the static at its default distance of 1 would keep OSPF’s route out of the table permanently.
Verification
R1# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/DR 00:00:34 10.1.1.2 GigabitEthernet0/1
show ip ospf neighbor is the first command: a neighbor in FULL, or in FULL/DR or FULL/BDR on a broadcast segment, means the adjacency is complete. show ip protocols prints the router ID, the networks the process is matching, the passive interface list, and the administrative distance. show ip ospf interface brief gives a one-line-per-interface summary of area, cost, state, and neighbor count. Learned routes carry the O code and a bracketed distance and cost, read the same way as every other line in the routing table:
O 10.60.0.0/16 [110/3] via 10.1.1.2, 00:41:12, GigabitEthernet0/1
When an expected neighbor never reaches FULL, the cause is one of a short list of mismatched parameters, walked through in why OSPF neighbors will not form.
How the 200-301 exam tests this
- Wildcard derivation. A stem gives a subnet and asks for the
networkstatement that enables OSPF on just that interface. Convert the mask to its inverse, and check the distractors for a subnet mask pasted where the wildcard belongs. - Process ID significance. Two routers are shown with different process numbers and you are asked whether they will peer. They will. Process IDs are local.
- Router ID prediction. A configuration lists several interface addresses, one or two loopbacks, and possibly a
router-idline, and asks which ID the router uses. Apply the three-step order, and remember that a loopback beats a higher-numbered physical address. - Cost arithmetic. An item changes the reference bandwidth on one router only, or asks why two links of different speeds share a cost of 1. Both trace back to the 100 Mbps default and the requirement that the reference match everywhere.
- Distance interaction. A scenario needs OSPF to be used whenever it has the prefix and a static path used only otherwise. The static route’s distance must be higher than 110.
Wildcard derivation under time pressure is a skill rather than a fact — build it with timed practice exams instead of assuming the arithmetic will show up on the day.
Quick reference
router ospf <1-65535>; the process ID is locally significant and need not match neighbors.network <address> <wildcard> area <n>selects interfaces; the wildcard is the inverse of the subnet mask.ip ospf <process-id> area <n>under an interface does the same job explicitly and takes precedence.- Router ID order: configured
router-id, then highest up loopback, then highest up physical address. - A router ID change requires
clear ip ospf processto take effect. passive-interfacestops hellos on a link while still advertising its subnet.- Cost equals reference bandwidth divided by interface bandwidth, default reference 100 Mbps, minimum cost 1.
auto-cost reference-bandwidthmust be set identically on every router in the area.- Hello 10 seconds and dead 40 seconds on broadcast and point-to-point links; administrative distance 110.
- Verify with
show ip ospf neighbor,show ip protocols,show ip ospf interface brief, andshow ip route ospf.