This tech note outlines the main differences in Open Shortest Path First Version 2 (OSPFv2) support between Cisco NX-OS Software and Cisco IOS Software. Sample configurations are included for Cisco NX-OS and Cisco IOS Software for some common features to demonstrate the similarities and differences. Please refer to the NX-OS documentation on Cisco.com for a complete list of supported features.
OSPFv2 is an IETF (RFC 2328) standards-based dynamic link-state routing protocol used to exchange network reachability within an autonomous system.
In Cisco NX-OS:
· The OSPF feature supports stateful process restarts and In-Service-Software-Upgrades (ISSU) if two supervisors are present in a chassis.
· OSPF command-line interface (CLI) configuration and verification commands are not available until you enable the OSPF feature with the feature ospf command.
· The OSPF protocol requires the Enterprise Services license.
· The OSPF instance can consists of 20 characters, whereas the IOS supports numbers 1 to 65536.
· Eight equal-cost paths are supported by default. You can configure up to sixteen.
· The default reference bandwidth used in the OSPF cost calculation is 40 Gbps.
· Networks and interfaces are added to an OSPF instance under the interface configuration mode.
· An OSPF area can be configured using decimal or decimal dotted notation, but it is always displayed in decimal dotted notation in the configuration and in the show command output.
· Passive interfaces are applied to the interface as opposed to under the OSPF router instance. Loopback interface is considered to be passive by default.
· If a router ID is not manually configured, the loopback 0 IP address is always preferred. If loopback 0 does not exist, Cisco NX-OS selects the IP address for the first loopback interface in the configuration. If no loopback interfaces exist, Cisco NX-OS selects the IP address for the first physical interface in the configuration.
· Neighbor adjacency changes are not logged by default. The log-adjacency-changes CLI command is required under the OSPF instance.
· When interface authentication is configured, the OSPF key is encrypted with Data Encryption Standard 3 (3DES) in the configuration. Cisco IOS Software requires the service password command.
· The NX-OS does not support distribute-lists used to remove OSPF routes from the routing table. The NX-OS does support inter-area Type-3 LSA/route filtering using the filter-list command configured under the OSPF routing instance.
· A route-map is always required when redistributing routes into an OSPF instance. In Cisco IOS Software, a route-map is optional.
· Route redistribution advertises classless and classful networks by default (no subnets option). Cisco IOS Software requires the subnets option to redistribute classless networks.
· A VRF instance is configured under an OSPF instance (Numerous VRF instances can be associated to a single OSPF instance). In Cisco IOS Software, a VRF instance is associated to a single OSPF process in a one-to-one relationship.
· When a NX-OS device runs two independent OSPF processes, the prefix metric is learnt as different types in both the processes. The lower metric (among the two different types) is installed into the routing table. This may result in a OSPF prefix with a non-best type getting installed into RIB. Also, if metrics for both processes are equal both of them will be installed into RIB. This can lead to unexpected load-balancing situation. The work around for this issue is to tune the metrics so that the external prefixes would always have higher metric than the internal prefix.
The following list provides some additional facts about Cisco NX-OS that should be helpful when designing, configuring, and maintaining an OSPF network.
· Four OSPF instances can be configured per virtual device context (VDC).
· If you remove the feature ospf command, all relevant OSPF configuration information is also removed.
· The shutdown command under the OSPF process can be used to disable OSPF while retaining the configuration. Similar functionality can also be applied per interface with the ip ospf shutdown command.
· The show running-config ospf command displays the current OSPF configuration.
· An OSPF instance can be restarted with the restart ospf <instance> Exec command.
· Graceful Restart (RFC 3623) is enabled by default.
· You cannot configure multiple OSPF instances on the same interface.
· An interface can support multi-area adjacencies using the multi-area option with the ip router ospf interface command.
· Secondary IP addresses are advertised by default, but can be suppressed per interface with the ip router ospf <instance> area <#> secondaries none interface command.
· By default, all loopback IP address subnet masks are advertised in an LSA as a /32. The loopback interface command ip ospf advertise-subnet can be configured to advertise the primary IP address subnet mask. (This command does not apply to secondary IP addresses. They will still be advertised as a /32.)
· OSPF supports Bidirectional Forwarding Detection (BFD), which can be configured to reduce network convergence time to less than 1 second.
· When you rollover an OSPF authentication key in a combined Cisco NX-OS/Cisco IOS network, you should configure both keys on the Cisco NX-OS router to ensure that there is sufficient overlap between the old key and the new key for a smooth transition to the new key. You should configure the new key as a valid accept key on all the NX-OS and IOS routers before the new key becomes a valid generation key in the keychain. During the overlap period, Cisco NX-OS transmits the new OSPF key and accepts OSPF authenticated packets from both the old key and the new key.
· Maximum prefix thresholds (warning and withdraw) can be configured for redistributed routes using the redistribute maximum-prefix routing instance command.
The following sample code shows configuration similarities and differences between the Cisco NX-OS and Cisco IOS Software CLIs. There are two significant differences: Cisco NX-OS allows OSPF to be enabled and disabled globally, and it has a more interface-centric configuration that makes it easier to read.
Cisco IOS CLI | Cisco NX-OS CLI |
Enabling the OSPF Feature | |
Cisco IOS Software does not have the ability to enable or disable OSPF. | feature ospf |
Configuring an OSPF Instance and Router ID | |
router ospf 10 router-id 192.168.1.1 | router ospf 10 router-id 192.168.1.1 |
Associating a Network with an OSPF Instance and Area | |
router ospf 10 network 192.168.1.0 0.0.0.255 area 1 | interface Ethernet2/1 ip address 192.168.10.1/24 ip router ospf 10 area 1 |
Configuring a Passive Interface | |
router ospf 10 passive-interface GigabitEthernet2/1 network 192.168.1.0 0.0.0.255 area 1 | interface Ethernet2/1 ip address 192.168.11.1/24 ip ospf passive-interface ip router ospf 10 area 0 |
Configuring Interface Authentication (MD5) | |
interface GigabitEthernet2/1 ip address 192.168.10.1 255.255.255.0 ip ospf authentication message-digest ip ospf message-digest-key 1 md5 cisco123 | interface Ethernet2/1 ip address 192.168.10.1/24 ip ospf authentication message-digest ip ospf message-digest-key 1 md5 3 a667d47acc18ea6b ip router ospf 10 area 1 |
Configuring a Stub Area with the no summary Option | |
router ospf 10 area 2 stub no-summary | router ospf 10 area 2 stub no-summary |
Creating a Not-So-Stubby Area (NSSA) and Generating a Default Route | |
router ospf 10 area 3 nssa default-information-originate | router ospf 10 area 3 nssa default-information-originate |
Configuring Inter-Area and External Summarization | |
router ospf 10 area 0 range 159.142.0.0 255.255.0.0 summary-address 172.16.0.0 255.255.0.0 | router ospf 10 area 0 range 159.142.0.0/16 summary-address 172.16.0.0/16
|
Generating a Default Route (Conditional) | |
router ospf 10 default-information originate | router ospf 10 default-information originate |
Generating a Maximum Metric (Max-Metric) Value | |
router ospf 10 max-metric router-lsa | router ospf 10 max-metric router-lsa |
Configuring Route Redistribution (Permit all Static Routes) | |
router ospf 10 redistribute static subnets | router ospf 10 redistribute static route-map static-to-ospf route-map static-to-ospf permit 10 |
Configuring a VRF Instance for OSPF Routing | |
router ospf 10 vrf customer-a | router ospf 10 vrf customer-a |
The following table compares some useful show commands for verifying and troubleshooting an OSPFv2 network configuration.
Cisco NX-OS OSPFv2 | Cisco IOS Software OSPFv2 | Command Description |
show ip ospf | show ip ospf | Displays information for all OSPF instances. |
show ip ospf <instance> | show ip ospf <#> | Displays information for a specific OSPF instance. |
show ip ospf border-routers | show ip ospf border-routers | Displays a list of border routers. |
show ip ospf database | show ip ospf database | Displays OSPF database information. |
show ip ospf interface | show ip ospf interface | Displays all OSPF enabled interfaces and associated status information. |
show ip ospf interface brief | show ip ospf interface brief | Displays a brief list and status of OSPF enabled interfaces. |
show ip ospf interface detail | - | Displays additional packet statistics for each interface. |
show ip ospf lsa-content-changed-list | - | Displays the LSA's that changed content. |
show ip ospf memory | - | Displays the memory allocated for OSPF. |
show ip ospf neighbors | show ip ospf neighbor | Displays neighbor-specific information. |
show ip ospf neighbors detail | show ip ospf neighbor detail | Displays details for each OSPF neighbor. |
show ip ospf neighbors summary | - | Displays summary information and packet statistics for each OSPF neighbor. |
show ip ospf policy statistics | - | Displays redistribution statistics for a specified protocol. |
show ip ospf request-list | show ip ospf request-list | Displays a list of link-state advertisements (LSAs) that have been requested. |
show ip ospf retransmission-list | show ip ospf retransmission-list | Displays a list of the link-state retransmission list. |
show ip ospf route | - | Displays all routes learned through OSPF. |
show ip ospf statistics | show ip ospf statistics | Displays OSPF LSA statistics. |
show ip ospf summary-address | show ip ospf summary-address | Displays OSPF summarized networks. |
show ip ospf traffic | show ip ospf traffic | Displays OSPF related packet counters. |
show ip ospf virtual-links | show ip ospf virtual-links | Displays OSPF virtual links. |
show ip ospf vrf | - | Displays information for a specified OSPF VRF instance. |