ip route vrf

Syntax

ip route <DEST-IPV4-ADDR>/<MASK> [<NEXT-HOP-IP-ADDR>|<INTERFACE>|reject|blackhole]

vrf <VRF-NAME>

no ip route <DEST-IPV4-ADDR>/<MASK> [<NEXT-HOP-IP-ADDR>|<INTERFACE>|reject|blackhole]

vrf <VRF-NAME>

Description

Adds the destination IPv4 static route on 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-IPV6-ADDR>

Specifies the route destination in IPv4 format (x.x.x.x), where x is a decimal number from 0 to 255.

<MASK>

Specifies the number of bits in the address mask in CIDR format (x), where x is a decimal number from 0 to 128.

<NEXT-HOP-IP-ADDR>

Specifies the next hop in IPv4 format (x.x.x.x), where x is a decimal number from 0 to 255.

<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 a VRF name.

Authority

Administrators or local user group members with execution rights for this command.

Examples

switch(config)# ip route 20.0.0.0/8 10.20.30.44 vrf myvrf

switch(config)# ip route 20.1.2.0/24 1/1/30 vrf myvrf

switch(config)# ip route 1.2.3.4/32 blackhole vrf myvrf

switch(config)# ip route 1.2.3.4/32 reject vrf myvrf

switch(config)# no ip route 20.0.0.0/8 10.20.30.44 vrf myvrf