interface tunnel

Syntax

interface tunnel <TUNNEL-NUMBER> mode {gre ipv4 | ip 6in4 | ip 6in6}

interface tunnel <EXISTING-TUNNEL-NUMBER>

no interface tunnel <EXISTING-TUNNEL-NUMBER>

Description

Creates or updates an IP tunnel. After you enter the command, the firmware switches to the configuration context for the tunnel.

If the specified tunnel exists, this command switches to the context for the tunnel.

By default, all tunnels are automatically assigned to the default VRF when they are created.

The no form of this command deletes an existing IP tunnel.

Command context

config

Parameters

mode {gre ipv4 | ip 6in4 | ip 6in6}
Creates an IP tunnel. Choose one of the following options:
  • gre ipv4: Creates a GRE tunnel.

  • ip 6in4: Creates an IPv4 tunnel for IPv6 traffic.

  • ip 6in6: Creates an IPv6 tunnel for IPv6 traffic.

<TUNNEL-NUMBER>

Specifies the number for a new tunnel. Range: 1 to 127. Numbering is shared between all tunnels, so the same tunnel number cannot be used for an IPv6 in IPv4 tunnel and a GRE tunnel.

<EXISTING-TUNNEL-NUMBER>

Specifies the number for an existing IP tunnel. Range: 1 to 127.

Command context

config-gre-if

config-ip-if

Examples

Defines a new GRE tunnel with number 27.
switch(config)# interface tunnel 33 mode gre ipv4
switch(config-gre-if)# 
Switches to the config-gre-if context for existing tunnel 33.
switch(config)# interface tunnel 33
switch(config-gre-if)# 
Deletes GRE tunnel 33.
switch(config)# no interface tunnel 33
Defines a new IPv6 in IPv4 tunnel with number 27.
switch(config)# interface tunnel 27 mode ip 6in4
switch(config-ip-if)# 
Switches to the config-ip-if context for existing tunnel 27.
switch(config)# interface tunnel 27
switch(config-ip-if)# 
DeletesIPv6 in IPv4 tunnel 27.
switch(config)# no interface tunnel 27
Defines a new IPv6 in IPv6 tunnel with number 8.
switch(config)# interface tunnel 8 mode ip 6in6
switch(config-ip-if)#