Introduces example configurations that show how to deploy static routing in common scenarios.
This section provides additional configuration examples for specific scenarios.
Routing Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Release
Introduces example configurations that show how to deploy static routing in common scenarios.
This section provides additional configuration examples for specific scenarios.
You can configure static routes to point to a next hop interface, next hop IP address, or both. If you specify an interface, the static route is installed in the Routing Information Base (RIB) when the interface is reachable. If you do not specify an interface, the route is installed when the next hop address is reachable. When you configure a static route with the permanent attribute, it is installed in RIB regardless of reachability.
You can programmatically configure and view the operational state of the static route using
openconfig-local-routing.yangoropenconfig-network-instance.yangOpenConfig data models. To get started with using data models, see the Programmability Configuration Guide for Cisco 8000 Series Routers .
Use this task to configure a static route.
| 1. | In static route configuration mode, configure the VRF. Example:
If a VRF is not specified, the static route is configured under the default VRF. |
|
| 2. | In address family mode, configure an administrative distance of 110. A default static route is often used in simple router topologies. This example shows how to route packets for network 10.0.0.0 through to a next hop at 192.0.2.1 if dynamic information with administrative distance less than 110 is not available. Example:
|
Use this task to associate a VRF with a static route.
| 1. | In static route configuration mode, configure the VRF. Example:
|
|
| 2. | In address family mode, configure an administrative distance of 201. Example:
|
|
| 3. | Bind the interface to the VRF. Ensure that the interface name exactly matches the VRF name configured earlier. Example:
|
Use this task to configure static routing between PE and CE routers.
The system does not support VRF fallback with IPv6 VPN Provider Edge (6VPE).
| 1. | In static route configuration mode, configure the VRF. Example:
|
|
| 2. | In address family mode, configure an administrative distance of 201. Example:
|
In this example, a static route between PE and CE routers is configured, and a VRF is associated with the static route:
configure
router static
vrf vrf_A
address-family ipv4 unicast
0.0.0.0/0 192.0.2.1 120
end
By default, you can configure up to 4000 static routes on a router for each address family. You can raise or lower the limit using the maximum path command.
If the maximum number of static routes for an address family is reduced below the currently configured number, the system rejects the change. If you commit a batch of routes that would exceed the maximum allowed, the first n routes are accepted, and the remainder are rejected. The value of n is the difference between the maximum number allowed and the number previously configured.
Use this task to change the maximum number of allowable static routes.
Run the maximum path command in static route configuration mode to change the maximum number of static routes allowed.
Example:
|
You can configure a static route to use the null 0 interface to discard traffic for a specific prefix. To discard all traffic to the prefix 2001:0DB8:42:1/64, define this static route:
configure
router static
address-family ipv6 unicast
2001:0DB8:42:1::/64 null 0
end
Native UCMP enables effective load balancing by assigning lower metrics to higher bandwidth links, ensuring traffic is distributed according to link capacity. This approach supports both IPv4 and IPv6 static routes in virtual routing and forwarding (VRF) contexts and is preferred for multi-hop destinations.
Native UCMP:
ensures higher-bandwidth links are utilized efficiently
supports both local and native UCMP configurations, and
applies to static routing scenarios requiring proportional traffic distribution.
In networks with multiple links, configuring equal metrics creates ECMP next hops, which may underutilize higher bandwidth links. Native UCMP addresses this by considering bandwidth during load balancing, especially for multi-hop destinations.
Local UCMP uses equal metrics and does not consider bandwidth for multi-hop links.
Native UCMP matches link metrics with end-to-end bandwidth for optimal load balancing.
Ensure you have access to the device CLI and appropriate privileges to configure static routing. Identify the interfaces and bandwidths for all links involved in the load balancing configuration.
| 1. | Configure UCMP with load metric for IPv4 or IPv6 address family in static routing mode. Example:
For IPv6 address family, use the following sample configuration:
|
|
| 2. | Exit the static configuration mode and commit your configuration. Example:
Repeat this procedure on each router that you want to configure with native UCMP. |
Native UCMP is configured for static routing, enabling proportional load balancing across links based on bandwidth. Higher bandwidth links will carry more traffic, optimizing network utilization.
router static
address-family ipv4 unicast
198.51.100.0/24 198.51.100.1
203.0.113.0/24 192.0.2.2
203.0.113.0/24 192.0.2.6 metric 100 Specify the metric value explicitly to achieve UCMP load balancing. This static route configuration example includes the default metric value.
router static
address-family ipv4 unicast
198.51.100.0/24 198.51.100.1
203.0.113.0/24 192.0.2.2 metric 1
203.0.113.0/24 192.0.2.6 metric 100
Verify the routing table to confirm that the correct metrics are used for static routes.
Monitor traffic distribution to ensure load balancing is functioning as expected.