Generic Routing Encapsulation Commands

This module describes the commands used to configure generic routing encapsulation (GRE).

For detailed information about GRE concepts, configuration tasks, and examples, refer to the .

interface tunnel-ip

To configure a tunnel interface, use the interface tunnel-ip command in the interface global configuration mode. To disable this feature, use the no form of this command.

interface tunnel-ip number

no interface tunnel-ip number

Syntax Description

number

Specifies the instance number of the interface to be configured.

Command Default

None

Command Modes

interface configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Use the interface tunnel-ip command to enter the interface global configuration mode.

Task ID

Task ID

Operations

interface

read, write

Examples

This example shows how to configure a tunnel interface:


RP/0/RP0/CPU0:router# configure 
RP/0/RP0/CPU0:router(config)# interface tunnel-ip 400 
RP/0/RP0/CPU0:router(config-if)#

keepalive

To enable keepalive for a tunnel interface, use the keepalive command. To remove keepalive, use the no form of this command.

keepalive [time_in_seconds [retry_num] ]

no keepalive

Syntax Description

time_in_seconds

Specifies the frequency (in seconds) at which keepalive check is performed. The default is 10 seconds. The minimum value is 1 second.

retry_num

Specifies the number of keepalive retries before declaring that a tunnel destination is unreachable. The default is 3 retries. The minimum value is 1 retry.

Command Default

None

Command Modes

interface configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Use the keepalive command to enable keepalive for a tunnel interface.

Task ID

Task ID

Operations

interface

read, write

Examples

The following example shows how to configure interface tunnel:


RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-ip 400
RP/0/RP0/CPU0:router(config-if)# keepalive 30

tunnel destination

To specify a tunnel interface's destination address, use the tunnel destination command. To remove the destination address, use the no form of this command.


Note

The tunnel will not be operational until the tunnel destination is specified.


tunnel destination ip-address

no tunnel destination ip-address

Syntax Description

ip-address

Specifies the IPv4 address of the host destination.

Command Default

None

Command Modes

interface configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Task ID

Task ID

Operations

interface

read, write

Examples

The following example shows how to configure interface tunnel:


RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-ip 400
RP/0/RP0/CPU0:router(config-if)# tunnel destination 10.10.10.1
  

tunnel dfbit

To configure the DF bit setting in the tunnel transport header, use the tunnel dfbit command. To revert to the default DF bit setting value, use the no form of this command.

tunnel dfbit disable

no tunnel dfbit

Syntax Description

Syntax Description

disable

Disables the DF bit in the outer packet. This allows the outer packet to be fragmented, if required.

Command Default

The DF bit value in the outer packet is disabled. This allows outer packet fragmentation, if required.

Command Modes

interface configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Task ID

Task ID

Operations

interface

read, write

Examples

The following example shows how to enable fragmentation over an interface tunnel.


RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-ip 400
RP/0/RP0/CPU0:router(config-if)# tunnel dfbit disable

tunnel mode

To configure the encapsulation mode of the tunnel interface, use the tunnel mode command. To revert the encapsulation to the default IPv4 GRE tunnel mode, use the no form of this command.

tunnel mode gre ipv4}

no tunnel mode

Syntax Description

Syntax Description

gre

ipv4

Specifies the tunnel as a GRE tunnel over an IPv4 transport network.

Command Default

The default tunnel mode is set as a GRE tunnel over an IPv4 transport network.

Command Modes

interface configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Task ID

Task ID

Operations

interface

read, write

Examples

The following example shows how to configure interface tunnel:


RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-ip 400
RP/0/RP0/CPU0:router(config-if)#tunnel mode gre ipv4

tunnel source

To set a tunnel interface's source address, use the tunnel source command. To remove the source address, use the no form of this command.


Note

The tunnel will not be operational until the tunnel source is specified.


tunnel source {interface_name | ip-address}

no tunnel source {interface_name | ip-address}

Syntax Description

interface_name

Specifies the name of the interface whose IP address will be used as the source address of the tunnel. The interface name can be of a loopback interface or a physical interface.

ip-address

Specifies the IPv4 address to use as the source address for packets in the tunnel.

Command Default

None

Command Modes

interface configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

It is recommended that the tunnel source is identified using the interface ID and not the IP address. Using the interface ID enables the router to mark the tunnel as down when the interface is down and the routing protocol tries to find and use an alternate route to the tunnel route.

Task ID

Task ID

Operations

interface

read, write

Examples

The following example shows how to configure interface tunnel:


RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-ip 400
RP/0/RP0/CPU0:router(config-if)# tunnel source 10.10.10.1
 

tunnel tos

To specify the value of the TOS field in the tunnel encapsulating packets, use the tunnel tos command. To return to the default TOS value, use the no form of this command.

tunnel tos tos_value

no tunnel tos tos_value

Syntax Description

tos_value

Specifies the value of the TOS field in the tunnel encapsulating packets. The TOS value ranges between 0 to 255.

Command Default

Copies the TOS/COS bits of the internal IP header to the GRE IP header. In case of labeled payload, EXP bits are copied to TOS bits of the GRE IP header.

Command Modes

interface configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Task ID

Task ID

Operations

interface

read, write

Examples

The following example shows how to configure interface tunnel:


RP/0/RP0/CPU0:router# configure
RP/0/RP0/CPU0:router(config)# interface tunnel-ip 400
RP/0/RP0/CPU0:router(config-if)# tunnel tos 100

tunnel ttl

To configure the Time-To-Live (TTL) for packets entering the tunnel, use the tunnel ttl command. To undo the configuration, use the no form of this command.

tunnel ttl ttl_value

no tunnel ttl ttl_value

Syntax Description

ttl_value

Specifies the value of TTL for packets entering the tunnel. The TTL value ranges between 1 to 255.

Command Default

The default TTL value is set to 255.

Command Modes

interface configuration

Command History

Release

Modification

Release 3.9.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

This command specifies the Time-To-Live for packets entering the tunnel so that the packets are not dropped inside the carrier network before reaching the tunnel destination.

Task ID

Task ID

Operations

interface

read, write

Examples

The following example shows how to configure interface tunnel:


RP/0/RP0/CPU0:router# configure 
RP/0/RP0/CPU0:router(config)# interface tunnel-ip  400 
RP/0/RP0/CPU0:router(config-if)#tunnel source 10.10.10.1 

tunnel vrf

To specify the virtual routing and forwarding (VRF) instance of the interfaces of the tunnel endpoints, use the tunnel vrf command in tunnel interface configuration mode. To disassociate a VRF from the tunnel endpoints, use the no form of this command.

tunnel vrf vrf-name

Syntax Description

vrf-name

The name of the VRF instance.

Command Default

The tunnel addresses are looked up in the default VRF instance, that is, the global routing table.

Command Modes

Interface configuration

Command History

Release Modification

Release 5.2.0

This command was introduced.

Usage Guidelines

To use this command, you must be in a user group associated with a task group that includes appropriate task IDs. If the user group assignment is preventing you from using a command, contact your AAA administrator for assistance.

Task ID

Task ID Operation

tunnel

read, write

interface

read, write

Examples

The following example shows the tunnel "tunnel-ip1" endpoints associated with the VRF instance "blue".


RP/0/RSP0/CPU0:router(config)# interface tunnel-ip1
RP/0/RSP0/CPU0:router(config-if)# ipv4 address 10.3.3.3 255.255.255.0
RP/0/RSP0/CPU0:router(config-if)# keepalive 5 3
RP/0/RSP0/CPU0:router(config-if)# tunnel mode gre ipv4
RP/0/RSP0/CPU0:router(config-if)# tunnel source Loopback0
RP/0/RSP0/CPU0:router(config-if)# tunnel destination 10.5.5.5
RP/0/RSP0/CPU0:router(config-if)# tunnel vrf blue