GRE Tunnel over IPSEC Lab

How I used dynamic routing to reach the GRE endpoints, then configured and tested the tunnel.

Network Labs ·

I wanted to connect two sites whose underlying networks used different routing protocols. I built reachability between the sites with OSPF, EIGRP, and redistribution, then used that foundation to build the GRE tunnel and work through the IPsec setup.

Lab topology

GRE can carry unicast and multicast packets through a tunnel. IPsec can protect the GRE traffic in transit, and IKE negotiates security associations between peers.

Figure 1 · Lab topology
Figure 1 · Lab topology

Lab components

I used OSPF, EIGRP, route redistribution, GRE, and IPsec. The addressing plan uses 192.168.1.0/28, 192.168.1.16/28, 192.168.1.32/28, and 192.168.1.48/28.

Lab objectives

Establish dynamic reachability between the subnets through the transit router, then configure GRE and work through the IPsec setup.

1. Configure router interfaces

Assign the interface addresses from the topology and bring up the links.

Figure 2 · Router interface configuration
Figure 2 · Router interface configuration
Figure 3 · Router interface configuration
Figure 3 · Router interface configuration

2. Configure OSPF

Configure the OSPF side of the topology using the networks and area in the lab.

Figure 4 · OSPF configuration
Figure 4 · OSPF configuration
Figure 5 · OSPF configuration
Figure 5 · OSPF configuration

3. Configure EIGRP

Configure EIGRP on the other side of the transit router.

Figure 6 · EIGRP configuration
Figure 6 · EIGRP configuration
Figure 7 · EIGRP configuration
Figure 7 · EIGRP configuration

4. Redistribute routes on the transit router

Redistribute routes at the boundary and confirm that the GRE endpoints are reachable before configuring the tunnel.

Figure 8 · Transit router redistribution
Figure 8 · Transit router redistribution

5. Build and check the GRE tunnel

Use the topology to match each tunnel source with the other router’s tunnel destination. Verify the tunnel before routing client traffic through it.

Figure 9 · GRE tunnel configuration
Figure 9 · GRE tunnel configuration
Figure 10 · GRE tunnel configuration
Figure 10 · GRE tunnel configuration
Figure 11 · Tunnel status check
Figure 11 · Tunnel status check

6. Route traffic through the tunnel

Add the lab routes for traffic that should cross the tunnel and check the resulting path.

Figure 12 · Tunnel route configuration
Figure 12 · Tunnel route configuration
Figure 13 · Tunnel route configuration
Figure 13 · Tunnel route configuration
Figure 14 · Tunnel routing verification
Figure 14 · Tunnel routing verification

7. Apply IPsec settings

Use the original lab screenshots to follow the IPsec peer and policy settings used in the simulation.

Figure 15 · IPsec settings
Figure 15 · IPsec settings
Figure 16 · IPsec settings
Figure 16 · IPsec settings

8. Verify GRE and IPsec

Check that traffic takes the GRE path. Verify IPsec separately by checking its security associations where Packet Tracer supports the commands.

Figure 17 · Lab verification
Figure 17 · Lab verification
Figure 18 · Closing notes and simulator limitations
Figure 18 · Closing notes and simulator limitations

What I took away

I checked reachability between the tunnel endpoints before testing traffic across GRE. A working GRE path and an active IPsec association are separate checks. Packet Tracer limited some of the IPsec commands I could use, so the post documents those limits alongside the lab results.

The following Lab is a demonstration on how to set up the GRE Tunnel over IPSEC.

GRE (Generic Routing Encapsulation) – Cisco developed tunneling protocol

  • GRE is great in a sense that it allows end users to share data that would not normally be shared over the public network. It supports both encapsulations such as Unicast and multicast packets but its inability to encrypt Payloads makes it very insecure and not recommended as a standalone tunnel.

  • GRE tunnel which is efficient in every sense but lacks security and IPSEC will provide the security end.

IPSEC (Internet Protocol Security) – Used to set up VPNs, encrypting IP packets with source authentication

  • Once the GRE Tunnel is set up, you can configure an IPSEC Tunnel between the IPSEC peers among each router which will establish protection for any trafficking IP Packets. The protocol that is used here is called IKE (Internet Key Exchange) which establishes the tunnel. 

  • Having the GRE Tunnel over IPSEC is basically having the best of the both worlds.

I will now show you a Lab Demonstration, on how you can setup a GRE Tunnel over IPSEC

  • Following is my lab topology, which you can use as a reference

The following was used to create this Lab

  • OSPF

  • EIGRP

  • REDISTRIBUTION

  • GRE TUNNEL

  • IPSEC

  • The following subnet has been used to configure this network

    192.168.1.0/28

    192.168.1.16/28

    192.168.1.32/28

    192.168.1.48/28

The goal of this Topology 

-  Achieve dynamic reachability between all the different subnets on the following network using OSPF and EIGRP through the transit router.

- Setup GRE Tunnel over IPSEC

Next
Next

Redistribution Lab