This section contains payload examples to demonstrate how to use the NX-API REST API to configure OSPFv2 on the Cisco Nexus 3000 and 9000 Series switches.
Guidelines and Restrictions
OSPFv2 operational support is not available through NX-API in releases earlier than Cisco NX-OS 7.0(3)I5(1).
When configuring interface settings in a POST operation, you must always specify the desired area. If no area attribute is specified, the operation is applied to area 1.
If an interface is configured with area="0.0.0.0", the REST GET for the interface MO shows area="backbone".
Operational information objects (status and statistics) are maintained only for a single OSPF instance. When multiple OSPF instances exist, operational information is not supported.
When configuring or querying an OSPFv2 interface, do not use the ospfInternalIf managed object. Use ospfIf instead.
Note: This example was added in Release 7.0(3)I7(3).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
Note: This example was added in Release 7.0(3)I7(3).
CLI Commands
The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.
You can configure a network to OSPFv2 by associating it through the interface that the router uses to connect to that network. You can add all networks to the default backbone area (Area 0), or you can create new areas using any decimal number or an IP address.
Prerequisite: The interface eth1/9 is already configured.
CLI Commands
The CLI commands and options listed below are the equivalent to the payload example displayed in the pane on the right.
interface eth1/9 ip address 192.0.20.1/16 ip router ospf 201 area 0.0.0.15 secondaries none ip ospf cost 25 ip ospf dead-interval 50 ip ospf hello-interval 25 ip ospf mtu-ignore ip ospf passive-interface ip ospf priority 25 no ip ospf shutdown