Cisco IOS XR Routing Configuration Guide, Release 3.0
Implementing Static Routes on Cisco IOS XR Software

Table Of Contents

Implementing Static Routes on Cisco IOS XR Software

Contents

Prerequisites for Implementing Static Routes on Cisco IOS XR Software

Information About Implementing Static Routes on Cisco IOS XR Software

Static Route Functional Overview

Key Features Supported in the Cisco IOS XR Software

Default Administrative Distance

Directly Connected Routes

How to Implement Static Routes on Cisco IOS XR Software

Configuring Static Routing

Changing the Maximum Number of Allowable Static Routes

Restrictions

Where to Go Next

Additional References

Related Documents

Technical Assistance


Implementing Static Routes on Cisco IOS XR Software


Static routes are user-defined routes that cause packets moving between a source and a destination to take a specified path. Static routes can be important if the Cisco IOS XR software cannot build a route to a particular destination. They are useful for specifying a gateway of last resort to which all unroutable packets will be sent.

Feature History for Implementing Static Routes on Cisco IOS XR Software

Release
Modification

Release 2.0

This feature was introduced.


Contents

Prerequisites for Implementing Static Routes on Cisco IOS XR Software

Information About Implementing Static Routes on Cisco IOS XR Software

How to Implement Static Routes on Cisco IOS XR Software

Where to Go Next

Additional References

Prerequisites for Implementing Static Routes on Cisco IOS XR Software

You must be a member of a user group associated with the proper task IDs for routing commands. Task IDs for commands are listed in the Cisco IOS XR Task ID Reference Guide.

Information About Implementing Static Routes on Cisco IOS XR Software

To implement Static Routes you need to understand the following concepts:

Static Route Functional Overview

Key Features Supported in the Cisco IOS XR Software

Default Administrative Distance

Directly Connected Routes

Static Route Functional Overview

Static routes are entirely user configurable and can point to a next-hop interface, next-hop IP address, or both. In Cisco IOS XR software, if an interface was specified, then the static route will be installed in the Routing Information Base (RIB) if the interface is reachable. If an interface was not specified, the route will be installed if the next-hop address is reachable. The only exception to this configuration is when a static route is configured with the permanent attribute, in which case it will be installed in RIB regardless of reachability.

Key Features Supported in the Cisco IOS XR Software

The key differences in the function of the static feature in Cisco IOS software and Cisco IOS XR software are:

Static routing is its own process on the Cisco IOS XR system.

Static routing can be placed on any desired Route Processor node on the network running any routing protocol.

Default Administrative Distance

Static routes have a default administrative distance of 1, where a low number indicates a preferred route. By default, static routes are preferred to routes learned by routing protocols. Therefore 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.

Directly Connected Routes

The routing table considers the static routes that point to an interface as "directly connected." Directly connected networks are advertised by the routing protocols if matching network commands are defined in those routing protocol configurations.

How to Implement Static Routes on Cisco IOS XR Software

This section contains the following procedures:

Configuring Static Routing (required)

Changing the Maximum Number of Allowable Static Routes (optional)

Configuring Static Routing

This task explains how to configure static routing.

SUMMARY STEPS

1. configure

2. route {ipv4 | ipv6} [unicast | multicast] prefix mask [ip-address] [interface-type interface-number] [distance] [tag tag] [permanent]

3. end
or
commit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

configure

Example:

RP/0/RP0/CPU0:router# configure

Enters global configuration mode.

Step 2 

route {ipv4|ipv6} prefix mask {ip-address} [distance]

Example:

RP/0/RP1/CPU0:router(config)# route ipv4 10.0.0.0/8 172.20.16.6 110

Configures an administrative distance of 110.

ipv4|ipv6 specifies IP Version 4 (IPv4) or IP Version 6 (IPv6) address prefixes.

The prefix is the IP route prefix for the destination.

The mask argument is the network mask. It 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 ones, and the corresponding bits of the address are the network address.

IP address of the next hop that can be used to reach that network. The IP address is required, if the interface type and number are not specified. You can specify both an IP address and an interface type and interface number.

This example routes packets for network 10.0.0.0 through to a networking device at 172.20.16.6 if dynamic information with administrative distance less than 110 is not available.

Step 3 

end

or

commit

Example:

RP/0/RP1/CPU0:router(config)# end

or

RP/0/RP1/CPU0:router(config)# commit

Saves configuration changes.

When you issue the end command, the system will prompt you to commit changes:
Uncommitted changes found. Commit them?

Entering yes will save configuration changes to the running configuration file, exit the configuration session, and return the router to EXEC mode.

Entering no will exit the configuration session and return the router to EXEC mode without committing the configuration changes.

Use the commit command to save the configuration changes to the running configuration file and remain within the configuration session.

Changing the Maximum Number of Allowable Static Routes

This task explains how to change the maximum number of allowable static routes.

Restrictions

The number of static routes that can be configured on a router for a given address family is limited by default to 4000. The limit can be raised or lowered using the route maximum command. Note that if you use the route maximum command to reduce the configured maximum allowed number of static routes for a given address family below the number of static routes currently configured, the change will be rejected. Also, 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 will be accepted. The number previously configured will be accepted, and the remainder will be rejected. The n argument is the difference between the maximum number allowed and the number previously configured.

SUMMARY STEPS

1. configure

2. route maximum {ipv4 | ipv6} value

3. end
or
commit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

configure

Example:

RP/0/RP0/CPU0:router# configure

Enters global configuration mode.

Step 2 

route maximum {ipv4 | ipv6} value

Example:

RP/0/RP1/CPU0:router(config)# route maximum ipv4 10000

Changes the maximum number of allowable static routes.

Specify IP Version 4 (IPv4) or IP Version 6 (IPv6) address prefixes.

Specify the maximum number of static routes for the given address family. The range is from 1 to 128000.

This example sets the maximum number of static IPv4 routes to 10000.

Step 3 

end

or

commit

Example:

RP/0/RP1/CPU0:router(config)# end

or

RP/0/RP1/CPU0:router(config)# commit

Saves configuration changes.

When you issue the end command, the system will prompt you to commit changes:
Uncommitted changes found. Commit them?

Entering yes will save configuration changes to the running configuration file, exit the configuration session, and return the router to EXEC mode.

Entering no will exit the configuration session and return the router to EXEC mode without committing the configuration changes.

Use the commit command to save the configuration changes to the running configuration file and remain within the configuration session.

Where to Go Next

For additional information on static routes, routing protocols and the RIB, consult the following publications:

Implementing and Monitoring RIB on Cisco IOS XR Software

Implementing BGP on Cisco IOS XR Software

Implementing IS-IS on Cisco IOS XR Software

Implementing OSPF on Cisco IOS XR Software

Implementing OSPFv3 on Cisco IOS XR Software

RIB Commands on Cisco IOS XR Software

Additional References

The following sections provide references related to implementing static routes on Cisco IOS XR software.

Related Documents

Related Topic
Document Title

Cisco IOS IP Configuration Guide, Release 12.2, "Configuring IP Routing Protocol-Independent Features"

http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/fipr_c/ipcprt2/
1cfindep.htm


Technical Assistance

Description
Link

Technical Assistance Center (TAC) home page, containing 30,000 pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

http://www.cisco.com/public/support/tac/home.shtml