2011-12-09

OSPF Command List

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

Router(config)#router ospf process-id

Use to enter configuration mode for OSPF.
The process ID identifies a separate routing process on the router. Note: Process IDs do not need to match between routers (in other words, two routers configured with different process IDs might still share OSPF information).

Router(config-router)#network a.b.c.d w.w.w.w area number

Identifies networks that participate in OSPF routing.
a.b.c.d is the network address. This can be a subnetted, classless network.
w.w.w.w is the wildcard mask. The wildcard mask identifies the subnet address.
number is the area number in the OSPF topology. The area number must match between routers.

Router(config-router)#router-id a.b.c.d

Configures the router ID for the OSPF process.
The router ID is used to identify the DR/BDR if two routers have matching priority values.

Router(config)#interface ethernet0/1
Router(config-if)#ip ospf priority <0-255>

Sets the OSPF priority number for an interface.
The priority number is used in the DR/BDR election process. The router with the highest priority becomes the DR.
Configure a value of 0 to ensure that a router never becomes the DR or BDR.
Note: The priority is set on an interface, and applies to the DR/BDR election process on that interface.

Router(config)#interface loopback0
Router(config-if)#ip address a.b.c.d m.m.m.m

Sets an IP address for a loopback interface.
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.

Example
The following graphic shows a sample network with two OSPF areas.

Use the following commands to configure OSPF on each router:

Router

Configuration

SFO

router ospf 1
network 10.1.0.0 0.0.15.255 area 0
network 10.1.16.0 0.0.15.255 area 1
network 10.1.32.0 0.0.15.255 area 1

LAX

router ospf 2
network 10.1.16.1 0.0.0.0 area 1
network 10.2.0.1 0.0.0.0 area 1

PHX

router ospf 1
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.

Tidak ada komentar: