Adding Metrics to an IPv6 Static Route

You can influence how likely a static route is to be used by modifying the cost metric or the administrative distance.
Before configuring a static IPv6 route, you must enable the forwarding of IPv6 traffic on the Layer 3 switch using the ipv6 unicast-routing command and enable IPv6 on at least one interface by configuring an IPv6 address or explicitly enabling IPv6 on that interface.
Follow these steps to create an IPv6 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)# ipv6 route 2001:DB8::0/64 2001:DB8:2343:0:ee44::1 2
    This example configures a static IPv6 route for a destination network with the prefix 2001:DB8::0/64 and a next-hop gateway with the global address 2001:DB8:0:ee44::1 and assigns the route a metric of 2.
    device(config)# ipv6 route 2001:DB8::0/64 2001:DB8:2343:0:ee44::1 distance 254
    
    This example configures a static route with an administrative distance of 254.

The following example configures an IPv6 static route for a destination network with the prefix 2001:DB8::0/64 and a next-hop gateway with the global address 2001:DB8:0:ee44::1. The static route is assigned an administrative distance of 3.

device# configure terminal
device(config)# ipv6 route 2001:DB8::0/64 2001:DB8:0:ee44::1 distance 3