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. Routes are commonly used for default gateway configuration, stub network reachability, floating routes for backup paths, and management traffic steering.

Diagram
NameTypeConstraintMandatoryDefault Value
ip_routesList[ip_routes]No

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
pervasiveBooleantrue, falseNo
next_hopsList[next_hops]No

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_idStringNo
addressStringNo
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