CISCO Nexus 9000 Series Configuring Static Routing User Guide
- June 15, 2024
- Cisco
Table of Contents
- CISCO Nexus 9000 Series Configuring Static Routing
- Product Information
- FAQ
- About Static Routing
- Administrative Distance
- Directly Connected Static Routes
- Fully Specified Static Routes
- Floating Static Routes
- Remote Next Hops for Static Routes
- Licensing Requirements for Static Routing
- Prerequisites for Static Routing
- Default Settings
- Configuring Static Routing
- Configuring a Static Route
- Configuring a Static Route over a VLAN
- Configuring Virtualization
- Verifying the Static Routing Configuration
- Configuration Example for Static Routing
- Read User Manual Online (PDF format)
- Download This Manual (PDF format)
CISCO Nexus 9000 Series Configuring Static Routing
Product Information
Specifications
- Product: Cisco Nexus 9000 Series NX-OS
- Release: 6.x
About Static Routing
Static routing is a feature provided by the Cisco Nexus 9000 Series NX-OS that allows the configuration of static routes in the network. Static routes are manually configured routes that do not change based on network conditions.
Administrative Distance
The administrative distance is a measure of the trustworthiness of a routing information source. In static routing, the administrative distance is used to determine which route is preferred when multiple routes exist for the same destination. By default, a static route has a smaller administrative distance than a dynamic route, making it preferred.
Directly Connected Static Routes
In a directly connected static route, you only need to specify the output interface through which packets are sent to the destination network. The router assumes that the destination is directly attached to the output interface, and the packet destination is used as the next-hop address. For point-to-point interfaces, the next hop can be an interface. For broadcast interfaces, the next hop must be an IPv4/IPv6 address.
Fully Specified Static Routes
In a fully specified static route, you can specify either the output interface or the next-hop address. This is useful when the output interface is a multi- access interface and you need to identify the next-hop address. The next-hop address must be directly attached to the specified output interface.
Floating Static Routes
A floating static route is used as a backup for a dynamic route. It is configured with a higher administrative distance than the dynamic route it backs up. In case the dynamic route is lost, the router can use the floating static route as a replacement.
Remote Next Hops for Static Routes
For static routes with remote next-hops (neighboring routers that are not directly connected), you can specify the next-hop address. During data forwarding, the router uses recursive next hops in the unicast routing table to identify the corresponding directly attached next hops that have reachability to the remote next hops.
BFD (Bidirectional Forwarding Detection)
The Cisco Nexus 9000 Series NX-OS supports BFD, a protocol designed for fast forwarding-path failure detection. BFD provides subsecond failure detection between adjacent devices and can be less CPU-intensive than protocol hello messages. BFD load can be distributed onto the data plane on supported modules.
Virtualization Support
Static routes in Cisco Nexus 9000 Series NX-OS support virtual routing and forwarding (VRF) instances. This allows for the creation of multiple virtual routing tables within a single physical router.
Licensing Requirements for Static Routing
Static routing does not require a separate license. It is included with the nx-os image and provided at no extra charge. For more information about the Cisco NX-OS licensing scheme, refer to the Cisco NX-OS Licensing Guide.
FAQ
Q: What is the difference between directly connected static routes and fully specified static routes?
A: In directly connected static routes, you only need to specify the output interface. The router assumes the destination is directly attached to this interface. In fully specified static routes, you can specify either the output interface or the next-hop address.
Q: When should I use a floating static route?
A: Floating static routes are used as backups for dynamic routes. They should be configured with a higher administrative distance than the dynamic route they back up. If the dynamic route is lost, the router can use the floating static route as a replacement.
Q: Can I specify remote next-hops for static routes?
A: Yes, you can specify the next-hop address of a neighboring router that is not directly connected to the router. The router uses recursive next hops in the unicast routing table to identify the corresponding directly attached next hops that have reachability to the remote next hops.
Q: Does static routing support virtual routing and forwarding (VRF) instances?
A: Yes, static routes in Cisco Nexus 9000 Series NX-OS support VRF instances, allowing for the creation of multiple virtual routing tables within a single physical router.
About Static Routing
- Routers forward packets using either route information from route table entries that you manually configure or the route information that is calculated using dynamic routing algorithms.
- Static routes, which define explicit paths between two routers, cannot be automatically updated; you must manually reconfigure static routes when network changes occur. Static routes use less bandwidth than dynamic routes. No CPU cycles are used to calculate and analyze routing updates.
- You can supplement dynamic routes with static routes where appropriate. You can redistribute static routes into dynamic routing algorithms, but you cannot redistribute routing information calculated by dynamic routing algorithms into the static routing table.
- You should use static routes in environments where network traffic is predictable and where the network design is simple. You should not use static routes in large, constantly changing networks because static routes cannot react to network changes. Most networks use dynamic routes to communicate between routers but might have one or two static routes configured for special cases. Static routes are also useful for specifying a gateway of last resort (a default router to which all unroutable packets are sent).
Administrative Distance
An administrative distance is the metric used by routers to choose the best path when there are two or more routes to the same destination from two different routing protocols. An administrative distance guides the selection of one routing protocol (or static route) over another, when more than one protocol adds the same route to the unicast routing table. Each routing protocol is prioritized in order of most to least reliable using an administrative distance value. Static routes have a default administrative distance of 1. A router prefers a static route to a dynamic route because the router considers a route with a low number to be the shortest. If you want a dynamic route to override a static route, you can specify an administrative distance for the static route. For example, if you have two dynamic routes with an administrative distance of 120, you would specify an administrative distance that is greater than 120 for the static route if you want the dynamic route to override the static route.
Directly Connected Static Routes
You must specify only the output interface (the interface on which all packets are sent to the destination network) in a directly connected static route. The router assumes the destination is directly attached to the output interface and the packet destination is used as the next-hop address. The next hop can be an interface, only for point-to-point interfaces. For broadcast interfaces, the next hop must be an IPv4/IPv6 address.
Fully Specified Static Routes
You must specify either the output interface (the interface on which all packets are sent to the destination network) or the next-hop address in a fully specified static route. You can use a fully specified static route when the output interface is a multi-access interface and you need to identify the next-hop address. The next-hop address must be directly attached to the specified output interface.
Floating Static Routes
A floating static route is a static route that the router uses to back up a dynamic route. You must configure a floating static route with a higher administrative distance than the dynamic route that it backs up. In this instance, the router prefers a dynamic route to a floating static route. You can use a floating static route as a replacement if the dynamic route is lost.
Note
By default, a router prefers a static route to a dynamic route because a
static route has a smaller administrative distance than a dynamic route.
Remote Next Hops for Static Routes
You can specify the next-hop address of a neighboring router that is not directly connected to the router for static routes with remote (nondirectly attached) next-hops. If a static route has remote next hops during data forwarding, the next hops are recursively used in the unicast routing table to identify the corresponding directly attached next hops that have reachability to the remote next hops.
BFD
This feature supports bidirectional forwarding detection (BFD). BFD is a
detection protocol designed to provide fast forwarding-path failure detection
times. BFD provides subsecond failure detection between two adjacent devices
and can be less CPU-intensive than protocol hello messages because some of the
BFD load can be distributed onto the data plane on supported modules. See the
Cisco Nexus 9000 Series NX-OS Interfaces Configuration Guide for more
information.
Virtualization Support
Static routes support virtual routing and forwarding (VRF) instances.
Licensing Requirements for Static Routing
The following table shows the licensing requirements for this feature:
Product | License Requirement |
---|---|
Cisco NX-OS | Static routing requires no license. Any feature not included in a |
license package is bundled with the nx-os image and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.
Prerequisites for Static Routing
Static routing has the following prerequisites:
If the next-hop address for a static route is unreachable, the static route is not added to the unicast routing table..
Default Settings
Table 12-1 lists the default settings for static routing parameters. Table 12-1 Default Static Routing Parameters
Parameters | Default |
---|---|
Administrative distance | 1 |
RIP feature | Disabled |
Configuring Static Routing
Note
If you are familiar with the Cisco IOS CLI, be aware that the Cisco NX-OS
commands for this feature might differ from the Cisco IOS commands that you
would use.
Configuring a Static Route
You can configure a static route on the router.
SUMMARY STEPS
- configure terminal
- ip route {ip-prefix | ip-addr/ip-mask} {[next-hop | nh-prefix] | [interface next-hop | nh-prefix]} [name nexthop-name] [tag tag-value] [pref] or ipv6 route ip6-prefix {nh-prefix | link-local-nh-prefix} | {nh-prefix [interface] | link-local-nh-prefix [interface]} [name nexthop-name] [tag tag-value] [pref]
- (Optional) show {ip | ipv6} static-route
- (Optional) copy running-config startup-config
DETAILED STEPS
Command | Purpose |
---|
configure terminal
Example:
switch# configure terminal switch(config)#
| Enters global configuration mode.
ip route { ip-prefix | ip-addr / ip-mask }
{[ next-hop | nh-prefix ] | [ interface next-hop | nh-prefix ]} [ name
nexthop-name ] [ tag tag-value ] [ pref ]
Example :
switch(config)# ip route 192.0.2.0/8 ethernet 1/2 192.0.2.4
| Configures a static route and the interface for this static route. Use ? to display a list of supported interfaces. You can specify a null interface by using null 0.
The preference value sets the administrative distance. The range is from 1 to 255. The default is 1.
ipv6 route ip6-prefix { nh-prefix | link-local-nh-prefix } | ( nexthop [ interface ] | link-local-nexthop [ interface ]} [ name nexthop-name ] [ tag tag-value ] [ pref ]
Example :
switch(config)# ipv6 route 2001:0DB8::/48 6::6 ethernet 2/1
| Configures a static route and the interface for this static route. Use ? to display a list of supported interfaces. You can specify a null interface by using null 0.
The preference value sets the administrative distance. The range is from 1 to 255. The default is 1.
show { ip | ipv6 } static-route
Example:
switch(config)# show ip static-route
| (Optional) Displays information about static routes.
copy running-config startup-config
Example:
switch(config)# copy running-config startup-config
| (Optional) Copies the running configuration to the startup configuration.
This example shows how to configure a static route for a null interface:
switch# configure terminal
switch(config)# ip route 1.1.1.1/32 null 0
switch(config)# copy running-config startup-config
Use the no {ip | ipv6} route command to remove the static route.
Configuring a Static Route over a VLAN
You can configure a static route without next hop support over a VLAN.
BEFORE YOU BEGIN
Ensure that the access port is part of the VLAN.
SUMMARY STEPS
- configure terminal
- feature interface-vlan
- interface vlan vlan-id
- ip address ip-addr/length
- ip route ip-addr/length vlan-id
- (Optional) show ip route
- (Optional) copy running-config startup-config
DETAILED STEPS
Command | Purpose |
---|
configure terminal
Example:
switch# configure terminal switch(config)#
| Enters global configuration mode.
feature interface vlan
Example :
switch(config)# feature interface-vlan
| Enables VLAN interface mode.
interface-vlan vlan-id
Example :
switch(config)# interface-vlan 10
| Creates an SVI and enters interface configuration mode.
The range for the vlan-id argument is from 1 to 4094, except for the VLANs reserved for the internal switch.
ip address ip-addr / length
Example :
switch(config)# ip address 192.0.2.1/8
| Configures an IP address for the VLAN.
ip route ip-addr / length vlan-id
Example : switch(config)# ip route
209.165.200.224/27 vlan 10
| Adds an interface static route without a next hop on the switch virtual interface (SVI).
The IP address is the address that is configured on the interface that is connected to the switch.
show ip route
Example:
switch(config)# show ip route
| (Optional) Displays routes from the Unicast Route Information Base (URIB).
copy running-config startup-config
Example:
switch(config)# copy running-config startup-config
| (Optional) Copies the running configuration to the startup configuration.
This example shows how to configure a static route without a next hop over an SVI:
- switch# configure terminal
- switch(config)# feature interface-vlan
- swicth(config)# interface vlan 10
- switch(config-if)# ip address 192.0.2.1/8
- switch(config-if)# ip route 209.165.200.224/27 vlan 10 <===209,165.200.224 is the IP address of the interface that is configured on the interface that is directly connected to the switch.
- switch(config-if)# copy running-config startup-config
- Use the no ip route command to remove the static route.
Configuring Virtualization
You can configure a static route in a VRF.
SUMMARY STEPS
- configure terminal
- vrf context vrf-name
- ip route {ip-prefix | ip-addr ip-mask} {next-hop | nh-prefix | interface} [name nexthop-name] [tag tag-value] [pref] or ipv6 route ip6-prefix {nh-prefix | link-local-nh-prefix} | {next-hop [interface] | link-local-next-hop [interface]} [name nexthop-name] [tag tag-value] [pref]
- (Optional) show {ip | ipv6} static-route vrf vrf-name
- (Optional) copy running-config startup-config
DETAILED STEPS
Command | Purpose |
---|
configure terminal
Example:
switch# configure terminal switch(config)#
| Enters global configuration mode.
vrf context vrf-name
Example:
switch(config)# vrf context StaticVrf
| Creates a VRF and enters VRF configuration mode.
ip route { ip-prefix | ip-addr ip-mask }
{ next-hop | nh-prefix | interface } [ name
nexthop-name ] [ tag tag-value ] [ pref ]
Example :
switch(config-vrf)# ip route 192.0.2.0/8 ethernet 1/2
| Configures a static route and the interface for this static route. Use ? to display a list of supported interfaces. You can specify a null interface by using null 0.
You can optionally configure the next-hop address.
The preference value sets the administrative distance. The range is from 1 to 255. The default is 1.
ipv6 route ip6-prefix { nh-prefix | link-local-nh-prefix } | ( nexthop [ interface ] | link-local-nexthop [ interface ]} [ name nexthop-name ] [ tag tag-value ] [ pref ]
Example :
switch(config)# ipv6 route 2001:0DB8::/48 6::6 ethernet 2/1
| Configures a static route and the interface for this static route. Use ? to display a list of supported interfaces. You can specify a null interface by using null 0.
You can optionally configure the next-hop address.
The preference value sets the administrative distance. The range is from 1 to 255. The default is 1.
Command | Purpose |
---|---|
show { ip | ipv6 } static-route vrf |
vrf- name
Example:
switch(config-vrf)# show ip static-route
| (Optional) Displays information on static routes.
copy running-config startup-config
Example:
switch(config-vrf)# copy running-config startup-config
| (Optional) Copies the running configuration to the startup configuration.
This example shows how to configure a static route:
- switch# configure terminal
- switch(config)# vrf context StaticVrf
- switch(config-vrf)# ip route 192.0.2.0/8 192.0.2.10 switch(config-vrf)# copy running-config startup-config
Verifying the Static Routing Configuration
To display the static routing configuration, perform one of the following tasks:
Command | Purpose |
---|---|
show { ip | ipv6 } static-route |
static routes.
show ipv6 static-route vrf vrf-name| Displays static route information
for each VRF.
show { ip | ipv6 } static-route track-table| Displays
information about the IPv4 or IPv6 static-route track table.
Configuration Example for Static Routing
This example shows how to configure static routing:
configure terminal
ip route 192.0.2.0/8 192.0.2.10 copy running-config startup-config
Cisco Nexus 9000 Series NX-OS Unicast Routing Configuration Guide, Release 6.x
Read User Manual Online (PDF format)
Read User Manual Online (PDF format) >>