router ospf [process-id]
Enters OSPF router configuration mode for a specified process, enabling OSPF routing protocol configuration on Cisco IOS-XR.
Overview
The 'router ospf [process-id]' command is the entry point for configuring the Open Shortest Path First (OSPF) routing protocol on Cisco IOS-XR devices. OSPF is a link-state routing protocol that uses the Dijkstra algorithm to compute the shortest path tree to all destinations in an autonomous system. This command creates an OSPF routing process with a specified process ID, which is locally significant and allows multiple OSPF instances on the same router. Once in OSPF configuration mode, you can define router ID, areas, interfaces, authentication, route summarization, and various timers. On IOS-XR, OSPF configuration is hierarchical and requires explicit interface configuration under the OSPF process using the 'area' command. This command is essential for any network engineer deploying OSPF in service provider or large enterprise networks. It fits into troubleshooting workflows by enabling verification of OSPF process status, neighbor relationships, and route propagation. Platform-specific behavior includes the use of 'commit' to apply changes and the ability to configure multiple OSPF processes for multi-topology routing.
router ospf [process-id]When to Use This Command
- Configuring OSPF on a new router to enable dynamic routing within an enterprise network.
- Setting up OSPF areas and interfaces for a multi-area OSPF design.
- Troubleshooting OSPF neighbor relationships and route propagation.
- Implementing OSPF authentication and route summarization.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| process-id | 1-65535 | A numeric identifier for the OSPF process. It is locally significant and can be any number from 1 to 65535. Multiple OSPF processes can run on the same router, each with a unique process-id. |
Command Examples
Basic OSPF Process Configuration
router ospf 100RP/0/RP0/CPU0:router(config)# router ospf 100 RP/0/RP0/CPU0:router(config-ospf)#
Enters OSPF configuration mode for process ID 100. The prompt changes to (config-ospf) indicating OSPF subcommands are available.
Configuring OSPF Router ID
router ospf 100
router-id 10.1.1.1RP/0/RP0/CPU0:router(config)# router ospf 100 RP/0/RP0/CPU0:router(config-ospf)# router-id 10.1.1.1 RP/0/RP0/CPU0:router(config-ospf)#
Sets the OSPF router ID to 10.1.1.1. The router ID must be unique in the OSPF domain and is used to identify the router.
Understanding the Output
When you enter the 'router ospf' command, the prompt changes to indicate you are in OSPF configuration mode. The process-id is a numeric identifier (1-65535) that distinguishes multiple OSPF processes. In IOS-XR, the output is minimal; the key is the prompt change. To verify OSPF configuration, use commands like 'show ospf' or 'show running-config'. A healthy OSPF process will show neighbors in FULL state and routes in the routing table. Problematic values include neighbors stuck in INIT or EXSTART, indicating misconfiguration or MTU issues.
Configuration Scenarios
Single-Area OSPF Configuration
Configuring OSPF in a small office with two routers in area 0.
Topology
R1 (Gig0/0/0/0) --- (Gig0/0/0/0) R2
Networks: 10.1.1.0/24 between them, 192.168.1.0/24 on R1 LAN, 192.168.2.0/24 on R2 LANSteps
- 1.Enter OSPF configuration mode with process-id 100.
- 2.Configure router-id on each router.
- 3.Define area 0 and assign interfaces.
! On R1 router ospf 100 router-id 1.1.1.1 area 0 interface GigabitEthernet0/0/0/0 ! ! ! On R2 router ospf 100 router-id 2.2.2.2 area 0 interface GigabitEthernet0/0/0/0 ! !
Verify: Use 'show ospf neighbor' to see adjacency state; should be FULL. Use 'show route ospf' to see learned routes.
Watch out: Ensure interfaces are not passive by default; use 'passive-interface default' only if intended.
Troubleshooting with This Command
When troubleshooting OSPF on IOS-XR, start with 'show ospf' to verify the process is running. Check 'show ospf neighbor' to see neighbor states; a FULL state indicates a healthy adjacency. If neighbors are stuck in INIT or EXSTART, check for mismatched parameters like MTU, authentication, or area ID. Use 'show ospf interface' to verify interface parameters and cost. For route issues, use 'show route ospf' to see if routes are installed. Debug commands like 'debug ospf adj' can help, but use with caution in production. Common issues include missing network statements (in IOS-XR, interfaces must be explicitly assigned to an area), incorrect router ID, or OSPF process not enabled. Also, check that the interface is not shutdown and has an IP address. In multi-area setups, verify area border router (ABR) configuration and summarization.
CCNA Exam Tips
Remember that OSPF process-id is locally significant and does not need to match between routers.
In IOS-XR, OSPF configuration is done under the 'router ospf' sub-mode; you must exit to global config to configure interfaces.
Know that the router-id can be set manually; if not set, it is derived from the highest loopback or interface IP.
Common Mistakes
Forgetting to configure network statements or interface under OSPF, causing no OSPF adjacencies.
Using the same process-id on different routers but expecting it to affect OSPF neighbor relationships (process-id is local).
Not setting a router-id manually, leading to unpredictable router-id selection after interface changes.
Platform Notes
On Cisco IOS-XR, OSPF configuration differs from classic IOS. In IOS-XR, you must enter the 'router ospf' sub-mode and then configure areas and interfaces under that process. There is no 'network' command; instead, you assign interfaces directly to an area. Configuration changes require a 'commit' to take effect. The 'router-id' command is used to set the router ID manually. IOS-XR supports multiple OSPF processes and multi-topology routing. Equivalent commands on other platforms: on Juniper JunOS, 'set protocols ospf area 0 interface ge-0/0/0.0'; on classic IOS, 'router ospf 100' followed by 'network 10.0.0.0 0.255.255.255 area 0'. Version differences: IOS-XR 6.x and later have enhanced OSPFv3 support and faster convergence features.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions