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 Releases
Routing Configuration Guide for Cisco 8000 Series Routers, Cisco IOS XR Releases
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.
Use this task to associate a VRF with a static route.
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).
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.
Specify IPv4 or IPv6 address prefixes.
Specify the maximum number of static routes for the given address family. The range is from 1 to 140,000.
This example sets the maximum number of static IPv4 routes to 10,000.
Router(config)# router static
Router(config-static)# maximum path ipv4 10000
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.
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.