OSPF Configuration Commands Reference

Classified in Technology

Written on in English with a size of 4.12 KB

Basic OSPF Settings

Change OSPF Reference Bandwidth

To modify the reference bandwidth used for automatic cost calculation:

R1(config-router)#auto-cost reference-bandwidth [ref-bw]

Manually Define Interface Cost

To set the OSPF cost for a specific interface:

R1(config-if)#ip ospf cost [costo interface]

Note: The command bandwidth [10] seems misplaced or incomplete in context.

Configure OSPF Priority

Setting the OSPF priority on an interface:

R1(config)#interface fa0/1
R1(config-if)#ip ospf priority [10]

Router ID Configuration

Setting the OSPF Process ID and Router ID:

R1(config)#router ospf 1
R1(config-router)#router-id 5.5.5.5

Loopback Interface Example

Configuring a loopback interface:

R1(config)#interface loopback 0
R1(config-if)#ip address 192.168.0.1 255.255.255.255

Network Type and Neighbor Adjacency

Non-Broadcast Network Configuration

For non-broadcast networks (like Frame Relay):

R1(config-if)#ip ospf network non-broadcast
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#network 131.144.10.0 0.0.0.255 area 0
R1(config-router)#neighbor 131.144.10.2
R1(config-router)#neighbor 131.144.10.3

Hello and Dead Timers

Adjusting OSPF neighbor timers on an interface:

R1(config-if)#ip ospf hello-interval [5]
R1(config-if)#ip ospf dead-interval [20]

Administrative Control

Change Administrative Distance

Modifying the administrative distance for OSPF:

R1(config)#router ospf 1
R1(config-router)#distance 120

OSPF Authentication

Simple Text Authentication (Clear Text)

R1(config-if)#ip ospf authentication-key [cisco]
R1(config-if)#ip ospf authentication text

MD5 Authentication

R1(config-if)#ip ospf message-digest-key [1] md5 [cisco]
R1(config-if)#ip ospf authentication message-digest

Area-Specific MD5 Authentication

Applying MD5 authentication to an entire area:

R1(config-router)#area 0 authentication message-digest

Interface Filtering

Passive Interfaces

Configuring interfaces to not send OSPF hellos:

  • Disable hellos on a specific interface:
    R1(config-router)#passive-interface fas 0/0
  • Disable hellos on all interfaces by default:
    R1(config-router)#passive-interface default
  • Re-enable hellos on a specific interface:
    R1(config-router)#no passive-interface s0/0

OSPF Multi-Area Types (ABR Configuration)

Stub Area Configuration (ABR)

Configuring Area 2 as a standard stub area on the ABR (R3):

R3(config)#router ospf 1
R3(config-router)#area 2 stub

Configuration on other routers in the area:

R2(config)#router ospf 1
R2(config-router)#area 2 stub

Totally Stubby Area Configuration (ABR)

Configuring Area 2 as a totally stubby area (blocking external routes):

R3(config)#router ospf 1
R3(config-router)#area 2 stub no-summary

Not-So-Stubby Area (NSSA) Configuration (ABR)

Configuring Area 2 as an NSSA on the ABR (R3):

R3(config)#router ospf 1
R3(config-router)#area 2 nssa

Note: The original text suggested area 2 nssa default-information-origi, which likely implies area 2 nssa default-information-originate.

Configuration on other routers in the area:

R2(config)#router ospf 1
R2(config-router)#area 2 nssa

Totally NSSA Configuration (TNSSA) (ABR)

Configuring Area 2 as a totally stubby NSSA:

R3(config)#router ospf 1
R3(config-router)#area 2 nssa no-summary

Configuration on other routers in the area:

R2(config-router)#area 2 nssa

Route Manipulation

Route Summarization

Summarizing routes in Area 0 on the ABR (R3):

R3(config)#router ospf 1
R3(config-router)#area 0 range 192.168.0.0 255.255.0.0

Virtual Links Consideration

Configuring a virtual link on router R4:

R4(config)#router ospf 1
R4(config-router)#area 3 virtual-link 3.3.3.3

Related entries: