Skip to content

IP Route

IP routes provide manually configured routing entries that define explicit forwarding paths for specific destination prefixes, supporting VRF-aware deployments on NX-OS for both default and non-default routing instances. Each route can specify one or more next-hop addresses with configurable preferences, tags, route names, and object tracking for conditional route installation based on reachability. Static route BFD sessions (ip route static bfd) are configured per VRF under ip_route_static_bfds and track next-hop reachability through a pinned interface. Routes are commonly used for default gateway configuration, stub network reachability, floating routes for backup paths, and management traffic steering.

IP routes provide manually configured routing entries that define explicit forwarding paths for specific destination prefixes, supporting VRF-aware deployments on NX-OS for both default and non-default routing instances. Each route can specify one or more next-hop addresses with configurable preferences, tags, route names, and object tracking for conditional route installation based on reachability. Routes are commonly used for default gateway configuration, stub network reachability, floating routes for backup paths, and management traffic steering.

NameTypeConstraintMandatoryDefault Value
devicesListdevicesNo
device_groupsListdevice_groupsNo
globalClassglobalNo
templatesListtemplatesNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
routingClassroutingNo

NameTypeConstraintMandatoryDefault Value
ip_routesListip_routesNo
ip_route_static_bfdsListip_route_static_bfdsNo

NameTypeConstraintMandatoryDefault Value
ip_routesListip_routesNo

ip_routes (nxos.devices.configuration.routing)

Section titled “ip_routes (nxos.devices.configuration.routing)”
NameTypeConstraintMandatoryDefault Value
vrfStringNo
prefixIPYes
preferenceIntegermin: 1, max: 255No
tagIntegermin: 0, max: 4294967295No
bfdBooleantrue, falseNo
next_hopsListnext_hopsNo

ip_routes (nxos.devices.configuration.routing)

Section titled “ip_routes (nxos.devices.configuration.routing)”
NameTypeConstraintMandatoryDefault Value
vrfStringNo
prefixStringYes
preferenceIntegermin: 1, max: 255No
tagIntegermin: 0, max: 4294967295No
bfdBooleantrue, falseNo
next_hopsListnext_hopsNo

ip_route_static_bfds (nxos.devices.configuration.routing)

Section titled “ip_route_static_bfds (nxos.devices.configuration.routing)”
NameTypeConstraintMandatoryDefault Value
vrfStringNo
interface_typeChoiceethernet, loopback, mgmt, port-channel, vlan, vniYes
interface_idAnyString or Integer[min: 0]Yes
next_hopIPYes

next_hops (nxos.devices.configuration.routing.ip_routes)

Section titled “next_hops (nxos.devices.configuration.routing.ip_routes)”
NameTypeConstraintMandatoryDefault Value
interface_typeChoiceethernet, loopback, mgmt, port-channel, vlan, vniNo
interface_idAnyString or Integer[min: 0]No
addressIPNo
vrfStringNo
trackIntegermin: 0, max: 4294967295No
preferenceIntegermin: 0, max: 255No
tagIntegermin: 0, max: 4294967295No
nameStringNo

Example 1: Default route for out-of-band management traffic in the management VRF

nxos:
devices:
- name: LEAF1
configuration:
routing:
ip_routes:
- vrf: management
prefix: 0.0.0.0/0
next_hops:
- address: 10.50.202.1
name: MGMT-GW

Example 2: Multiple routes — management VRF default, infrastructure monitoring, and a floating backup route

nxos:
devices:
- name: SPINE1
configuration:
routing:
ip_routes:
# Management VRF default route
- vrf: management
prefix: 0.0.0.0/0
next_hops:
- address: 10.50.202.1
name: MGMT-DEFAULT-GW
# Route to NTP/Syslog servers via management
- vrf: management
prefix: 10.50.100.0/24
next_hops:
- address: 10.50.202.1
name: TO-INFRA-SERVICES
# Floating route as backup (higher preference = less preferred)
- prefix: 10.1.100.0/24
next_hops:
- address: 10.1.10.1
preference: 10
name: BACKUP-VIA-LEAF1
tag: 100

Example 3: VRF-aware routes for tenant VRFs with ECMP next hops and object tracking

nxos:
devices:
- name: BORDER-LEAF1
configuration:
routing:
ip_routes:
# Tenant VRF BLUE — default route with ECMP to firewalls
- vrf: BLUE
prefix: 0.0.0.0/0
tag: 1000
next_hops:
- address: 192.168.1.1
name: FW-PRIMARY
track: 1
- address: 192.168.1.2
name: FW-SECONDARY
preference: 5
track: 2
# Tenant VRF GREEN — route to shared services
- vrf: GREEN
prefix: 10.50.100.0/24
next_hops:
- address: 172.17.1.1
name: TO-SHARED-SVC
# VPC keepalive route in default VRF
- prefix: 10.1.50.0/24
next_hops:
- interface_type: mgmt
interface_id: "0"
address: 10.50.202.1

Example 4: Static route with BFD and the static BFD session for its next hop

nxos:
devices:
- name: BORDER-LEAF1
configuration:
feature:
bfd: true
routing:
ip_routes:
- vrf: BLUE
prefix: 10.200.0.0/16
bfd: true
next_hops:
- address: 192.168.10.2
ip_route_static_bfds:
- vrf: BLUE
interface_type: ethernet
interface_id: 1/10
next_hop: 192.168.10.2

Example 1: Default route for out-of-band management traffic in the management VRF

nxos:
devices:
- name: LEAF1
configuration:
routing:
ip_routes:
- vrf: management
prefix: 0.0.0.0/0
next_hops:
- address: 10.50.202.1
name: MGMT-GW

Example 2: Multiple routes — management VRF default, infrastructure monitoring, and a floating backup route

nxos:
devices:
- name: SPINE1
configuration:
routing:
ip_routes:
# Management VRF default route
- vrf: management
prefix: 0.0.0.0/0
next_hops:
- address: 10.50.202.1
name: MGMT-DEFAULT-GW
# Route to NTP/Syslog servers via management
- vrf: management
prefix: 10.50.100.0/24
next_hops:
- address: 10.50.202.1
name: TO-INFRA-SERVICES
# Floating route as backup (higher preference = less preferred)
- prefix: 10.1.100.0/24
next_hops:
- address: 10.1.10.1
preference: 10
name: BACKUP-VIA-LEAF1
tag: 100

Example 3: VRF-aware routes for tenant VRFs with ECMP next hops and object tracking

nxos:
devices:
- name: BORDER-LEAF1
configuration:
routing:
ip_routes:
# Tenant VRF BLUE — default route with ECMP to firewalls
- vrf: BLUE
prefix: 0.0.0.0/0
tag: 1000
next_hops:
- address: 192.168.1.1
name: FW-PRIMARY
track: 1
- address: 192.168.1.2
name: FW-SECONDARY
preference: 5
track: 2
# Tenant VRF GREEN — route to shared services
- vrf: GREEN
prefix: 10.50.100.0/24
next_hops:
- address: 172.17.1.1
name: TO-SHARED-SVC
# VPC keepalive route in default VRF
- prefix: 10.1.50.0/24
next_hops:
- interface_type: mgmt
interface_id: "0"
address: 10.50.202.1