Está en la página 1de 2

OSPF Command List Page 1 of 2

OSPF Command List

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.

Router(config-router) Configures the router ID for the OSPF process.


#router-id a.b.c.d The router ID is used to identify the DR/BDR if two routers have matching
priority values.
Sets the OSPF priority number for an interface.
Router(config)#interface The priority number is used in the DR/BDR election process. The router with
ethernet0/1 the highest priority becomes the DR.
Router(config-if)#ip ospf Configure a value of 0 to ensure that a router never becomes the DR or
priority <0-255> BDR.
Note: The priority is set on an interface, and applies to the DR/BDR election
process on that interface.
Router(config)#interface
loopback0 Sets an IP address for a loopback interface.
Router(config-if)#ip The IP address is used as the router ID and is used to determine the DR and
BDR if two routers have the same priority value.
address a.b.c.d m.m.m.m

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

Use the following commands to configure OSPF on each router:

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

Notice the following in the configuration:

 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

También podría gustarte