Table Of Contents
Static Routing Commands on Cisco IOS XR Software
address-family (static)
maximum path (static)
route (static)
router static
vrf (static)
Static 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 Implementing Static Routes on Cisco IOS XR Software configuration guide.
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 | multicast}
no address-family {ipv4 | ipv6} {unicast | multicast}
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.
|
multicast
|
Specifies multicast address prefixes. This option is available only in static router configuration mode.
|
Defaults
When entering address family configuration mode without entering VRF configuration mode, all static routes belong to the default VRF.
Command Modes
Router static configuration
VRF router static configuration
Command History
Release
|
Modification
|
Release 3.3.0
|
This command was introduced on the Cisco CRS-1 and Cisco XR 12000 Series Router.
|
Release 3.4.0
|
No modification.
|
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.
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)#
Related Commands
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.
|
Defaults
value: 4000
Command Modes
Static router configuration
Command History
Release
|
Modification
|
Release 3.3.0
|
This command was introduced on the Cisco CRS-1 and Cisco XR 12000 Series Router.
|
Release 3.4.0
|
No modification.
|
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 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
Related Commands
Command
|
Description
|
route (static)
|
Enters static router configuration mode.
|
show route static
|
Displays the static routes in a routing table.
|
route (static)
To establish static routes, use the route command in address family 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.
prefix mask [vrf vrf-name] {ip-address | interface-type interface-instance} [distance] [tag tag]
[permanent]
no prefix mask [vrf vrf-name] {ip-address | interface-type interface-instance} [distance] [tag tag]
[permanent]
Syntax Description
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.
|
vrf vrf-name
|
(Optional) Specifies a destination VRF. This option is available when IPv4 address families are specified. The following names cannot be used: all, default, and global.
address-family ipv4 unicast
10.1.1.0 vrf vrf_a 192.168.1.1
address-family ipv4 unicast
|
ip-address
|
(Optional) 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
|
(Optional) Interface type. For more information, use the question mark (?) online help function.
|
interface-instance
|
(Optional) Either a physical interface instance or a virtual interface instance as follows:
• Physical interface instance. Naming notation is rack/slot/module/port and a slash between values is required as part of the notation.
– rack: Chassis number of the rack.
– slot: Physical slot number of the modular services card or 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. Range is 1 to 254.
|
tag tag
|
(Optional) Specifies a tag value that can be used as a "match" value 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.
|
Defaults
No static route is established.
vrf vrf-name: If no VRF is specified, the vrf where the configuration takes place is used.
Command Modes
Address family 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.
|
Release 3.3.0
|
This command was moved from global configuration mode to router static configuration mode. The vrf vrf-name keyword and argument was added. The following keywords were removed:
• route
• ipv4
• ipv6
• unicast
• multicast
|
Release 3.4.0
|
No modification.
|
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.
A static route is always associated with a VPN routing and forwarding (VRF) instance. The VRF can be the default VRF or a specified VRF. Specifying a VRF allows you to enter VRF configuration mode where you can configure a static route. If you do not specify a VRF you can configure a default VRF static route.
Use the router static command to configure static routes. To configure a static route, you must enter router static configuration mode and then enter an address family configuration mode or VRF configuration mode. See the vrf (static) command for information on configuring a static route in VRF configuration mode. After you enter an address family mode, you can enter multiple static routes. The following example shows how to configure multiple static routes in IPv4 and IPv6 address family configuration modes:
address-family ipv4 unicast
address-family ipv6 unicast
2b11::2f01:4c 2b11::327a:7b00/120
2b11::2f01:4d 2b11::327a:7b00/120
2b11::2f01:4e 2b11::327a:7b00/120
2b11::2f01:4f 2b11::327a:7b00/120
2b11::2f01:50 2b11::327a:7b00/120
2b11::2f01:51 2b11::327a:7b00/120
2b11::2f01:52 2b11::327a:7b00/120
2b11::2f01:53 2b11::327a:7b00/120
2b11::2f01:54 2b11::327a:7b00/120
2b11::2f01:55 2b11::327a:7b00/120
2b11::2f01:56 2b11::327a:7b00/120
2b11::2f01:57 2b11::327a:7b00/120
2b11::2f01:58 2b11::327a:7b00/120
2b11::2f01:59 2b11::327a:7b00/120
2b11::2f01:5a 2b11::327a:7b00/120
2b11::2f01:5b 2b11::327a:7b00/120
Note
You cannot create a VRF named default, but you can reference the default VRF.
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 POS0/2/0/7
RP/0/RP0/CPU0:router(config-static-afi)# 2b11::327a:7b00/120 GigabitEthernet0/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
Related Commands
Command
|
Description
|
address-family (static)
|
Enters address family configuration mode.
|
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 (static)
|
Enters router static configuration mode.
|
vrf (static)
|
Enters VRF static route configuration mode.
|
router static
To enter router static configuration mode, use the router static command in global configuration 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.
Defaults
No static routing process is enabled.
Command Modes
Global configuration
Command History
Release
|
Modification
|
Release 3.3.0
|
This command was introduced on the Cisco CRS-1 and Cisco XR 12000 Series Router.
|
Release 3.4.0
|
No modification.
|
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.
Use the router static command to enter router static configuration mode.
Task ID
Task ID
|
Operations
|
static
|
read, write
|
bgp, ospf, hsrp, isis, vrrp, multicast, or network
|
read, write
|
Examples
The following example shows how to enter router static configuration mode:
RP/0/RP0/CPU0:router(config)# router static
RP/0/RP0/CPU0:router(config-static)#
Related Commands
Command
|
Description
|
address-family (static)
|
Enters address family configuration mode.
|
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 (static)
|
Establishes a static route.
|
vrf (static)
|
Enters VRF static route configuration mode.
|
vrf (static)
To configure a VPN routing and forwarding (VRF) instance and enter VRF configuration mode, use the vrf command in router configuration mode. To remove the VRF instance from the configuration file and restore the system to its default condition, use the no form of this command.
vrf vrf-name
no vrf vrf-name
Syntax Description
vrf-name
|
Name of the VRF instance. The following names cannot be used: all, default, and global.
|
Defaults
No default behavior or values
Command Modes
Static router configuration
Command History
Release
|
Modification
|
Release 3.3.0
|
This command was introduced on the Cisco CRS-1 and Cisco XR 12000 Series Router.
|
Release 3.4.0
|
No modification.
|
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.
Use the vrf command to configure a VRF instance. A VRF instance is a collection of VPN routing and forwarding tables maintained at the provider edge (PE) router.
If you are configuring a default VRF route, you do not need to enter VRF configuration mode. For example, routes 192.168.1.0/24 and 192.168.1.2/24 are configured as follows:
192.168.1.0/24 loopback 5
Routes 192.168.1.0/24 and 192.168.1.2/24 are default VRF routes.
Routes 172.168.40.24/24 and 172.168.40.25/24 are configured as follows:
172.168.40.24/24 loopback 1
172.168.40.25/24 vrf default 192.168.1.0/24
Routes 172.168.40.24/24 and 172.168.40.25/24 belong to vrf_A. Route 172.168.40.24/24 is not installed in vrf_A until route 192.168.1.0/24 (a default VRF route) is resolved.
Note
You cannot create a VRF named default, but you can reference the default VRF.
Note
You must remove IPv4/IPv6 addresses from an interface prior to assigning, removing, or changing a VRF on an IP interface. If this is not done in advance, any attempt to change the VRF on an IP interface is rejected.
Task ID
Task ID
|
Operations
|
static
|
read, write
|
Examples
The following example shows how to configure a VRF instance and enter VRF configuration mode:
RP/0/RP0/CPU0:router(config)# router static
RP/0/RP0/CPU0:router(config-static)# vrf vrf-1
RP/0/RP0/CPU0:router(config-static-vrf)#
Related Commands
Command
|
Description
|
address-family (static)
|
Enters address family configuration mode and allows you to configure a static route.
|