ip route vrf

The command adds a static route into a VRF.

Syntax

The syntax of this command can include several interface types. The most common are as follows:

ip route vrf <vrf table name> <ip address> <prefix  mask> [gw ip address] ifname <slot/port.VlanId> [metric value] [track <track id>] [bfd-neighbor <neighbor ID>]  [output-vrf <name>] [description <string>]

This syntax describes a route that depends also on the source prefix of the packets:

ip route vrf <VRF name> source <IP source prefix>|local-voip destination <IP destination prefix> [<gateway>] <interface type> <interface ID> [<metric value>] [track <track ID>] [output-vrf <name>] [description <string>]

Command

Description

vrf table name

Defines the VRF table name.

IP source prefix or

local-voip

Defines the IP source prefix (a.b.c.d/p).

MSBR in single network mode can also be set with local-voip to define the route source address to all VoIP packets generated locally by the MSBR

IP destination prefix

Defines the IP destination prefix (a.b.c.d/p).

metric value

Defines the metric value for this route (0-255).

track

Defines the track to be used for this route.

track id

Defines the Track ID (1-100).

output-vrf

Adds the ability to route traffic received by one VRF from some other VRF. It is configured with the output-vrf option added to the static route configuration.

description

Defines the description.

bfd-neighbor

Defines the ID of a BFD neighbor to attach the route to.

 

Interface Type (ifname)

Interface ID

gigabitethernet

GigabitEthernet interface slot and port (VLAN ID is optional)

[SLOT/PORT.VLANID]

cellular

Cellular interface ID

0/0

gre

Tunnel GRE ID

[1-255] 

ipip

Tunnel IPIP ID

[1-255]

l2tp

L2TP ID

[0-99]

pppoe

PPPoE interface ID

[1-3]

pptp

PPTP ID

[0-99]

vlan

Vlan ID

[1-3999]

loopback

Loopback ID

[1-5]

bvi

Bridge interface

[1-255]

Default

N/A

Note

A route that points to an interface that is not associated with the given vrf will be disabled.

Command Mode

Privileged User

Related Commands

ip vrf, show ip route vrf, show data ip

Example

This example route packets received by vrf VOIP1, with destination prefix 10.4.0.0 from interface gi 0/0 (which belongs to vrf VOIP2) to the next hop 10.5.0.1:

(config-data)# ip route vrf VOIP1 10.4.0.0 255.255.0.0 10.5.0.1 gi 0/0 output-vrf VOIP2