This is the documentation for the 19.02 version. Looking for the documentation of the latest version? Have a look here.

GRE Interfaces

A Generic Routing Encapsulation (GRE) interface enables direct routing to a peer that does not need to be directly connected, similar to a VPN tunnel, but without encryption. GRE is frequently combined with an encrypted transport to enable routing or other features not possible with the encrypted transport on its own. GRE interfaces can be combined with dynamic routing protocols such as BGP, or use static routing.

To create a GRE object, TNSR requires an object name, positive integer instance ID, source IP address, and destination IP address:

tnsr(config)# gre test1
tnsr(config-gre)# instance 1
tnsr(config-gre)# source
tnsr(config-gre)# destination
tnsr(config-gre)# exit

The above example creates a new GRE object named test1, with an instance id of 1, and the source and destination addresses shown. Upon commit, the new GRE interface will be available for use by TNSR. The name of the GRE interface is gre<instance id>, which in this case results in gre1. The GRE interface can then be configured similar to other interfaces (Configure Interfaces):

tnsr(config)# interface gre1
tnsr(config-interface)# ip address
tnsr(config-interface)# enable
tnsr(config-interface)# exit
tnsr(config)# exit

Additional GRE Parameters

In GRE confguration mode, TNSR also supports optional parameters for the route table and tunnel type.

Route Table

This option controls which route table is used by the GRE object, for traffic utilizing the GRE interface:

tnsr(config)# gre <object name>
tnsr(config-gre)# encapsulation route-table <table name>

The default behavior is to use the default routing table, ipv4-VRF:0 which is equivalent to issuing this command:

tnsr(config)# gre test1
tnsr(config-gre)# encapsulation route-table ipv4-VRF:0

Tunnel Type

TNSR supports multiple GRE tunnel types as well, including:


Layer 3 encapsulation, the default type of GRE tunnel, which can carry layer 3 IP traffic and above.


Encapsulated Remote Switched Port Analyzer (ERSPAN). This requires a session ID number after the type name.


Transparent Ethernet Bridging (TEB)

This command sets the type of tunnel:

tnsr(config)# gre <object name>
tnsr(config-gre)# tunnel-type <type> [parameters]

To configure an L3 tunnel, omit the tunnel-type command entirely or enter:

tnsr(config)# gre test1
tnsr(config-gre)# tunnel-type l3

To configure an ERSPAN tunnel with a session identifier of 1:

tnsr(config)# gre test1
tnsr(config-gre)# tunnel-type erspan 1

To confgigure a TEB tunnel:

tnsr(config)# gre test1
tnsr(config-gre)# tunnel-type teb

GRE List

To view a list of current GRE objects, use show gre:

tnsr# show gre

Name  Instance Type Source IP   Dest IP      Encap Rt   Session Id
----- -------- ---- ----------- ------------ ---------- ----------
test1 1        L3 ipv4-VRF:0 0

This command prints a list of all GRE objects and a summary of their configuration.


For an example ERSPAN configuration, see GRE ERSPAN Example Use Case