Adding Metrics to a Static Route

You can influence route preference by adding a cost metric or an administrative distance to a static route.
Follow these steps to create an IP static route with cost metrics.
  1. Enter global configuration mode.
    device# configure terminal
    
  2. Designate the route destination and next hop, and add a route priority parameter.
    device(config)# ip route 10.128.2.71/24 10.111.10.1 distance 10
    
    This example configures a static route with an administrative distance of 10.
    Note: The device replaces a static route if it receives a route to the same destination with a lower administrative distance.
    device(config)# ip route 10.128.2.69/24 10.111.10.1 2
    
    This example configures a static route with a metric of 2.

The following example configures a static route to destinations with an IP address beginning with 10.0.0.0. The route uses IP address 10.111.10.1 as the next hop. The static route is assigned an administrative distance of 3.

device# configure terminal
device(config)# ip route 10.0.0.0/24 10.111.10.1 distance 3