16.2. GRE TUNNEL Commands

16.2.1. interface

Command Purpose

Using this command to create a new tunnel interface. Use the no form of this command to destroy the tunnel interface.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

interface tunnel TUNNEL_ID

no interface tunnel TUNNEL_ID

Parameter

Parameter Description

Parameter Value

TUNNEL_ID

tunnel id

0-1023

Command Mode

Global Config

Default

None

Usage

It just creates an interface structure, and then the tunnel interface can not be used before it is configured the mode.

Examples

This example shows how to create a tunnel interface:

Switch# configure terminal
Switch(config)# interface tunnel 1

16.2.2. tunnel mode gre

Command Purpose

This cammad is used for specifying the IPv4 transition tunnel protocol of gre, and the no form of this command can unset the tunnel protocol.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

tunnel mode gre

no tunnel mode

Parameter

Parameter Description

Parameter Value

gre

The gre tunnel is only supported in IPv4 network and encaped with IPv4 header.

-

Command Mode

Interface Configuration

Default

None

Usage

When configure the tunnel mode with gre, and then it is required configure tunnel source and tunnel destination manually.

Examples

This example shows how to configure the tunnel with gre protocol:

Switch# configure terminal
Switch(config)# interface tunnel 1
Switch(config-if)# tunnel mode gre

Related Commands

tunnel source

tunnel destination

16.2.3. tunnel source

Command Purpose

This command is used to specify the tunnel source. Use the no form of this command to unset the tunnel source.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

tunnel source ( IP_ADDR | IFNAME )

no tunnel source

Parameter

Parameter Description

Parameter Value

IP_ADDR

specify a tunnel source in the IPv4 address format

IPv4 Address

IFNAME

specify a tunnel source in the IFNAME format, the IFNAME should be layer3 interface, like routed port, vlan interface, loopback…

Support physical/aggregation/loopback/vlan ports

Command Mode

Interface Configuration

Default

None

Usage

Every tunnel must have a tunnel source. If users specify the IFNAME format, system will choose the primary address as tunnel source

Examples

This example shows how to set the tunnel source:

Switch# configure terminal
Switch(config)# interface tunnel 1
Switch(config-if)# tunnel source 3.3.3.3

Related Commands

tunnel mode gre

tunnel destination

16.2.4. tunnel destination

Command Purpose

Use this command to specify a tunnel destination address in an IPv4 portion. Use the no parameter to un-specify the address.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

tunnel destination IP_ADDR

no tunnel destination

Parameter

Parameter Description

Parameter Value

IP_ADDR

Specify the tunnel destination IPv4 address

IPv4 Address

Command Mode

Interface Configuration

Default

None

Usage

None

Examples

This example shows how to set the tunnel destination:

Switch# configure terminal
Switch(config)# interface tunnel 1
Switch(config-if)# tunnel destination 4.4.4.4

Related Commands

tunnel source

tunnel mode gre

16.2.5. tunnel enable

Command Purpose

Use this command to enable tunnel decapsulation for interfaces. Use the form of this command to restore the default configuration.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

tunnel ( enable | disable )

Parameter

Parameter Description

Parameter Value

enable

-

-

disable

-

-

Command Mode

Interface Configuration

Default

by default, tunnel decapsulation is disabled on all interfaces.

Usage

None

Examples

This example shows how to enable tunnel decapsulation on interface eth-0-1:

Switch# configure terminal
Switch(config)# interface eth-0-1
Switch(config-if)# tunnel enable

Related Commands

interface

16.2.6. tunnel gre key

Command Purpose

Use this command to set the key of gre tunnel. Use the no form of this command to unset the key of gre tunnel.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

tunnel gre key KEY_VALUE

no tunnel gre key

Parameter

Parameter Description

Parameter Value

KEY_VALUE

gre key value

1-4294967295

Command Mode

Interface Configuration

Default

None.

Usage

Gre key is taken advantage of certification of packet and provides the security of gre tunnel. Gre key can support 32bits, but can not support to set 0.

Examples

This example shows how to set gre key:

Switch# configure terminal
Switch(config)# interface tunnel 1
Switch(config-if)# tunnel gre key 666

Related Commands

tunnel source

16.2.7. tunnel dscp

Command Purpose

Use this command to specify a value of Differentiated Services Code Point (DSCP) in the tunnel IPv4 encapsulation header. Use the no parameter to inheriting the underlying physical interface value by default.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

tunnel dscp DSCP

no tunnel dscp

Parameter

Parameter Description

Parameter Value

DSCP

The outer IPv4 header DSCP value

0-63

Command Mode

Interface Configuration

Default

By default, the DSCP value is inherited from original IPv6 packet.

Usage

None.

Examples

This example shows how to set the outer IPv4 header DSCP value as 40.:

Switch# configure terminal
Switch(config)# interface tunnel 1
Switch(config-if)# tunnel dscp 40

Related Commands

show interface tunnel

interface

16.2.8. keepalive

Command Purpose

Use this command to enable function of keepalive, it is used for checking whether gre tunnel peers is up or reachable.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

keepalive PERIOD_VALUE RETRY_VALUE

no keepalive

Parameter

Parameter Description

Parameter Value

PERIOD_VALUE

Interval period

1-32767

RETRY_VALUE

timeout and retry

1-255

Command Mode

Interface Configuration

Default

period_value: 10s

retry_value:3

Usage

Only when the gre tunnel is in the state of up or keepalive down, then the keepalive packets can be sent out through the network port.

Examples

This example shows how to enable the keepalive function with period value 10s and retry times 5:

Switch# configure terminal
Switch(config)# interface tunnel 1
Switch(config-if)# keepalive 10 5

Related Commands

no keepalive

16.2.9. show interface tunnel

Command Purpose

Use this command to display the tunnel information.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show interface tunnel TUNNEL_ID

Parameter

Parameter Description

Parameter Value

TUNNEL_ID

The tunnel ID

0-1023

Command Mode

Privileged EXEC

Default

None.

Usage

None

Examples

This example displays the tunnel information.:

Switch# show interface tunnel 1

Interface tunnel1
  Interface current state: UP
  Hardware is Tunnel
  Index 8193 , Metric 1 , Encapsulation TUNNEL
  VRF binding: not bound
  Internet primary address:
    1.1.1.1/24 pointopoint 1.1.1.255
  Tunnel protocol/transport GRE/IP, Status Valid
  Tunnel source 192.192.168.1(eth-0-10), destination 10.10.10.10
  Tunnel DSCP inherit,  Tunnel TTL 255
  Tunnel transport MTU 1476 bytes
  Tunnel GRE key enable: 100
  Tunnel GRE keepalive enable, Send period: 5, Retry times: 3
  0 packets input, 0 bytes
  0 packets output, 0 bytes

Related Commands

show resource tunnel

16.2.10. show resource tunnel

Command Purpose

Use this command to display the tunnel peers resource information.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show resource tunnel

Command Mode

Privileged EXEC

Default

None.

Usage

None

Examples

This example displays the tunnel peers resource information.:

Switch# show tunnel resource

Tunnel
Resource                         Used          Capability
=============================================================
Peers                            0             8
DUT1# 

Related Commands

None

16.2.11. show tunnel keepalive statistics

Command Purpose

Use this command to display the statistics of gre tunnel keepalive.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show tunnel keepalive statistics ( | interface tunnel TUNNEL_ID )

Parameter

Parameter Description

Parameter Value

TUNNEL_ID

tunnel id

0-1023

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example displays the statistics of gre tunnel keepalive.:

Switch#  show tunnel keepalive statistics

Name         Status    Keepalive  Out_ka_pkt In_ka_pkt  TunnelUp TunnelDown
-----------------------------------------------------------------------------
DUT1#           

Related Commands

clear tunnel keepalive statistics

16.2.12. clear tunnel keepalive statistics

Command Purpose

Use this command to clear the statistics of gre tunnel keepalive.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

clear tunnel keepalive statistics ( all | interface tunnel TUNNEL_ID )

Parameter

Parameter Description

Parameter Value

TUNNEL_ID

tunnel id

0-1023

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example clears the statistics of gre tunnel keepalive.:

Switch# clear tunnel keepalive statistics all

Related Commands

show tunnel keepalive statistics

16.2.13. clear tunnel statistics

Command Purpose

Use this command to clear the statistics of tunnel include input and output.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

clear tunnel statistics ( all | interface tunnel TUNNEL_ID )

Parameter

Parameter Description

Parameter Value

TUNNEL_ID

tunnel id

0-1023

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

This example clears the statistics of tunnel include input and output.:

Switch# clear tunnel statistics all

Related Commands

show interface tunnel id