GRE Tunnel Interface Commands


Note


All commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540 Series Router that is introduced from Cisco IOS XR Release 6.3.2. References to earlier releases in Command History tables apply to only the Cisco NCS 5500 Series Router.



Note


  • Starting with Cisco IOS XR Release 6.6.25, all commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 560 Series Routers.

  • Starting with Cisco IOS XR Release 6.3.2, all commands applicable for the Cisco NCS 5500 Series Router are also supported on the Cisco NCS 540 Series Router.

  • References to releases before Cisco IOS XR Release 6.3.2 apply to only the Cisco NCS 5500 Series Router.

  • Cisco IOS XR Software Release 7.0.1 specific updates are not applicable for the following variants of Cisco NCS 540 Series Routers:

    • N540-28Z4C-SYS-A

    • N540-28Z4C-SYS-D

    • N540X-16Z4G8Q2C-A

    • N540X-16Z4G8Q2C-D

    • N540X-16Z8Q2C-D

    • N540-12Z20G-SYS-A

    • N540-12Z20G-SYS-D

    • N540X-12Z16G-SYS-A

    • N540X-12Z16G-SYS-D


This module describes the command line interface (CLI) commands for configuring GRE tunnel interfaces on the Cisco NCS 5500 Series RoutersCisco NCS 540 Series Routers.

For information on configuring GRE tunnels, see the Interface and Hardware Component Configuration Guide for Cisco NCS 5500 Series Routers.

interface tunnel-ip

Configures an IP-in-IP tunnel interface.

To remove this configuration, use the no prefix of the command.

interface tunnel-ip id

no interface tunnel-ip id

Syntax Description

id

Specifies the tunnel interface identifier. Range is from 0 to 131070.

Command Default

None

Command Modes

XR Config mode

Release Modification

Release 6.1.3

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Examples

The following example shows how you can configure an IP-in-IP tunnel interface.

RP/0/RP0/CPU0:router(config)# interface tunnel-ip 10
RP/0/RP0/CPU0:router(config-if)# ipv4 unnumbered loopback 20
RP/0/RP0/CPU0:router(config-if)# tunnel mode ipv4 decap 
RP/0/RP0/CPU0:router(config-if)# tunnel source loopback 0
RP/0/RP0/CPU0:router(config-if)# tunnel destination 50.10.1.2/32 

hw-module profile gue

To configure unique GUE port numbers to decapsulate IPv4, IPv6, and MPLS packets using UDP, use the hw-module profile gue udp-dest-port ipv4 <port number> ipv6 <port number> mpls <port number> command in XR Config mode on the destination router.

hw-module profile gue udp-dest-port ipv4 <port number> ipv6 <port number> mpls <port number>

Table 1. Command Description

Keyword

Description

gue

The UDP destination port configuration of the GUE decapsulation tunnel.

udp-dest-port

Configure separate UDP port numbers for IPv4, IPv6, and MPLS.

ipv4

Configure unreserved UDP port numbers for IPv4 payload. The supported range is from 1000 through 64000.

ipv6

Configure unreserved UDP port numbers for IPv6 payload. The supported range is from 1000 through 64000.

mpls

Configure unreserved UDP port numbers for MPLS payload. The supported range is from 1000 through 64000.

To remove this configuration, use the no prefix of the command:

no hw-module profile gue udp-dest-port ipv4 <port number> ipv6 <port number> mpls <port number>

Command Default

None

Command Modes

XR Config

Command History

Release

Modification

Release 7.3.3

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Examples

The following example shows how you can configure unique GUE port numbers to decapsulate IPv4, IPv6, and MPLS packets using UDP.

Router(config)#hw-module profile gue udp-dest-port ipv4 1001 ipv6 1002 mpls 1003

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 6.1.3

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:


router# configure
router(config)# interface tunnel-ip 400
router(config-if)# keepalive 30

tunnel destination

Configures the tunnel destination for the tunnel interface.

To remove this configuration, use the no prefix of the command.

tunnel destination { ipv4-address | ipv4 address/subnet-mask | ipv6-address }

no tunnel destination { ipv4-address | ipv4 address/subnet-mask | ipv6-address }

Syntax Description

ipv4-address

Configures the specified IPv4 address as the destination IP for the tunnel interface.

ipv4-address/subnet mask

Configures the specified IPv4 address with subnet mask as the destination IP for the tunnel interface.

ipv6-address

Configures the specified IPv6 address as the destination IP for the tunnel interface.

Command Default

None

Command Modes

Tunnel interface configuration mode

Release Modification

Release 6.1.3

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Examples

The following example shows how you can configure an IPv4 address with subnet mask as the tunnel destination for an IP-in-IP tunnel interface.

RP/0/RP0/CPU0:router(config)# interface tunnel-ip 10
RP/0/RP0/CPU0:router(config-if)# ipv4 unnumbered loopback 20
RP/0/RP0/CPU0:router(config-if)# tunnel mode ipv4 decap 
RP/0/RP0/CPU0:router(config-if)# tunnel source loopback 0
RP/0/RP0/CPU0:router(config-if)# tunnel destination 50.10.1.2/32 

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 | copy }

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.

copy

Copies the DF bit value from the inner packet to the outer packet.

Note

 

This is valid only for an IPv4 transport network in an IP in IP tunnel.

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 6.1.3

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.

Copying the DF bit value from the inner packet to the outer packet is only supported for an IPv4 transport network in an IP in IP tunnel. If copy option is configured, you cannot configure an IP in IP tunnel over an IPv6 transport network.

Task ID

Task ID

Operations

interface

read, write

Examples

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


router# configure
router(config)# interface tunnel-ip 400
router(config-if)# tunnel dfbit disable

tunnel mode

Configures the mode of encapsulation for the tunnel interface.

To remove this configuration, use the no prefix of the command.

tunnel mode [ gre | ipsec ] ipv4 [ decap | encap ]

no tunnel mode [ gre ] ipv4 [ decap | encap ]

Syntax Description

tunnel mode gre

Configures IP-over-GRE encapsulation for the tunnel interface.

tunnel mode ipsec ipv4

Configures generic packet tunneling over IPv4 encapsulation for the tunnel interface.

tunnel mode gre ipv4

Configures GRE-over-IPv4 encapsulation for the tunnel interface.

tunnel mode ipsec ipv4

Configures IPSec feature for the tunnel interface.

decap

Configures the IP-in-IP or GRE tunnel to be used only for decapsulation.

encap

Configures GRE Single-Pass over IPv4.

Command Default

None

Command Modes

Tunnel interface configuration mode

Release Modification

Release 7.8.1

The ipsec keyword was introduced.

Release 6.1.3

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Examples

The following example shows how you can configure the tunnel mode for an IP-in-IP tunnel interface.

RP/0/RP0/CPU0:router(config)# interface tunnel-ip 10
RP/0/RP0/CPU0:router(config-if)# ipv4 unnumbered loopback 20
RP/0/RP0/CPU0:router(config-if)# tunnel mode ipv4 decap 
RP/0/RP0/CPU0:router(config-if)# tunnel source loopback 0
RP/0/RP0/CPU0:router(config-if)# tunnel destination 50.10.1.2/32 

tunnel source

Configures the source IP address for a tunnel interface.

To remove this configuration, use the no prefix of the command.

tunnel source { direct | | | ipv4-address | | | interface-type interface-number }

no tunnel source { ipv4-address | interface-type interface-number }

Syntax Description

ipv4-address

Configures the specified IPv4 address as the source IP for the tunnel interface.

interface-type interface-number

Configures the specified interface type as the source for the tunnel interface.

direct

Allows you to decapsulate tunnels on any L3 interface on the router.

Command Default

None

Command Modes

Tunnel interface configuration mode

Release Modification

Release 6.1.3

This command was introduced.

Usage Guidelines

No specific guidelines impact the use of this command.

Examples

The following example shows how you can configure the Loopback 0 interface as the tunnel source for an IP-in-IP tunnel interface.

RP/0/RP0/CPU0:router(config)# interface tunnel-ip 10
RP/0/RP0/CPU0:router(config-if)# ipv4 unnumbered loopback 20
RP/0/RP0/CPU0:router(config-if)# tunnel mode ipv4 decap 
RP/0/RP0/CPU0:router(config-if)# tunnel source loopback 0
RP/0/RP0/CPU0:router(config-if)# tunnel destination 50.10.1.2/32 

Examples

This example shows how to configure IP-in-IP tunnel decapsulation on directly connected IP addresses:

Router# configure terminal
Router(config)#interface Tunnel4
  Router(config)#tunnel mode ipv4 decap
  Router(config)#tunnel source direct
  Router(config)#no shutdown

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 6.1.3

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:


router# configure
router(config)# interface tunnel-ip 400
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 6.1.3

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:


router# configure 
router(config)# interface tunnel-ip  400 
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 6.1.3

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