Courseiva
IPv6Global Config

ipv6 router ospf [pid]

Enables OSPFv3 routing process for IPv6 on a router and enters OSPF router configuration mode, used to configure OSPFv3 parameters.

Definition: ipv6 router ospf [pid] is a Cisco IOS global config command. Enables OSPFv3 routing process for IPv6 on a router and enters OSPF router configuration mode, used to configure OSPFv3 parameters.

Overview

The `ipv6 router ospf [pid]` command is a fundamental IOS command used to enable the OSPFv3 routing process for IPv6 on a Cisco router. OSPFv3 is the IPv6-capable version of the Open Shortest Path First (OSPF) routing protocol, defined in RFC 5340. Unlike OSPFv2, which runs over IPv4, OSPFv3 uses IPv6 as the transport protocol and runs directly over IPv6 link-local addresses. This command creates an OSPFv3 routing process identified by a process ID (pid) and enters OSPF router configuration mode, where you can configure OSPFv3 parameters such as router ID, area assignment, interface costs, authentication, and redistribution.

Why this command matters: In modern networks, IPv6 adoption is growing due to IPv4 address exhaustion. OSPFv3 is a critical interior gateway protocol (IGP) for IPv6 networks, providing fast convergence, loop-free routing, and support for hierarchical designs. Without this command, a router cannot participate in OSPFv3 routing. It is the first step in deploying OSPFv3 on a Cisco router.

The networking concept behind OSPFv3: OSPFv3 operates similarly to OSPFv2 but with key differences. It uses link-local addresses for neighbor adjacency and next-hop forwarding, and it supports multiple instances per link. OSPFv3 uses the same SPF algorithm and area hierarchy (backbone area 0, standard areas, stub areas, NSSA). The process ID is locally significant and does not need to match between routers. The router ID is still a 32-bit number, often derived from a loopback IPv4 address or manually configured.

When to use this command vs alternatives: Use `ipv6 router ospf` when you need to run OSPF for IPv6. Alternatives include `ipv6 router rip` for RIPng (simpler but slower convergence) or `ipv6 router eigrp` for EIGRP for IPv6 (Cisco proprietary). For large, scalable networks requiring fast convergence and hierarchical design, OSPFv3 is preferred. In multi-vendor environments, OSPFv3 is the standard IGP for IPv6.

How it fits into the broader workflow: After enabling OSPFv3 globally, you must configure OSPFv3 on specific interfaces using `ipv6 ospf [pid] area [area-id]`. You may also need to configure the router ID manually, adjust timers, set authentication, or redistribute routes. Verification commands like `show ipv6 ospf neighbor`, `show ipv6 route ospf`, and `show ipv6 ospf database` are used to confirm operation.

Important IOS behavior: The command requires global configuration mode (privilege level 15). It modifies the running configuration immediately. The process ID must be a positive integer between 1 and 65535. If you omit the process ID, IOS prompts for it. The command does not affect OSPFv2; OSPFv3 is a separate process. In IOS 15.x and later, OSPFv3 supports address families, but the traditional mode is still widely used. The command is available in IOS, IOS-XE, and IOS-XR (with different syntax).

Syntax·Global Config
ipv6 router ospf [pid]

When to Use This Command

  • Enable OSPFv3 on a router to route IPv6 traffic in an enterprise network.
  • Configure multiple OSPFv3 processes with different process IDs for administrative separation.
  • Set OSPFv3 router ID manually to ensure stability in router elections.
  • Adjust OSPFv3 timers like hello and dead intervals for faster convergence on high-speed links.

Parameters

ParameterSyntaxDescription
pid<1-65535>The process ID for the OSPFv3 routing process. It is locally significant and does not need to match between routers. Valid values are from 1 to 65535. A common mistake is using the same process ID on all routers, which is not required but often done for consistency.

Command Examples

Basic OSPFv3 Configuration with Router ID

ipv6 router ospf 100
Router(config)# ipv6 router ospf 100
Router(config-rtr)# router-id 1.1.1.1
Router(config-rtr)# exit

The command enters OSPFv3 router configuration mode for process 100. The router-id command sets the OSPFv3 router ID to 1.1.1.1. The exit command returns to global configuration mode.

Verifying OSPFv3 Process Configuration

show ipv6 ospf 100
Routing Process "OSPFv3 (100)" with ID 1.1.1.1
Process uptime is 5 minutes
Supports only single TOS(TOS0) routes
It is an area border router
Number of areas: 2
  Area BACKBONE(0)
    Number of interfaces in this area is 2
    SPF algorithm executed 3 times
  Area 1
    Number of interfaces in this area is 1
    SPF algorithm executed 2 times

The output shows OSPFv3 process 100 with router ID 1.1.1.1. 'Process uptime' indicates how long the process has been running. 'It is an area border router' means this router connects to multiple areas. 'Number of areas' shows 2 areas: backbone (0) and area 1. For each area, the number of interfaces and SPF executions are listed.

Understanding the Output

The 'show ipv6 ospf [pid]' command displays OSPFv3 process details. The 'Routing Process' line shows the process ID and router ID. 'Process uptime' indicates stability.

'Supports only single TOS' is normal for OSPFv3. 'It is an area border router' appears if the router has interfaces in multiple areas. 'Number of areas' lists each area with its ID.

For each area, 'Number of interfaces' shows how many interfaces are participating, and 'SPF algorithm executed' indicates how many times the SPF calculation has run (higher numbers may indicate network instability). Good values: low SPF counts, stable uptime. Watch for: frequent SPF recalculations indicating flapping links.

Configuration Scenarios

Enable OSPFv3 on a single router with a manually configured router ID

A network engineer needs to enable OSPFv3 on a router that will participate in an IPv6 OSPF domain. The router ID must be set manually to ensure stability, as no IPv4 loopback exists.

Topology

R1 (Loopback0: 10.0.0.1/32, Gi0/0: 2001:db8:1::1/64)

Steps

  1. 1.Step 1: Enter global configuration mode: configure terminal
  2. 2.Step 2: Enable OSPFv3 process with process ID 100: ipv6 router ospf 100
  3. 3.Step 3: Set the router ID manually: router-id 10.0.0.1
  4. 4.Step 4: Exit OSPF configuration mode: exit
  5. 5.Step 5: (Optional) Verify the OSPFv3 process: do show ipv6 ospf 100
Configuration
!
Router(config)# ipv6 router ospf 100
Router(config-rtr)# router-id 10.0.0.1
Router(config-rtr)# exit
!

Verify: Use 'show ipv6 ospf 100' to verify the process is running and the router ID is set to 10.0.0.1. Expected output includes 'Routing Process "ospfv3 100" with ID 10.0.0.1'.

Watch out: If you do not set a router ID manually, OSPFv3 will use the highest IPv4 loopback address or the highest IPv4 interface address. If no IPv4 address exists, the process may fail to start. Always configure a router ID when using IPv6-only networks.

Configure OSPFv3 between two routers in area 0

Two routers, R1 and R2, are directly connected via GigabitEthernet interfaces. They need to exchange IPv6 routes using OSPFv3 in the backbone area 0.

Topology

R1(Gi0/0)---2001:db8:12::/64---(Gi0/0)R2

Steps

  1. 1.Step 1: On R1, enable OSPFv3 process 100 and set router ID: configure terminal, ipv6 router ospf 100, router-id 10.0.0.1, exit
  2. 2.Step 2: On R1, enable OSPFv3 on Gi0/0 in area 0: interface GigabitEthernet0/0, ipv6 ospf 100 area 0
  3. 3.Step 3: On R2, enable OSPFv3 process 100 and set router ID: configure terminal, ipv6 router ospf 100, router-id 10.0.0.2, exit
  4. 4.Step 4: On R2, enable OSPFv3 on Gi0/0 in area 0: interface GigabitEthernet0/0, ipv6 ospf 100 area 0
  5. 5.Step 5: Verify OSPFv3 neighbor adjacency on both routers: show ipv6 ospf neighbor
Configuration
!
! R1 configuration
Router(config)# ipv6 router ospf 100
Router(config-rtr)# router-id 10.0.0.1
Router(config-rtr)# exit
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ipv6 ospf 100 area 0
Router(config-if)# exit
!
! R2 configuration
Router(config)# ipv6 router ospf 100
Router(config-rtr)# router-id 10.0.0.2
Router(config-rtr)# exit
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ipv6 ospf 100 area 0
Router(config-if)# exit
!

Verify: Use 'show ipv6 ospf neighbor' on either router. Expected output shows a FULL state neighbor with the neighbor's link-local address. For example: 'Neighbor ID Pri State Dead Time Address Interface 10.0.0.2 1 FULL/DR 00:00:39 FE80::2 GigabitEthernet0/0'

Watch out: OSPFv3 uses link-local addresses for neighbor adjacency. Ensure that IPv6 is enabled on the interface (by configuring a global unicast address or using 'ipv6 enable'). Also, the OSPFv3 process ID does not need to match between routers, but it is common practice to use the same ID for simplicity.

Troubleshooting with This Command

When troubleshooting OSPFv3, the `ipv6 router ospf` command itself is not directly used for diagnostics, but it is the prerequisite for all OSPFv3 show commands. The first step in troubleshooting is to verify that the OSPFv3 process is running. Use `show ipv6 ospf [pid]` to check the process status. Healthy output shows 'Routing Process "ospfv3 100" with ID 10.0.0.1' and 'Number of areas: 1'. Problem indicators include 'OSPFv3 process not running' or 'Router ID is 0.0.0.0', which means the router ID is missing. If the process is not running, check that the command was entered correctly and that the router ID is set (if no IPv4 address exists).

Next, check OSPFv3 neighbor relationships with `show ipv6 ospf neighbor`. Healthy output shows neighbors in FULL state. If neighbors are stuck in INIT or EXSTART, there may be a mismatch in MTU, authentication, or area ID. Use `debug ipv6 ospf adj` to see adjacency events. Also verify interface OSPFv3 configuration with `show ipv6 ospf interface [interface]`. This command shows the area, cost, timers, and neighbor state. If an interface is not listed, OSPFv3 is not enabled on it. Common symptoms include missing routes, which can be diagnosed with `show ipv6 route ospf`. If routes are missing, check the OSPF database with `show ipv6 ospf database` to see if LSAs are received. Missing Type 1 or Type 2 LSAs indicate a neighbor issue.

Correlate with other commands: Use `show ipv6 interface brief` to confirm IPv6 is enabled on interfaces. Use `ping` to test reachability between link-local addresses. For authentication issues, use `show ipv6 ospf interface` to see if authentication is configured. The command `show running-config | section ipv6 router ospf` displays the OSPFv3 configuration. In complex scenarios, use `debug ipv6 ospf packet` to inspect hello packets. Remember that OSPFv3 uses link-local addresses, so ensure that the link-local address is not filtered by ACLs. Also, OSPFv3 requires multicast group FF02::5 for all OSPF routers and FF02::6 for DR/BDR. If multicast is blocked, adjacencies will not form. Finally, check that the OSPFv3 process ID is consistent in interface commands: `ipv6 ospf [pid] area [area-id]` must match the process ID used in `ipv6 router ospf [pid]`.

CCNA Exam Tips

1.

CCNA exam expects you to know that OSPFv3 uses a process ID that is locally significant and can be any value between 1 and 65535.

2.

Remember that OSPFv3 requires an explicit router-id command; if not configured, the router will use the highest IPv4 address on a loopback or physical interface.

3.

The exam may test that OSPFv3 runs directly over IPv6 (protocol 89) and does not rely on IPv4.

4.

Be aware that OSPFv3 uses link-local addresses for neighbor adjacencies, not global unicast addresses.

Common Mistakes

Forgetting to configure a router-id, which can cause OSPFv3 to fail to establish adjacencies if no IPv4 address is present.

Using the same process ID on multiple routers thinking it must match; process IDs are locally significant and can differ between routers.

Not enabling IPv6 unicast routing globally with 'ipv6 unicast-routing' before configuring OSPFv3, causing OSPFv3 to not start.

ipv6 router ospf [pid] vs show ipv6 ospf

These commands are commonly considered together because they represent the two fundamental operations for OSPFv3: configuration (ipv6 router ospf) and verification (show ipv6 ospf). Understanding both is essential for deploying and troubleshooting IPv6 OSPF routing.

Aspectipv6 router ospf [pid]show ipv6 ospf
PurposeEnables OSPFv3 process and enters router configuration modeDisplays OSPFv3 process and interface information
ModeGlobal ConfigurationPrivileged EXEC
Effect on RouterCreates/modifies OSPFv3 routing processRead-only; no configuration change
PersistenceSaved to startup-configNot saved; output is transient
PrecedenceMust be used before OSPFv3 can operateUsed after configuration to verify
Typical UseConfiguring OSPFv3 parameters like router-id, areas, interfacesChecking OSPFv3 adjacency, LSAs, or debug state

Use ipv6 router ospf [pid] when you need to create or modify the OSPFv3 routing process, set the router ID, or enter OSPFv3 configuration mode to define area and interface settings.

Use show ipv6 ospf when you need to verify the OSPFv3 configuration, check the router ID, list active interfaces, or troubleshoot adjacency and LSA issues.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the command syntax is identical to classic IOS. However, IOS-XE supports OSPFv3 address families under the `router ospfv3` command, which is the newer configuration model. For example, `router ospfv3 100` then `address-family ipv6 unicast`.

The traditional `ipv6 router ospf` command is still available but may be deprecated in future releases. In NX-OS (Cisco Nexus switches), the equivalent command is `feature ospfv3` followed by `router ospfv3 [pid]`. NX-OS uses a different configuration hierarchy: you must first enable the OSPFv3 feature globally.

For example: `configure terminal`, `feature ospfv3`, `router ospfv3 100`, `router-id 10.0.0.1`, `interface ethernet 1/1`, `ipv6 router ospfv3 100 area 0`. Note that NX-OS uses `ipv6 router ospfv3` on the interface, not `ipv6 ospf`. In ASA (Adaptive Security Appliance), OSPFv3 is not supported; ASA only supports OSPFv2 for IPv4.

For IOS-XR, the command is `router ospfv3 [pid]` under the XR configuration mode. For example: `router ospfv3 100`, `router-id 10.0.0.1`, `interface GigabitEthernet0/0/0/0`, `ipv6 ospf area 0`. IOS-XR uses a different interface configuration syntax.

In older IOS versions (12.x), OSPFv3 was introduced in 12.4(6)T. The command behavior is consistent across 12.x, 15.x, and 16.x, but newer versions support additional features like graceful restart and BFD. Always check the specific IOS version documentation for any syntax changes.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions