IPv4 static route addition or deletion in a VRF

Prerequisites

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

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

ip route/{|} vrf []

Where
/

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 nois specified the route is applied to the default VRF.

Use the没有形式的命令来删除一个IPv4的静态route from the VRF.

See the following example:
switch(config)#ip route 20.0.0.0/24 10.0.0.1 vrf testswitch(config)#ip route 20.0.0.0/24 1/1/5 vrf test
switch(config)#没有ip route 20.0.0.0/24 10.0.0.1 vrf test

Related topic:ip route vrf(command reference)