vrf attach

Syntax

vrf attach <VRF-NAME>

no vrf attach <VRF-NAME>

Description

Assigns an IP tunnel to a VRF. By default, all tunnels are automatically assigned to the default VRF when they are created.

The no form of this command assigns a tunnel to the default VRF (default).

Command context

config-gre-if

config-ip-if

Parameters

<VRF-NAME>

Specifies the VRF name to which to assign the tunnel.

Authority

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

Examples

Assigns GRE tunnel 33 to vrf1.

switch(config)# interface tunnel 33 mode gre ipv4
switch(config-gre-if)# vrf attach vrf1

Reassigns GRE tunnel 33 to the default VRF.

switch(config)# interface tunnel 33
switch(config-gre-if)# no vrf attach vrf1

Assigns IPv6 in IPv4 tunnel 27 to vrf2.

switch(config)# interface tunnel 27 mode gre ipv4
switch(config-ip-if)# vrf attach vrf2

Reassigns IPv6 in IPv4 tunnel 27 to the default VRF.

switch(config)# interface tunnel 27
switch(config-ip-if)# no vrf attach vrf2

Assigns IPv6 in IPv6 tunnel 8 to vrf3.

switch(config)# interface tunnel 8 mode ip 6in6
switch(config-ip-if)# vrf attach vrf3

Reassigns IPv6 in IPv6 tunnel 8 to the default VRF.

switch(config)# interface tunnel 8
switch(config-ip-if)# no vrf attach vrf3