IP Static Route
IP static 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 static 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 routes are commonly used for default gateway configuration, stub network reachability, floating static routes for backup paths, and management traffic steering.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”routing (nxos.devices.configuration)
Section titled “routing (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| ip_static_routes | List | [ip_static_routes] | No |
ip_static_routes (nxos.devices.configuration.routing)
Section titled “ip_static_routes (nxos.devices.configuration.routing)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| vrf | String | No | ||
| prefix | String | Yes | ||
| preference | Integer | min: 1, max: 255 | No | |
| tag | Integer | min: 0, max: 4294967295 | No | |
| bfd | Boolean | true, false | No | |
| pervasive | Boolean | true, false | No | |
| next_hops | List | [next_hops] | No |
next_hops (nxos.devices.configuration.routing.ip_static_routes)
Section titled “next_hops (nxos.devices.configuration.routing.ip_static_routes)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| interface_type | Choice | ethernet, loopback, mgmt, port-channel, vlan, vni | No | |
| interface_id | String | No | ||
| address | String | No | ||
| vrf | String | No | ||
| track | Integer | min: 0, max: 4294967295 | No | |
| preference | Integer | min: 0, max: 255 | No | |
| tag | Integer | min: 0, max: 4294967295 | No | |
| name | String | No |
Examples
Section titled “Examples”Example 1: Default route for out-of-band management traffic in the management VRF
nxos: devices: - name: LEAF1 configuration: routing: ip_static_routes: - vrf: management prefix: 0.0.0.0/0 next_hops: - address: 10.50.202.1 name: MGMT-GWExample 2: Multiple static routes — management VRF default, infrastructure monitoring, and a floating backup route
nxos: devices: - name: SPINE1 configuration: routing: ip_static_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 static 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: 100Example 3: VRF-aware static routes for tenant VRFs with ECMP next hops and object tracking
nxos: devices: - name: BORDER-LEAF1 configuration: routing: ip_static_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 static route in default VRF - prefix: 10.1.50.0/24 next_hops: - interface_type: mgmt interface_id: "0" address: 10.50.202.1