IPv4 static route addition of deletion in a VRF


You must be in the global configuration context, as indicated by the config prompt.

To add an IPv4 static route to a VRF, enter the following command.

ip route <dest-ipv4-addr>/<netmask> {<gateway-ip>|<interface>} vrf [<vrf-name>]


Specifies the route destination IP address and the network mask length for the destination.


Specifies the gateway as either an IP address or an interface.


Specifies the VRF name. If no <vrf-name> is specified the route is applied to the default VRF.

Use the no form of the command to remove an IPv4 static route from the VRF.

See the following example:
switch# configure terminal
switch(config)# ip route vrf test
switch(config)# ip route 1/1/5 vrf test
switch# configure terminal
switch(config)# no ip route vrf test

Related topic: ip route vrf (command reference)