Tip

This is the documentation for the 19.12 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.

GRE Configuration

To create a GRE object, TNSR requires an object name, positive integer instance ID, source IP address, and destination IP address. The first step is to run the gre <object-name> command, which enters config-gre mode. Inside config-gre mode, the following commands are available:

instance <id>:

Required instance identifier. This value is used to generate the GRE interface name in TNSR in the form of gre<id>. For example, with an id of 1, the GRE interface name is gre1.

source <ip-address>:

Required IP address on TNSR to use as a source for GRE traffic associated with this instance. Can be an IPv4 or IPv6 address.

destination <ip-address>:

Required IP address of the remote GRE peer, which is the destination for GRE traffic associated with this instance. Can be an IPv4 or IPv6 address, but the address family must match that of the source IP address.

encapsulation route-table <route-table>:

This option controls which route table is used by the GRE object, for traffic utilizing the GRE interface. The default behavior is to use the default routing table.

tunnel-type <type>:

TNSR supports multiple GRE tunnel types, where <type> is one of the following:

l3:

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

erspan session-id <id>:

Encapsulated Remote Switched Port Analyzer (ERSPAN). This requires a session ID number, which is an integer in the range 0..1023. When combined with Switch Port Analyzer (SPAN) Interfaces, ERSPAN can deliver copies of local packets to a remote host for inspection. Explained in detail in GRE ERSPAN Example Use Case.

teb:

Transparent Ethernet Bridging (TEB)

GRE Examples

This example creates a new GRE object named test1, with an instance id of 1, and the source and destination addresses shown:

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

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 10.2.123.1/30
tnsr(config-interface)# enable
tnsr(config-interface)# exit
tnsr(config)# exit

See also

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

GRE Status

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   203.0.113.2 203.0.113.25 ipv4-VRF:0 0

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