interface tunnel

Syntax

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

interface tunnel <EXISTING-TUNNEL-NUMBER>

no interface tunnel <EXISTING-TUNNEL-NUMBER>

Description

Creates an IP tunnel and switches to the configuration context for the tunnel.

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

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

Command context

config

Parameters

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

  • ip 6in4: Creates a IPv6 in IPv4 tunnel.

<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