Static Routing Commands


Note


  • Starting with Cisco IOS XR Release 6.6.25, all commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 560 Series Routers.

  • Starting with Cisco IOS XR Release 6.3.2, all commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540 Series Router.

  • References to releases before Cisco IOS XR Release 6.3.2 apply to only the Cisco NCS 5500 Series Router.

  • Cisco IOS XR Software Release 7.0.1 specific updates are not applicable for the following variants of Cisco NCS 540 Series Routers:

    • N540-28Z4C-SYS-A

    • N540-28Z4C-SYS-D

    • N540X-16Z4G8Q2C-A

    • N540X-16Z4G8Q2C-D

    • N540X-16Z8Q2C-D

    • N540-12Z20G-SYS-A

    • N540-12Z20G-SYS-D

    • N540X-12Z16G-SYS-A

    • N540X-12Z16G-SYS-D


This module describes the commands used to establish static routes on Cisco NCS 5000 Series Routers.

For detailed information about static routing concepts, configuration tasks, and examples, see the Implementing Static Routes on Cisco NCS 5000 Series Routers module in the Routing Configuration Guide for Cisco NCS 5000 Series Routers.


Note


Currently, only default VRF is supported. VPNv4, VPNv6 and VPN routing and forwarding (VRF) address families will be supported in a future release.


address-family (static)

To enter various address family configuration modes while configuring static routes, use the address-family command in the appropriate configuration mode. To disable support for an address family, use the no form of this command.

address-family {ipv4 | ipv6} {unicast}

no address-family {ipv4 | ipv6} {unicast}

Syntax Description

ipv4

Specifies IP Version 4 address prefixes.

ipv6

Specifies IP Version 6 address prefixes. This option is available only in static router configuration mode.

unicast

Specifies unicast address prefixes.

Command Default

All static routes belong to the default VRF as static routing does not support VRFs other than default VRF. .

Command Modes

Router static configuration

VRF router static configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

Use the address-family command to enter various address family configuration modes while configuring static routing sessions. From address family configuration mode, you can configure static routes using the route command.

Task ID

Task ID

Operations

static

read, write

Examples

The following example shows how to enter IPv6 unicast address family mode:


  RP/0/RP0/CPU0:router(config)# router static
  RP/0/RP0/CPU0:router(config-static)# address-family ipv6 unicast 
  RP/0/RP0/CPU0:router(config-static-afi)# 
  

maximum path (static)

To change the maximum number of allowable static routes, use the maximum path command in static router configuration mode. To remove the maximum path command from the configuration file and restore the system to its default condition, use the no form of this command.

maximum path {ipv4 | ipv6} value

no maximum path {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 140000.

Command Default

value : 4000

Command Modes

Static router configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

If you use the maximum path 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, 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.

Task ID

Task ID

Operations

static

read, write

Examples

The following example shows how to set the maximum number of static IPv4 routes to 100000:


  RP/0/RP0/CPU0:router(config-static)# maximum path 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-static)# no maximum path ipv4 100000
         

route (static)

To establish static routes, use the route command in address family configuration mode. To remove the route command from the configuration, use the no form of this command.

prefix/ mask {ip-address | type interface-path-id [ip-address | type interface-path-id] [track track-object-name] [ tunnel-id tunnel-id] [vrflabel vrf-label] [distance] [description text] [tag tag] [permanent]}

no prefix/ mask {ip-address | type interface-path-id [ip-address | type interface-path-id] [track track-object-name] [ tunnel-id tunnel-id] [vrflabel vrf-label] [distance] [description text] [tag tag] [permanent]}

Syntax Description

prefix / mask

IP route prefix and 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.

  • For IPv4 address–the IP address is required, not optional, if the interface type and interface-path-id arguments are not specified. You can specify an IP address and an interface type and interface path.

  • For IPv6 link-local address–the interface type and interface-path-id arguments are required. The route is not valid, if the interface type and interface-path-id arguments are not specified.

Note

 

A forwarding router's IP address or an interface or virtual interface path ID can be configured, in any order.

type

Interface type. For more information, use the question mark (?) online help function.

interface-path-id

Physical interface or virtual interface.

Note

 

Use the show interfaces command to see a list of all interfaces currently configured on the router.

For more information about the syntax for the router, use the question mark ( ? ) online help function.

Note

 

A forwarding router's IP address or an interface or virtual interface path ID can be configured, in any order.

distance

(Optional) Administrative distance. Range is 1 to 254.

description text

(Optional) Specifies a description of the static route.

tag tag

(Optional) Specifies a tag value that can be used as a match for controlling redistribution using route policies. Range is 1 to 4294967295.

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.

track track-object-name

Enables object tracking for static route.

tunnel-id tunnel-id

Specifies a Tunnel ID.

Command Default

No static route is established.

Command Modes

Address family configuration

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

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.

Task ID

Task ID

Operations

static

read, write

Examples

The following example shows how to configure IPv6 unicast address family static routes:


  RP/0/RP0/CPU0:router(config)# router static
  RP/0/RP0/CPU0:router(config-static)# address-family ipv6 unicast 
  RP/0/RP0/CPU0:router(config-static-afi)# 2b11::327a:7b00/120 tenGigE 0/2/0/7
  RP/0/RP0/CPU0:router(config-static-afi)# 2b11::327a:7b00/120 tenGigE 0/6/0/0 
  RP/0/RP0/CPU0:router(config-static-afi)# 2b11::327a:7b00/120 2b11::2f01:4c
  RP/0/RP0/CPU0:router(config-static-afi)# 2b11::327a:7b00/120 2b11::2f01:4d
  RP/0/RP0/CPU0:router(config-static-afi)# 2b11::327a:7b00/120 2b11::2f01:4e
  RP/0/RP0/CPU0:router(config-static-afi)# 2b11::327a:7b00/120 2b11::2f01:4f
  RP/0/RP0/CPU0:router(config-static-afi)# 2b11::327a:7b00/120 2b11::2f01:50

router static

To enter static router configuration mode, use the router static command in XR Config mode. To remove all static route configurations and terminate the static routing process, use the no form of this command.

router static

no router static

Syntax Description

This command has no arguments or keywords.

Command Default

No static routing process is enabled.

Command Modes

XR Config mode

Command History

Release

Modification

Release 6.0

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Task ID

Task ID

Operations

static

read, write

bgp, ospf, isis, or network

read, write

Examples

The following example shows how to enter static router configuration mode:


RP/0/RP0/CPU0:router(config)# router static
RP/0/RP0/CPU0:router(config-static)#