Skip to content

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
NameTypeConstraintMandatoryDefault Value
ospf_processesList[ospf_processes]No

loopbacks (nxos.devices.configuration.interfaces)

Section titled “loopbacks (nxos.devices.configuration.interfaces)”
NameTypeConstraintMandatoryDefault Value
ospfClass[ospf]No

vlans (nxos.devices.configuration.interfaces)

Section titled “vlans (nxos.devices.configuration.interfaces)”
NameTypeConstraintMandatoryDefault Value
ospfClass[ospf]No

ethernets (nxos.devices.configuration.interfaces)

Section titled “ethernets (nxos.devices.configuration.interfaces)”
NameTypeConstraintMandatoryDefault Value
ospfClass[ospf]No

port_channels (nxos.devices.configuration.interfaces)

Section titled “port_channels (nxos.devices.configuration.interfaces)”
NameTypeConstraintMandatoryDefault Value
ospfClass[ospf]No

ospf_processes (nxos.devices.configuration.routing)

Section titled “ospf_processes (nxos.devices.configuration.routing)”
NameTypeConstraintMandatoryDefault Value
nameStringYes
shutdownBooleantrue, falseNofalse
auto_cost_reference_bandwidthIntegermin: 0, max: 4294967295No
auto_cost_reference_bandwidth_unitChoicembps, gbpsNo
bfdBooleantrue, falseNo
capability_vrf_liteChoiceunspecified, l3vpn, evpnNo
default_metricIntegermin: 0, max: 16777214No
passive_interface_defaultBooleantrue, falseNo
default_route_nssa_abr_pbit_clearBooleantrue, falseNo
discard_route_externalBooleantrue, falseNo
discard_route_internalBooleantrue, falseNo
distanceIntegermin: 1, max: 255No
down_bit_ignoreBooleantrue, falseNo
log_adjacency_changesChoicenone, brief, detailNo
maximum_pathsIntegermin: 1, max: 64No
name_lookupBooleantrue, falseNo
name_lookup_use_vrfStringNo
rfc1583compatibilityBooleantrue, falseNo
router_idStringNo
max_metric_router_lsaClass[max_metric_router_lsa]No
areasList[areas]No
vrfsList[vrfs]No

ospf (nxos.devices.configuration.interfaces.loopbacks)

Section titled “ospf (nxos.devices.configuration.interfaces.loopbacks)”
NameTypeConstraintMandatoryDefault Value
processStringYes
advertise_secondariesBooleantrue, falseNotrue
advertise_subnetBooleantrue, falseNo
areaStringNo
bfdBooleantrue, falseNo
costIntegermin: 0, max: 65535No
dead_intervalIntegermin: 0, max: 65535No
hello_intervalIntegermin: 0, max: 65535No
mtu_ignoreBooleantrue, falseNo
networkChoiceunspecified, p2p, bcastNo
prefix_attribute_n_flagChoiceunspecified, clearNo
passive_interfaceBooleantrue, falseNo
priorityIntegermin: 0, max: 255No
retransmit_intervalIntegermin: 1, max: 65535No
transmit_delayIntegermin: 1, max: 450No
authentication_keyStringNo
message_digest_key_idIntegermin: 0, max: 255No
authentication_key_secure_modeBooleantrue, falseNo
authentication_key_chainStringNo
message_digest_keyStringNo
message_digest_key_secure_modeBooleantrue, falseNo
authenticationChoiceunspecified, simple, md5, noneNo

max_metric_router_lsa (nxos.devices.configuration.routing.ospf_processes)

Section titled “max_metric_router_lsa (nxos.devices.configuration.routing.ospf_processes)”
NameTypeConstraintMandatoryDefault Value
on_startup_wait_for_bgpStringNo
external_lsaBooleantrue, falseNo
external_lsa_max_metricIntegermin: 0, max: 16777215No
include_stubBooleantrue, falseNo
summary_lsaBooleantrue, falseNo
summary_lsa_max_metricIntegermin: 0, max: 16777215No
on_startupBooleantrue, falseNo
on_startup_timeoutIntegermin: 0, max: 4294967295No

areas (nxos.devices.configuration.routing.ospf_processes)

Section titled “areas (nxos.devices.configuration.routing.ospf_processes)”
NameTypeConstraintMandatoryDefault Value
idStringYes
authenticationChoiceunspecified, simple, md5, noneNo
default_costIntegermin: 0, max: 16777215No
nssa_no_redistributionBooleantrue, falseNo
no_summaryBooleantrue, falseNo
nssa_translate_type7Choicealways, candidate, neverNo
segment_routing_mplsBooleantrue, falseNo
nssa_translate_type7_suppress_faBooleantrue, falseNo
typeChoiceregular, stub, nssaNo

vrfs (nxos.devices.configuration.routing.ospf_processes)

Section titled “vrfs (nxos.devices.configuration.routing.ospf_processes)”
NameTypeConstraintMandatoryDefault Value
vrfStringYes
shutdownBooleantrue, falseNofalse
auto_cost_reference_bandwidthIntegermin: 0, max: 4294967295No
auto_cost_reference_bandwidth_unitChoicembps, gbpsNo
bfdBooleantrue, falseNo
capability_vrf_liteChoiceunspecified, l3vpn, evpnNo
default_metricIntegermin: 0, max: 16777214No
passive_interface_defaultBooleantrue, falseNo
default_route_nssa_abr_pbit_clearBooleantrue, falseNo
discard_route_externalBooleantrue, falseNo
discard_route_internalBooleantrue, falseNo
distanceIntegermin: 1, max: 255No
down_bit_ignoreBooleantrue, falseNo
log_adjacency_changesChoicenone, brief, detailNo
maximum_pathsIntegermin: 1, max: 64No
name_lookupBooleantrue, falseNo
name_lookup_use_vrfStringNo
rfc1583compatibilityBooleantrue, falseNo
router_idStringNo
max_metric_router_lsaClass[max_metric_router_lsa]No
areasList[areas]No

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: p2p

Example 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: 12

Example 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: true

Example 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