OSPF Commands
OSPF Commands
OSPF Commands
OSPF is fairly simple, with only a few variations from the RIP and IGRP configuration steps you have previously
use. Configuration is as simple as defining the OSPF process using the router ospf command, and then
identifying the networks that will participate in OSPF routing. The following table lists the commands and details
for configuring OSPF.
Command Purpose
Use to enter configuration mode for OSPF.
Router(config)#router The process ID identifies a separate routing process on the router. Note:
ospf process-id Process IDs do not need to match between routers (in other words, two
routers configured with different process IDs might still share OSPF
information).
Identifies networks that participate in OSPF routing.
Router(config-router) a.b.c.d is the network address. This can be a subnetted, classless network.
#network a.b.c.d w.w.w.w w.w.w.w is the wildcard mask. The wildcard mask identifies the subnet
area number address.
number is the area number in the OSPF topology. The area number must
match between routers.
Example
The following graphic shows a sample network with two OSPF areas.
file://H:\Testout\resources\Cisco\c802\ospf_cfg\ospf_cfg.htm 12/9/2010
OSPF Command List Page 2 of 2
Router Configuration
router ospf 1
network 10.1.0.0 0.0.15.255 area 0
SFO network 10.1.16.0 0.0.15.255 area 1
network 10.1.32.0 0.0.15.255 area 1
router ospf 2
LAX network 10.1.16.1 0.0.0.0 area 1
network 10.2.0.1 0.0.0.0 area 1
router ospf 1
PHX network 10.1.32.0 0.0.15.255 area 1
network 10.3.0.0 0.0.255.255 area 1
The process ID on each router does not have to match. OSPF uses areas to identify sharing of routes, not
the process ID.
You can use the subnet address with the appropriate wildcard mask (as in 10.1.16.0 0.0.15.255), or you
can use the IP address of the router interface with a mask of 0.0.0.0.
The network command identifies the subnet, wildcard mask, and the OSPF area of the subnet. A subnet
can only be in one area.
file://H:\Testout\resources\Cisco\c802\ospf_cfg\ospf_cfg.htm 12/9/2010