Table Of Contents
Static and Utility Routing Commands on Cisco IOS XR Software
route
route maximum
Static and Utility Routing Commands on Cisco IOS XR Software
This chapter describes the commands used to establish static routes.
For detailed information about static routing concepts, configuration tasks, and examples, see the Implementing Static Routes on Cisco IOS XR Software configuration guide.
route
To establish static routes, use the route command in global configuration mode. To remove the route command from the configuration file and restore the system to its default condition in which the software removes specified static routes, use the no form of this command.
route {ipv4 | ipv6}{unicast | multicast} prefix mask {ip-address | interface-type
interface-instance} [distance] [tag tag] [permanent]
no route {ipv4 | ipv6}{unicast | multicast} prefix mask [ip-address | interface-type
interface-instance] [distance] [tag tag] [permanent]
Syntax Description
ipv4
|
Specifies IP Version 4 address prefixes.
|
ipv6
|
Specifies IP Version 6 address prefixes.
|
unicast
|
Specifies unicast address prefixes.
|
multicast
|
Specifies multicast address prefixes.
|
prefix
|
IP route prefix for the destination.
|
mask
|
Prefix mask for the destination. The network mask can be specified in either of two ways:
• The network mask can be a four-part, dotted-decimal address. For example, 255.0.0.0 indicates that each bit equal to 1 means the corresponding address bit is a network address.
• The network mask can be indicated as a slash (/) and number. For example, /8 indicates that the first 8 bits of the mask are 1s, and the corresponding bits of the address are the network address.
|
ip-address
|
IP address of the next hop that can be used to reach that network. The IP address is required, not optional, if the interface type and number are not specified. You can specify an IP address and an interface type and interface number.
|
interface-type
|
Interface type. For more information, use the question mark (?) online help function.
|
interface-instance
|
Either a physical interface instance or a virtual interface instance:
• Physical interface instance. Naming notation is rack/slot/module/port and a slash mark between values is required as part of the notation.
– rack: Chassis number of the rack.
– slot: Physical slot number of the line card.
– module: Module number. A physical layer interface module (PLIM) is always 0.
– port: Physical port number of the interface.
Note In references to a Management Ethernet interface located on a route processor card, the physical slot number is alphanumeric (RP0 or RP1) and the module is CPU0. Example: interface MgmtEth0/RP1/CPU0/0.
• Virtual interface instance. Number range varies depending on interface type.
For more information about the syntax for the router, use the question mark (?) online help function.
|
distance
|
(Optional) An administrative distance.
|
tag tag
|
(Optional) Specifies a tag value that can be used as a "match" value for controlling redistribution using route maps.
|
permanent
|
(Optional) Specifies that the route is not removed from the routing table, even if the next-hop interface shuts down or next-hop IP address is not reachable.
|
Defaults
No static routes are established.
Command Modes
Global configuration
Command History
Release
|
Modification
|
Release 2.0
|
This command was introduced on the Cisco CRS-1.
|
Release 3.0
|
No modification.
|
Release 3.2
|
This command was supported on the Cisco XR 12000 Series Router. The {unicast | multicast} keywords were changed from optional to mandatory. The {ip-address | interface-type interface-instance} arguments became mandatory.
|
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
A static route is appropriate when the software cannot dynamically build a route to the destination.
Static routes have a default administrative distance of 1, in which a low number indicates a preferred route. By default, static routes are preferred to routes learned by routing protocols. You can configure an administrative distance with a static route if you want the static route to be overridden by dynamic routes. For example, you could have routes installed by the Open Shortest Path First (OSPF) protocol with an administrative distance of 120. To have a static route that would be overridden by an OSPF dynamic route, specify an administrative distance greater than 120.
The routing table considers the static routes that point to an interface as "directly connected." Directly connected networks are advertised by IGP routing protocols if a corresponding interface command is contained under the router configuration stanza of that protocol..
Examples
The following example shows an administrative distance of 110. In this case, packets for network 10.0.0.0 are routed to a router at 172.20.16.6 if dynamic information with an administrative distance less than 110 is not available.
RP/0/RP0/CPU0:router(config)# route ipv4 unicast 10.0.0.0/8 172.20.16.6 110
The following example shows how to route packets for network 172.20.0.0 to a router at 172.20.18.4:
RP/0/RP0/CPU0:router(config)# route ipv4 unicast 172.20.0.0/16 172.20.18.4
Related Commands
Command
|
Description
|
network (BGP)
|
Specifies a list of networks for the BGP routing process.
|
show route
|
Displays the current contents of the routing table.
|
show route static
|
Displays the static routes in a routing table.
|
show route summary
|
Displays the current contents of the routing table in summary format.
|
route maximum
To change the maximum number of allowable static routes, use the route maximum command in global configuration mode. To remove the route maximum command from the configuration file and restore the system to its default condition, use the no form of this command.
route maximum {ipv4 | ipv6} value
no route maximum {ipv4 | ipv6} value
Syntax Description
ipv4 | ipv6
|
Specifies IP Version 4 (IPv4) or IP Version 6 (IPv6) address prefixes.
|
value
|
Maximum number of static routes for the given AFI. The range is 1 to 128000.
|
Defaults
value: 4000
Command Modes
Global configuration
Command History
Release
|
Modification
|
Release 2.0
|
This command was introduced on the Cisco CRS-1.
|
Release 3.0
|
No modification.
|
Release 3.2
|
This command was supported on the Cisco XR 12000 Series Router.
|
Usage Guidelines
To use this command, you must be in a user group associated with a task group that includes the proper task IDs. For detailed information about user groups and task IDs, see the Configuring AAA Services on Cisco IOS XR Software module of the Cisco IOS XR System Security Configuration Guide.
If you use the route maximum command to reduce the configured maximum allowed number of static routes for a given table below the number of static routes currently configured, the change is rejected. In addition, understand the following behavior: If you commit a batch of routes that would, when grouped, push the number of static routes configured above the maximum allowed, the first n routes in the batch and the number previously configured are accepted, and the remainder rejected. The n argument is the difference between the maximum number allowed and the number previously configured.
Examples
The following example shows how to set the maximum number of static IPv4 routes to 100000:
RP/0/RP0/CPU0:router(config)# route maximum ipv4 100000
The following example shows how to remove the preceding configuration and set the maximum number of static IPv4 routes back to the default:
RP/0/RP0/CPU0:router(config)# no route maximum ipv4 100000
Related Commands
Command
|
Description
|
route
|
Establishes a static route.
|
show route static
|
Displays the static routes in a routing table.
|