The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes how to configure static routing on the Cisco NX-OS device.
This chapter includes the following sections:
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).
This section includes the following topics:
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.
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.
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.
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.
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.
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 7000 Series NX-OS Interfaces Configuration Guide, Release 5.x, for more information.
Static routes support virtual routing and forwarding (VRF) instances. VRFs exist within virtual device contexts (VDCs). By default, Cisco NX-OS places you in the default VDC and default VRF unless you specifically configure another VDC and VRF. For more information, see the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.x, and Chapter14, “Configuring Layer 3 Virtualization”
The following table shows the licensing requirements for this feature:
Static routing has the following configuration guidelines and limitations:
Table 13-1 lists the default settings for static routing parameters.
|
|
---|---|
This section includes the following topics:
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.
Ensure that you are in the correct VDC (or use the switchto vdc command).
2. ip route { ip-prefix | ip-addr/ip-mask } {[ next-hop | nh-prefix ] | [ interface next-hop | nh-prefix ]} [ name nexthop-name] [ tag tag-value] [ pref ]
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 ]
This example shows how to configure a static route for a null interface:
switch(config)# ip route 1.1.1.1/32 null 0
switch(config)# copy running-config startup-config
Use the no { ip | ipv6 } static-route command to remove the static route.
Ensure that you are in the correct VDC (or use the switchto vdc command).
3. ip route { ip-prefix | ip-addr ip-mask } { next-hop | nh-prefix | interface } [ name nexthop-name] [ tag tag-value] [ pref ]
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 ]
This example shows how to configure a static route:
switch(config)# vrf context StaticVrf
A mixed chassis is a Cisco Nexus 7000 Series chassis that contains at least one M-Series module and at least one N7K-F132-15 module. Because the N7K-F132-15 module processes only Layer 2 traffic, you must use this configuration to pass Layer 3 traffic through the chassis.
Note This is an optional procedure.
To configure a Layer 3 gateway in a mixed chassis, you use the proxy routing functionality. You enable routing on a specific VLAN by configuring a VLAN interface and the system automatically provides load-balanced routing functionality. (See the Cisco Nexus 7000 Series NX-OS Interfaces Configuration Guide, Release 5.x, for more information about Layer 3 routing and VLAN interfaces.)
Optionally, you can specify which physical interfaces on the N7K-M Series modules you want to use for Layer 3 routing.
You must configure a VLAN interface for each VLAN on the N7K-F132-15 module that you want to use the proxy-routing functionality in a mixed chassis.
You must have interfaces from both the M Series and the N7K-F132-15 modules in the same VDC.
2. (Optional) hardware proxy layer-3 routing {use | exclude} { module mod-number | interface slot/port} [ module-type f1 ]
This example shows how to specify certain physical interfaces on the N7K-M Series modules to perform proxy routing on the N7K-F132-15 module in a mixed chassis:
To display the static routing configuration, perform one of the following tasks:
This example shows how to configure static routing:
ip route 192.0.2.0/8 192.0.2.10
copy running-config startup-config
This example shows how to specify specific M Series modules to use in a chassis that contains both N7K-F132-15 and M Series modules:
For additional information related to implementing static routing, see the following sections:
|
|
---|---|
Cisco Nexus 7000 Series NX-OS Unicast Routing Command Reference, Release 5.x |
|
Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.x |
Table 13-2 lists the release history for this feature.
|
|
|
---|---|---|
Added support for BFD. See the Cisco Nexus 7000 Series NX-OS Interfaces Configuration Guide, Release 5.x, for more information. |
||