OSPF
OSPF (Open Shortest Path First) is a standards-based link-state interior gateway protocol that uses Dijkstra’s shortest path first algorithm to calculate optimal routes within an autonomous system, supporting VRF-aware multi-instance deployments on NX-OS. It provides hierarchical network design through area-based segmentation with configurable area types (stub, NSSA), route summarization, max-metric advertisement for graceful maintenance, and advanced features like BFD integration for fast failure detection. OSPF interface-level configuration controls process association, area membership, cost, network type, priority, authentication, and passive interface behavior across loopback, VLAN, Ethernet, and port-channel interfaces.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”routing (nxos.devices.configuration)
Section titled “routing (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf_processes | List | [ospf_processes] | No |
loopbacks (nxos.devices.configuration.interfaces)
Section titled “loopbacks (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf | Class | [ospf] | No |
vlans (nxos.devices.configuration.interfaces)
Section titled “vlans (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf | Class | [ospf] | No |
ethernets (nxos.devices.configuration.interfaces)
Section titled “ethernets (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf | Class | [ospf] | No |
port_channels (nxos.devices.configuration.interfaces)
Section titled “port_channels (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf | Class | [ospf] | No |
ospf_processes (nxos.devices.configuration.routing)
Section titled “ospf_processes (nxos.devices.configuration.routing)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes | ||
| shutdown | Boolean | true, false | No | |
| auto_cost_reference_bandwidth | Integer | min: 0, max: 4294967295 | No | |
| auto_cost_reference_bandwidth_unit | Choice | mbps, gbps | No | |
| bfd | Boolean | true, false | No | |
| capability_vrf_lite | Choice | unspecified, l3vpn, evpn | No | |
| default_metric | Integer | min: 0, max: 16777214 | No | |
| passive_interface_default | Boolean | true, false | No | |
| default_route_nssa_abr_pbit_clear | Boolean | true, false | No | |
| discard_route_external | Boolean | true, false | No | |
| discard_route_internal | Boolean | true, false | No | |
| distance | Integer | min: 1, max: 255 | No | |
| down_bit_ignore | Boolean | true, false | No | |
| log_adjacency_changes | Choice | none, brief, detail | No | |
| maximum_paths | Integer | min: 1, max: 64 | No | |
| name_lookup | Boolean | true, false | No | |
| name_lookup_use_vrf | String | No | ||
| rfc1583compatibility | Boolean | true, false | No | |
| router_id | String | No | ||
| max_metric_router_lsa | Class | [max_metric_router_lsa] | No | |
| areas | List | [areas] | No | |
| redistributions | List | [redistributions] | No | |
| vrfs | List | [vrfs] | No |
ospf (nxos.devices.configuration.interfaces.loopbacks)
Section titled “ospf (nxos.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| process | String | Yes | ||
| advertise_secondaries | Boolean | true, false | No | |
| advertise_subnet | Boolean | true, false | No | |
| area | String | No | ||
| bfd | Boolean | true, false | No | |
| cost | Integer | min: 0, max: 65535 | No | |
| dead_interval | Integer | min: 0, max: 65535 | No | |
| hello_interval | Integer | min: 0, max: 65535 | No | |
| mtu_ignore | Boolean | true, false | No | |
| network | Choice | unspecified, p2p, bcast | No | |
| prefix_attribute_n_flag | Choice | unspecified, clear | No | |
| passive_interface | Boolean | true, false | No | |
| priority | Integer | min: 0, max: 255 | No | |
| retransmit_interval | Integer | min: 1, max: 65535 | No | |
| transmit_delay | Integer | min: 1, max: 450 | No | |
| authentication_key | String | No | ||
| message_digest_key_id | Integer | min: 0, max: 255 | No | |
| authentication_key_secure_mode | Boolean | true, false | No | |
| authentication_key_chain | String | No | ||
| message_digest_key | String | No | ||
| message_digest_key_secure_mode | Boolean | true, false | No | |
| authentication | Choice | unspecified, simple, md5, none | No |
max_metric_router_lsa (nxos.devices.configuration.routing.ospf_processes)
Section titled “max_metric_router_lsa (nxos.devices.configuration.routing.ospf_processes)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| on_startup_wait_for_bgp | String | No | ||
| external_lsa | Boolean | true, false | No | |
| external_lsa_max_metric | Integer | min: 0, max: 16777215 | No | |
| include_stub | Boolean | true, false | No | |
| summary_lsa | Boolean | true, false | No | |
| summary_lsa_max_metric | Integer | min: 0, max: 16777215 | No | |
| on_startup | Boolean | true, false | No | |
| on_startup_timeout | Integer | min: 0, max: 4294967295 | No |
areas (nxos.devices.configuration.routing.ospf_processes)
Section titled “areas (nxos.devices.configuration.routing.ospf_processes)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | String | Yes | ||
| authentication | Choice | unspecified, simple, md5, none | No | |
| default_cost | Integer | min: 0, max: 16777215 | No | |
| nssa_no_redistribution | Boolean | true, false | No | |
| no_summary | Boolean | true, false | No | |
| nssa_translate_type7 | Choice | always, candidate, never | No | |
| segment_routing_mpls | Boolean | true, false | No | |
| nssa_translate_type7_suppress_fa | Boolean | true, false | No | |
| type | Choice | regular, stub, nssa | No |
redistributions (nxos.devices.configuration.routing.ospf_processes)
Section titled “redistributions (nxos.devices.configuration.routing.ospf_processes)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| protocol | Choice | static, direct, bgp, isis, ospf, ospfv3, eigrp, host, rip, amt, lisp, hmm, am, dhcpv6, icmpv6 | Yes | |
| protocol_instance | String | No | ||
| asn | String | No | ||
| route_map | String | No |
vrfs (nxos.devices.configuration.routing.ospf_processes)
Section titled “vrfs (nxos.devices.configuration.routing.ospf_processes)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| vrf | String | Yes | ||
| shutdown | Boolean | true, false | No | |
| auto_cost_reference_bandwidth | Integer | min: 0, max: 4294967295 | No | |
| auto_cost_reference_bandwidth_unit | Choice | mbps, gbps | No | |
| bfd | Boolean | true, false | No | |
| capability_vrf_lite | Choice | unspecified, l3vpn, evpn | No | |
| default_metric | Integer | min: 0, max: 16777214 | No | |
| passive_interface_default | Boolean | true, false | No | |
| default_route_nssa_abr_pbit_clear | Boolean | true, false | No | |
| discard_route_external | Boolean | true, false | No | |
| discard_route_internal | Boolean | true, false | No | |
| distance | Integer | min: 1, max: 255 | No | |
| down_bit_ignore | Boolean | true, false | No | |
| log_adjacency_changes | Choice | none, brief, detail | No | |
| maximum_paths | Integer | min: 1, max: 64 | No | |
| name_lookup | Boolean | true, false | No | |
| name_lookup_use_vrf | String | No | ||
| rfc1583compatibility | Boolean | true, false | No | |
| router_id | String | No | ||
| max_metric_router_lsa | Class | [max_metric_router_lsa] | No | |
| areas | List | [areas] | No | |
| redistributions | List | [redistributions] | No |
Examples
Section titled “Examples”Example 1: Basic OSPF underlay for spine-leaf fabric with loopback and P2P links
nxos: devices: - name: LEAF1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.3 areas: - id: 0.0.0.0 interfaces: loopbacks: - id: 0 ospf: process: "1" area: 0.0.0.0 - id: 1 ospf: process: "1" area: 0.0.0.0 ethernets: - id: 1/1 ospf: process: "1" area: 0.0.0.0 network: p2p - id: 1/2 ospf: process: "1" area: 0.0.0.0 network: p2pExample 2: OSPF with BFD, tuned timers, and passive interfaces
nxos: devices: - name: SPINE1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.1 bfd: true log_adjacency_changes: detail areas: - id: 0.0.0.0 interfaces: loopbacks: - id: 0 ospf: process: "1" area: 0.0.0.0 - id: 100 ospf: process: "1" area: 0.0.0.0 ethernets: - id: 1/1 ospf: process: "1" area: 0.0.0.0 network: p2p hello_interval: 3 dead_interval: 12 - id: 1/2 ospf: process: "1" area: 0.0.0.0 network: p2p hello_interval: 3 dead_interval: 12Example 3: Multi-area OSPF with stub area and max-metric for maintenance
nxos: devices: - name: BORDER-LEAF1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.3 log_adjacency_changes: brief maximum_paths: 8 rfc1583compatibility: false max_metric_router_lsa: on_startup: true on_startup_timeout: 600 external_lsa: true summary_lsa: true areas: - id: 0.0.0.0 - id: 0.0.0.10 type: stub default_cost: 10 no_summary: trueExample 4: OSPF in a VRF with passive-interface default and interface overrides
nxos: devices: - name: LEAF1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.3 areas: - id: 0.0.0.0 - name: "100" vrfs: - vrf: BLUE router_id: 10.1.100.3 passive_interface_default: true auto_cost_reference_bandwidth: 100 auto_cost_reference_bandwidth_unit: gbps areas: - id: 0.0.0.0 interfaces: vlans: - id: 1010 vrf: BLUE ospf: process: "100" area: 0.0.0.0 passive_interface: disabledExample 5: OSPF with route redistribution
nxos: devices: - name: BORDER1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.5 areas: - id: 0.0.0.0 redistributions: - protocol: static route_map: STATIC_TO_OSPF - protocol: direct route_map: DIRECT_TO_OSPF - protocol: bgp asn: "65000" route_map: BGP_TO_OSPFExample 6: OSPF in VRF with redistributions
nxos: devices: - name: LEAF1 configuration: routing: ospf_processes: - name: "100" vrfs: - vrf: TENANT_A router_id: 10.1.100.3 areas: - id: 0.0.0.0 redistributions: - protocol: direct route_map: DIRECT_TO_OSPF - protocol: bgp asn: "65001" route_map: BGP_TO_OSPF_VRFOSPF (Open Shortest Path First) is a standards-based link-state interior gateway protocol that uses Dijkstra’s shortest path first algorithm to calculate optimal routes within an autonomous system, supporting VRF-aware multi-instance deployments on NX-OS. It provides hierarchical network design through area-based segmentation with configurable area types (stub, NSSA), route summarization, max-metric advertisement for graceful maintenance, and advanced features like BFD integration for fast failure detection. OSPF interface-level configuration controls process association, area membership, cost, network type, priority, authentication, and passive interface behavior across loopback, VLAN, Ethernet, and port-channel interfaces.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”routing (nxos.devices.configuration)
Section titled “routing (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf_processes | List | [ospf_processes] | No |
loopbacks (nxos.devices.configuration.interfaces)
Section titled “loopbacks (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf | Class | [ospf] | No |
vlans (nxos.devices.configuration.interfaces)
Section titled “vlans (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf | Class | [ospf] | No |
ethernets (nxos.devices.configuration.interfaces)
Section titled “ethernets (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf | Class | [ospf] | No |
port_channels (nxos.devices.configuration.interfaces)
Section titled “port_channels (nxos.devices.configuration.interfaces)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ospf | Class | [ospf] | No |
ospf_processes (nxos.devices.configuration.routing)
Section titled “ospf_processes (nxos.devices.configuration.routing)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes | ||
| shutdown | Boolean | true, false | No | |
| auto_cost_reference_bandwidth | Integer | min: 0, max: 4294967295 | No | |
| auto_cost_reference_bandwidth_unit | Choice | mbps, gbps | No | |
| bfd | Boolean | true, false | No | |
| capability_vrf_lite | Choice | unspecified, l3vpn, evpn | No | |
| default_metric | Integer | min: 0, max: 16777214 | No | |
| passive_interface_default | Boolean | true, false | No | |
| default_route_nssa_abr_pbit_clear | Boolean | true, false | No | |
| discard_route_external | Boolean | true, false | No | |
| discard_route_internal | Boolean | true, false | No | |
| distance | Integer | min: 1, max: 255 | No | |
| down_bit_ignore | Boolean | true, false | No | |
| log_adjacency_changes | Choice | none, brief, detail | No | |
| maximum_paths | Integer | min: 1, max: 64 | No | |
| name_lookup | Boolean | true, false | No | |
| name_lookup_use_vrf | String | No | ||
| rfc1583compatibility | Boolean | true, false | No | |
| router_id | String | No | ||
| max_metric_router_lsa | Class | [max_metric_router_lsa] | No | |
| areas | List | [areas] | No | |
| vrfs | List | [vrfs] | No |
ospf (nxos.devices.configuration.interfaces.loopbacks)
Section titled “ospf (nxos.devices.configuration.interfaces.loopbacks)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| process | String | Yes | ||
| advertise_secondaries | Boolean | true, false | No | |
| advertise_subnet | Boolean | true, false | No | |
| area | String | No | ||
| bfd | Boolean | true, false | No | |
| cost | Integer | min: 0, max: 65535 | No | |
| dead_interval | Integer | min: 0, max: 65535 | No | |
| hello_interval | Integer | min: 0, max: 65535 | No | |
| mtu_ignore | Boolean | true, false | No | |
| network | Choice | unspecified, p2p, bcast | No | |
| prefix_attribute_n_flag | Choice | unspecified, clear | No | |
| passive_interface | Boolean | true, false | No | |
| priority | Integer | min: 0, max: 255 | No | |
| retransmit_interval | Integer | min: 1, max: 65535 | No | |
| transmit_delay | Integer | min: 1, max: 450 | No | |
| authentication_key | String | No | ||
| message_digest_key_id | Integer | min: 0, max: 255 | No | |
| authentication_key_secure_mode | Boolean | true, false | No | |
| authentication_key_chain | String | No | ||
| message_digest_key | String | No | ||
| message_digest_key_secure_mode | Boolean | true, false | No | |
| authentication | Choice | unspecified, simple, md5, none | No |
max_metric_router_lsa (nxos.devices.configuration.routing.ospf_processes)
Section titled “max_metric_router_lsa (nxos.devices.configuration.routing.ospf_processes)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| on_startup_wait_for_bgp | String | No | ||
| external_lsa | Boolean | true, false | No | |
| external_lsa_max_metric | Integer | min: 0, max: 16777215 | No | |
| include_stub | Boolean | true, false | No | |
| summary_lsa | Boolean | true, false | No | |
| summary_lsa_max_metric | Integer | min: 0, max: 16777215 | No | |
| on_startup | Boolean | true, false | No | |
| on_startup_timeout | Integer | min: 0, max: 4294967295 | No |
areas (nxos.devices.configuration.routing.ospf_processes)
Section titled “areas (nxos.devices.configuration.routing.ospf_processes)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| id | String | Yes | ||
| authentication | Choice | unspecified, simple, md5, none | No | |
| default_cost | Integer | min: 0, max: 16777215 | No | |
| nssa_no_redistribution | Boolean | true, false | No | |
| no_summary | Boolean | true, false | No | |
| nssa_translate_type7 | Choice | always, candidate, never | No | |
| segment_routing_mpls | Boolean | true, false | No | |
| nssa_translate_type7_suppress_fa | Boolean | true, false | No | |
| type | Choice | regular, stub, nssa | No |
vrfs (nxos.devices.configuration.routing.ospf_processes)
Section titled “vrfs (nxos.devices.configuration.routing.ospf_processes)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| vrf | String | Yes | ||
| shutdown | Boolean | true, false | No | |
| auto_cost_reference_bandwidth | Integer | min: 0, max: 4294967295 | No | |
| auto_cost_reference_bandwidth_unit | Choice | mbps, gbps | No | |
| bfd | Boolean | true, false | No | |
| capability_vrf_lite | Choice | unspecified, l3vpn, evpn | No | |
| default_metric | Integer | min: 0, max: 16777214 | No | |
| passive_interface_default | Boolean | true, false | No | |
| default_route_nssa_abr_pbit_clear | Boolean | true, false | No | |
| discard_route_external | Boolean | true, false | No | |
| discard_route_internal | Boolean | true, false | No | |
| distance | Integer | min: 1, max: 255 | No | |
| down_bit_ignore | Boolean | true, false | No | |
| log_adjacency_changes | Choice | none, brief, detail | No | |
| maximum_paths | Integer | min: 1, max: 64 | No | |
| name_lookup | Boolean | true, false | No | |
| name_lookup_use_vrf | String | No | ||
| rfc1583compatibility | Boolean | true, false | No | |
| router_id | String | No | ||
| max_metric_router_lsa | Class | [max_metric_router_lsa] | No | |
| areas | List | [areas] | No |
Examples
Section titled “Examples”Example 1: Basic OSPF underlay for spine-leaf fabric with loopback and P2P links
nxos: devices: - name: LEAF1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.3 areas: - id: 0.0.0.0 interfaces: loopbacks: - id: 0 ospf: process: "1" area: 0.0.0.0 - id: 1 ospf: process: "1" area: 0.0.0.0 ethernets: - id: 1/1 ospf: process: "1" area: 0.0.0.0 network: p2p - id: 1/2 ospf: process: "1" area: 0.0.0.0 network: p2pExample 2: OSPF with BFD, tuned timers, and passive interfaces
nxos: devices: - name: SPINE1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.1 bfd: true log_adjacency_changes: detail areas: - id: 0.0.0.0 interfaces: loopbacks: - id: 0 ospf: process: "1" area: 0.0.0.0 - id: 100 ospf: process: "1" area: 0.0.0.0 ethernets: - id: 1/1 ospf: process: "1" area: 0.0.0.0 network: p2p hello_interval: 3 dead_interval: 12 - id: 1/2 ospf: process: "1" area: 0.0.0.0 network: p2p hello_interval: 3 dead_interval: 12Example 3: Multi-area OSPF with stub area and max-metric for maintenance
nxos: devices: - name: BORDER-LEAF1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.3 log_adjacency_changes: brief maximum_paths: 8 rfc1583compatibility: false max_metric_router_lsa: on_startup: true on_startup_timeout: 600 external_lsa: true summary_lsa: true areas: - id: 0.0.0.0 - id: 0.0.0.10 type: stub default_cost: 10 no_summary: trueExample 4: OSPF in a VRF with passive-interface default and interface overrides
nxos: devices: - name: LEAF1 configuration: routing: ospf_processes: - name: "1" router_id: 10.1.100.3 areas: - id: 0.0.0.0 - name: "100" vrfs: - vrf: BLUE router_id: 10.1.100.3 passive_interface_default: true auto_cost_reference_bandwidth: 100 auto_cost_reference_bandwidth_unit: gbps areas: - id: 0.0.0.0 interfaces: vlans: - id: 1010 vrf: BLUE ospf: process: "100" area: 0.0.0.0 passive_interface: disabled