ip route vrf

Syntax

ip route <DEST-IPV4-ADDR>/<NETMASK> [<NEXT-HOP-IP-ADDR>|<INTERFACE>|reject|blackhole] vrf <VRF-NAME>

no ip route <DEST-IPV4-ADDR>/<NETMASK> [<NEXT-HOP-IP-ADDR>|<INTERFACE>|reject|blackhole] vrf <VRF-NAME>

Description

Adds the destination IPv4 static route in the specified VRF. If no <VRF-NAME> is specified the route is applied to the default VRF.

The no form of this command removes the IPv4 static route from the VRF.

Command context

config

Parameters

<DEST-IPV4-ADDR>/<NETMASK>

Specifies the IPv4 route destination.

<NEXT-HOP-IP-ADDR>

Specifies the next hop IPv4 address for reaching the destination. Format: A.B.C.D

<INTERFACE>

Specifies the next hop as an outgoing interface.

blackhole

Specifies that packets matching the destination prefix are silently discarded and no ICMP error notification is sent to the sender.

reject

Specifies that packets matching the destination prefix are discarded and an ICMP error notification is sent to the sender.

vrf <VRF-NAME>

Specifies the VRF name. If no <VRF-NAME> is specified the route is applied to the default VRF. Length: Up to 32 alpha numeric characters.

Authority

Administrators

Examples

switch(config)# ip route 20.0.0.0/8 10.20.30.44 vrf test
switch(config)# ip route 20.1.2.0/24 1/1/30 vrf test
switch(config)# ip route 1.2.3.4/32 blackhole vrf test
switch(config)# ip route 1.2.3.4/32 reject vrf test
switch(config)# no ip route 20.0.0.0/8 10.20.30.44 vrf test