Creating an IP static route in a non-default VRF

You can configure an IP static route in a non-default VRF. If the VRF is not named, the default VRF is used.

The VRF configured must be a valid VRF.
To create an IP static route with a next hop in a non-default VRF, follow these steps.
  1. Enter global configuration mode.
    device# configure terminal
    
  2. Enter the ip route command followed by the keyword vrf and the VRF name. On the same command line, enter the destination IP address, followed by the prefix-length or the address mask and then the IP address of the next-hop.
    device(config)# ip route vrf blue 10.0.0.0/24 10.1.1.1
    This example configures an IP static route through the non-default VRF "blue" with the next-hop address 10.1.1.1.

The following example configures a static route with a destination address 56.1.5.0/24. The route is configured in the non-default VRF "red" and uses tunnel 5 as the next-hop gateway.

device# configure terminal
device(config)# ip route vrf red  56.1.5.0/24  tunnel 5
NOTE
When a tunnel is designated as the next-hop gateway for a non-default VRF destination, the tunnel must already exist before the static route can be created.