Configuring Point-to-Point GRE VPN Tunnels (2024)

Generic Routing Encapsulation (GRE) is a tunneling protocol developed by Cisco that allows the encapsulation of a wide variety of network layer protocols inside point-to-point links.

A GRE tunnel is used when packets need to be sent from one network to another over the Internet or an insecure network. With GRE, a virtual tunnel is created between the two endpoints (Cisco routers) and packets are sent through the GRE tunnel.

It is important to note that packets travelling inside a GRE tunnel are not encrypted as GRE does not encrypt the tunnel but encapsulates it with a GRE header. If data protection is required, IPSec must be configured to provide data confidentiality – this is when a GRE tunnel is transformed into a secure VPN GRE tunnel.

The diagram below shows the encapsulation procedure of a simple - unprotected GRE packet as it traversers the router and enters the tunnel interface:

Configuring Point-to-Point GRE VPN Tunnels (1)

While many might think a GRE IPSec tunnel between two routers is similar to a site to site IPSec VPN (crypto), it is not. A major difference is that GRE tunnels allow multicast packets to traverse the tunnel whereas IPSec VPN does not support multicast packets. In large networks where routing protocols such as OSPF, EIGRP are necessary, GRE tunnels are your best bet. For this reason, plus the fact that GRE tunnels are much easier to configure, engineers prefer to use GRE rather than IPSec VPN.

This article will explain how to create simple (unprotected) and secure (IPSec encrypted) GRE tunnels between endpoints. We explain all the necessary steps to create and verify the GRE tunnel (unprotected and protected) and configure routing between the two networks.

Configuring Point-to-Point GRE VPN Tunnels (2)
Creating a Cisco GRE Tunnel

GRE tunnel uses a ‘tunnel’ interface – a logical interface configured on the router with an IP address where packets are encapsulated and decapsulated as they enter or exit the GRE tunnel.

First step is to create our tunnel interface on R1:

R1(config)# interface Tunnel0

R1(config-if)# ip address 172.16.0.1 255.255.255.0

R1(config-if)# ip mtu 1400

R1(config-if)# ip tcp adjust-mss 1360

R1(config-if)# tunnel source 1.1.1.10

R1(config-if)# tunnel destination 2.2.2.10

All Tunnel interfaces of participating routers must always be configured with an IP address that is not used anywhere else in the network. Each Tunnel interface is assigned an IP address within the same network as the other Tunnel interfaces.

In our example, both Tunnel interfaces are part of the 172.16.0.0/24 network.

Since GRE is an encapsulating protocol, we adjust the maximum transfer unit (mtu) to 1400 bytes and maximum segment size (mss) to 1360 bytes. Because most transport MTUs are 1500 bytes and we have an added overhead because of GRE, we must reduce the MTU to account for the extra overhead. A setting of 1400 is a common practice and will ensure unnecessary packet fragmentation is kept to a minimum.

Closing, we define the Tunnel source, which is R1’s public IP address, and destination – R2’s public IP address

As soon as we complete R1’s configuration, the router will confirm the creation of the tunnel and inform about its status:

R1#
*May 4 21:30:22.971: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up

Since the Tunnel 0 interface is a logical interface it will remain up even if there is no GRE tunnel configured or connected at the other end.

Next, we must create the Tunnel 0 interface on R2:

R2(config)# interface Tunnel0

R2(config-if)# ip address 172.16.0.2 255.255.255.0

R2(config-if)# ip mtu 1400

R2(config-if)# ip tcp adjust-mss 1360

R2(config-if)# tunnel source 2.2.2.10

R2(config-if)# tunnel destination 1.1.1.10

R2’s Tunnel interface is configured with the appropriate tunnel source and destination IP address. As with R1, R2 router will inform us that the Tunnel0 interface is up:

R2#
*May 4 21:32:54.927: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed state to up

Routing Networks Through The GRE Tunnel

At this point, both tunnel endpoints are ready and can ‘see’ each other. An icmp echo from one end will confirm this:

R1# ping 172.16.0.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.0.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms

R1#

Again, this result means that the two tunnel endpoints can see each other. Workstations on either network will still not be able to reach the other side unless a static route is placed on each endpoint:

R1(config)# ip route 192.168.2.0 255.255.255.0 172.16.0.2

On R1 we add a static route to the remote network 192.168.2.0/24 via 172.16.0.2 which is the other end of our GRE Tunnel. When R1 receives a packet for 192.168.2.0 network, it now knows the next hop is 172.16.0.2 and therefore will send it through the tunnel.

The same configuration must be repeated for R2:

R2(config)# ip route 192.168.1.0 255.255.255.0 172.16.0.1

Now both networks are able to freely communicate with each over the GRE Tunnel.

Securing the GRE Tunnel with IPSec

As mentioned earlier, GRE is an encapsulation protocol and does not perform any encryption. Creating a point-to-point GRE tunnel without any encryption is extremely risky as sensitive data can easily be extracted from the tunnel and viewed by others.

For this purpose, we use IPSec to add an encryption layer and secure the GRE tunnel. This provides us with the necessary military-grade encryption and peace of mind. Our example below covers GRE IPSec Tunnel mode.

GRE IPSec modes are covered extensively in our GRE and IPSec – GRE Over IPSec - Selecting and Configuring Gre IPSec Tunnel or Transport Mode.

Configuring IPSec Encryption For GRE Tunnel (GRE over IPSec)

IPSec encryption involves two steps for each router. These steps are:

  • (1) Configure ISAKMP (ISAKMP Phase 1)
  • (2) Configure IPSec (ISAKMP Phase 2)

Configure ISAKMP (IKE) - (ISAKMP Phase 1)

IKE exists only to establish SAs (Security Association) for IPsec. Before it can do this, IKE must negotiate an SA (an ISAKMP SA) relationship with the peer.

To begin, we’ll start working on R1.

First step is to configure an ISAKMP Phase 1 policy:

R1(config)# crypto isakmp policy 1

R1(config-isakmp)# encr 3des

R1(config-isakmp)# hash md5

R1(config-isakmp)# authentication pre-share

R1(config-isakmp)# group 2

R1(config-isakmp)# lifetime 86400

The above commands define the following (in listed order):

3DES - The encryption method to be used for Phase 1.

MD5 - The hashing algorithm

Pre-share - Use Pre-shared key as the authentication method

Group 2 - Diffie-Hellman group to be used

86400 – Session key lifetime. Expressed in either kilobytes (after x-amount of traffic, change the key) or seconds. Value set is the default value.

Next we are going to define a pre shared key for authentication with R1's peer, 2.2.2.10:

R1(config)# crypto isakmp key firewallcx address 2.2.2.10

The peer’s pre shared key is set to firewallcx. This key will be used for allISAKMP negotiations with peer 2.2.2.10 (R2).

Create IPSec Transform (ISAKMP Phase 2 policy)

Now we need to create the transform set used to protect our data. We’ve named this TS:

R1(config)# crypto ipsec transform-set TS esp-3des esp-md5-hmac
R1(cfg-crypto-trans)# mode transport

The above commands defines the following:

- ESP-3DES - Encryption method

- MD5 - Hashing algorithm

- Set IPSec to transport mode

Finally, we create an IPSec profile to connect the previously defined ISAKMP and IPSec configuration together. We’ve named our IPSec profile protect-gre:

R1(config)# crypto ipsec profile protect-gre

R1(ipsec-profile)# set security-association lifetime seconds 86400

R1(ipsec-profile)# set transform-set TS

We are ready to apply the IPSec encryption to the Tunnel interface:

R1(config)# interface Tunnel 0
R1(config-if)# tunnel protection ipsec profile protect-gre

Now it's time to apply the same configuration on R2:

R2(config)# crypto isakmp policy 1

R2(config-isakmp)# encr 3des

R2(config-isakmp)# hash md5

R2(config-isakmp)# authentication pre-share

R2(config-isakmp)# group 2

R2(config-isakmp)# lifetime 86400

R2(config)# crypto isakmp key firewallcx address 1.1.1.10

R2(config)# crypto ipsec transform-set TS esp-3des esp-md5-hmac

R2(cfg-crypto-trans)# mode transport

R2(config)# crypto ipsec profile protect-gre

R2(ipsec-profile)# set security-association lifetime seconds 86400

R2(ipsec-profile)# set transform-set TS

R2(config)# interface Tunnel 0

R2(config-if)# tunnel protection ipsec profile protect-gre

Verifying The GRE Over IPSec Tunnel

Finally, our tunnel has been encrypted with IPSec, providing us with the much needed security layer. To test and verify this, all that is required is to ping the other end and force the VPN IPSec tunnel to come up and start encrypting/decrypting our data:

R1# ping 192.168.2.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms

Using the show crypto session command, we can quickly verify the encryption is in place and doing its work:

R1# show crypto session

Crypto session current status

Interface: Tunnel0

Session status: UP-ACTIVE

Peer: 2.2.2.10 port 500

IKE SA: local 1.1.1.10/500 remote 2.2.2.10/500 Active

IPSEC FLOW: permit 47 host 1.1.1.10 host 2.2.2.10

Active SAs: 2, origin: crypto map

Summary

In this article we saw how to create simple (unprotected) and secure (IPSec encrypted) GRE tunnels between Cisco routers. We explained all the necessary steps to create and verify the GRE tunnel (unprotected and protected) and configure routing between the two networks.

Configuring Point-to-Point GRE VPN Tunnels (2024)

FAQs

What is the difference between IP tunnel and GRE tunnel? ›

IP-in-IP is an even simpler encapsulating protocol, using this technique IP packets are encapsulated only in an additional IP header. So unlike GRE tunnels an IP-in-IP tunnel cannot carry multicast traffic, other protocols or IPv6 between networks.

When GRE is configured on a router what do the tunnel source and tunnel destination addresses on the tunnel interface refer to? ›

The tunnel source, is the interface that is used as the source address of the encapsulated GRE packet, while the tunnel destination is the destination IP address of the other end of the tunnel. These addresses are used to encapsulate the GRE packet for sending.

What VPN protocol uses encrypted point-to-point GRE tunnels? ›

Point-to-Point Tunneling Protocol (PPTP) establishes VPN connections by encapsulating (PPP) frames in IP packets for transmission over the internet. It operates by using a TCP control channel and a Generic Routing Encapsulation (GRE) tunnel.

What is the difference between VPN and GRE tunnel? ›

IPSec are used in Virtual Private Networks (VPNs) to offer safe communication over an insecure network like the internet. GRE is a tunneling protocol used to construct a virtual point-to-point link between two networks, not a security protocol.

How to configure VPN tunneling? ›

  1. Overview.
  2. Step 1: Create a VPN Gateway.
  3. Step 2: Create a Customer Gateway.
  4. Step 3: Create a VPN Tunnel.
  5. Step 4: Load the Configuration of the Local Gateway.
  6. Step 5: Configure a Routing Table.
  7. Step 6: Activate a VPN Tunnel.
Jan 9, 2024

Why GRE is preferred over IPsec? ›

In a nutshell, GRE can encapsulate virtually any type of traffic in an IP packet and that makes GRE the preferred tunneling option for use cases like tunneling broadcast or multicast traffic (for example in dynamic routing protocols), transmit non-routable protocols over IP networks, or more generically create a point- ...

What are the 2 types of tunneling in VPNs? ›

The more of them you'll have, the more capable hardware you'll need.
  • Site-to-site VPN. ...
  • Internet Protocol Security (IPSec) ...
  • Layer 2 Tunneling Protocol (L2TP) ...
  • Point–to–Point Tunneling Protocol (PPTP) ...
  • SSL and TLS.

Is GRE over IPsec a tunneling protocol? ›

GRE over IPsec is a method to set up site-to-site VPNs. GRE (Generic Routing Encapsulation) is a tunneling protocol that can encapsulate various types of network traffic, including unicast, multicast, and broadcast. However, GRE does not provide security.

How do GRE tunnels work? ›

A GRE tunnel functions like a VPN but without encryption; it transports packets from one endpoint to another through the public network. GRE tunnels typically use keepalive packets to determine if a tunnel is up.

Why do we use a GRE tunnel in conjunction with an IPsec tunnel? ›

This lesson explains what IPsec is and how we use it to protect data and build VPNs. Now the big question is, how do these two work together…is it IPsec over GRE or GRE over IPsec, etc. The main reason that we use GRE in combination with IPSec is that IPSec is unable to do anything with multicast traffic.

How to configure GRE tunnel on Palo Alto? ›

Procedure
  1. Login to GUI of PaloAlto firewall A and configure a tunnel interface. Navigate to Network -> Interfaces -> Tunnel -> click on Add. ...
  2. Configure GRE tunnel. ...
  3. Configure a static route to reach the remote network via GRE tunnel. ...
  4. Configure security policy to allow traffic over GRE. ...
  5. Commit.
Jun 30, 2022

What are the disadvantages of GRE tunnel? ›

Drawbacks of Generic Routing Encapsulation

All routers do not support GRE. Many routers made for consumers, in particular, do not support GRE. Because GRE tunnels isolate the original packets and headers, they might be challenging to diagnose.

What is point-to-point VPN tunnel? ›

The Point to Point Tunneling Protocol (PPTP) is a network protocol used to create VPN tunnels between public networks. PPTP servers are also known as Virtual Private Dialup Network (VPDN) servers.

What is point to point tunneling? ›

Introduction. Point-to-Point Tunneling Protocol (PPTP) is a network protocol that enables the secure transfer of data from a remote client to a private enterprise server by creating a virtual private network (VPN) across TCP/IP-based data networks.

How to config GRE tunnel in Fortigate? ›

To configure a GRE tunnel from the CLI:
  1. Create a GRE tunnel and add it as an interface: edit "Zscaler-SF" set interface "port1" set remote-gw <Zscaler SF Host> ...
  2. Configure the GRE tunnel interfaces: edit "Zscaler-SF" set ip <ip address in a /30 subnet provided by Zscaler> 255.255.255.255. set allowaccess ping.

How to configure tunnel on cisco router? ›

There are three necessary steps in configuring a tunnel interface:
  1. Specify the tunnel interface—interface tunnel-ipsec identifier.
  2. Configure the tunnel source—tunnel source {ip-address | interface-id }
  3. Configure the tunnel destination—tunnel destination {ip-address | tunnel-id }
Jul 30, 2021

How do I setup my GRE tunnel in Palo Alto? ›

Procedure
  1. Login to GUI of PaloAlto firewall A and configure a tunnel interface. Navigate to Network -> Interfaces -> Tunnel -> click on Add. ...
  2. Configure GRE tunnel. ...
  3. Configure a static route to reach the remote network via GRE tunnel. ...
  4. Configure security policy to allow traffic over GRE. ...
  5. Commit.
Jun 30, 2022

How to setup VMware tunnel? ›

Configure the VPN payload.
  1. Select Workspace ONE Tunnel from the Connection Type drop-down menu.
  2. Select Default as the Device Traffic Rules that will be assigned to this profile.
  3. Ensure the Enable VMware Tunnel is selected.
  4. Add any Mail, Contacts, and Calendar Domains. ...
  5. Click Save & Publish then click Publish.

Top Articles
ITOps Times Open-Source Project of the Week: pfSense - ITOps Times
About iPadOS 17 Updates – Apple Support (UK)
Faint Citrine Lost Ark
Celebrity Extra
Professor Qwertyson
Www Thechristhospital Billpay
What's New on Hulu in October 2023
Magic Mike's Last Dance Showtimes Near Marcus Cedar Creek Cinema
Hover Racer Drive Watchdocumentaries
Comenity Credit Card Guide 2024: Things To Know And Alternatives
Sitcoms Online Message Board
Mid90S Common Sense Media
Think Up Elar Level 5 Answer Key Pdf
Local Collector Buying Old Motorcycles Z1 KZ900 KZ 900 KZ1000 Kawasaki - wanted - by dealer - sale - craigslist
Spartanburg County Detention Facility - Annex I
Alejos Hut Henderson Tx
Uky Linkblue Login
Craigslist Red Wing Mn
White Pages Corpus Christi
Palm Springs Ca Craigslist
Pinellas Fire Active Calls
Concordia Apartment 34 Tarkov
FDA Approves Arcutis’ ZORYVE® (roflumilast) Topical Foam, 0.3% for the Treatment of Seborrheic Dermatitis in Individuals Aged 9 Years and Older - Arcutis Biotherapeutics
Ge-Tracker Bond
A Biomass Pyramid Of An Ecosystem Is Shown.Tertiary ConsumersSecondary ConsumersPrimary ConsumersProducersWhich
Quick Answer: When Is The Zellwood Corn Festival - BikeHike
Brbl Barber Shop
UMvC3 OTT: Welcome to 2013!
Lost Pizza Nutrition
Craigslist Wilkes Barre Pa Pets
Wood Chipper Rental Menards
Yu-Gi-Oh Card Database
Sam's Club Gas Price Hilliard
The Bold and the Beautiful
Kltv Com Big Red Box
Chattanooga Booking Report
Pensacola 311 Citizen Support | City of Pensacola, Florida Official Website
Acadis Portal Missouri
Dr Adj Redist Cadv Prin Amex Charge
A Comprehensive 360 Training Review (2021) — How Good Is It?
Ramsey County Recordease
Hireright Applicant Center Login
Oppenheimer Showtimes Near B&B Theatres Liberty Cinema 12
Achieving and Maintaining 10% Body Fat
Differential Diagnosis
Child care centers take steps to avoid COVID-19 shutdowns; some require masks for kids
Deezy Jamaican Food
Hillsborough County Florida Recorder Of Deeds
Assignation en paiement ou injonction de payer ?
Dcuo Wiki
Latest Posts
Article information

Author: Aron Pacocha

Last Updated:

Views: 5995

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Aron Pacocha

Birthday: 1999-08-12

Address: 3808 Moen Corner, Gorczanyport, FL 67364-2074

Phone: +393457723392

Job: Retail Consultant

Hobby: Jewelry making, Cooking, Gaming, Reading, Juggling, Cabaret, Origami

Introduction: My name is Aron Pacocha, I am a happy, tasty, innocent, proud, talented, courageous, magnificent person who loves writing and wants to share my knowledge and understanding with you.