Generic Routing Encapsulation (GRE) Tunnel - Study CCNP (2024)

Generic Routing Encapsulation or GRE protocol is developed by Cisco and it provides a virtual point-to-point private connection and encapsulates and forwards packets over an IP-based network. GRE is used in many instances, such as transporting IPv6 traffic over an IPv4-only network. We can also use GRE to tunnel routing protocols like RIP, OSPF, or EIGRP between HQ and branch sites.

How Do GRE Tunnels Work?

When a router encapsulates data packets, it modifies the packet’s header information (encapsulation) to include the remote endpoint’s IP address as the destination. The GRE packets consist of GRE header and flags, original IP header, and payload data. The new IP header information now allows the GRE packet to be routed between two tunnel endpoints without inspecting the original packet’s payload. Once the packet reaches the remote tunnel endpoint, the GRE header is removed (de-encapsulation), and the original data packet is routed to the remote network.

Original Packet

IP HeaderPayload Data

GRE Packet

GRE IP HeaderGRE FlagsOriginal IP HeaderPayload Data

GRE Configuration

Here’s the step-by-step process for configuring the GRE tunnel:

  1. Create a GRE tunnel interface.
  2. Configure an IP address for the tunnel interface.
  3. Set the local tunnel source. It can be a physical or loopback interface.
  4. Set the remote destination IP.

Optional configs: Tunnel bandwidth, keepalive, and IP MTU

For our example configuration, we will use the topology below. We have two sites, Site A and Site B, and both have their respective ISPs as default gateways to reach the Internet.

Generic Routing Encapsulation (GRE) Tunnel - Study CCNP (1)

Without GRE tunnelling configured, let’s see if we can ping from Site A LAN to Site B LAN:

Site-A#sh ip routeGateway of last resort is 172.16.1.2 to network 0.0.0.0S* 0.0.0.0/0 [1/0] via 172.16.1.2
Site-A#traceroute 192.168.2.1Type escape sequence to abort.Tracing the route to 192.168.2.1VRF info: (vrf in name/id, vrf out name/id)1 172.16.1.2 2 msec 3 msec 4 msec2 172.16.1.2 !H !H *
Site-A#ping 192.168.2.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:.....Success rate is 0 percent (0/5)

A traceroute to Site B’s LAN interface is sent to ISP1 GW which blackholes it.

Now, let’s configure Site A and Site B routers. We have OSPF enabled on the LAN (192.168.1.0/24 and 192.168.2.0/24) and GRE tunnel (10.10.10.0/24) networks. With this, Sites A and B become direct OSPF neighbors over the GRE tunnel and learn each other’s routes. The default static routes are pointing to their respective ISPs.

Site A

Site-A#conf tSite-A(config)#int Tunnel1Site-A(config-if)#ip address 10.10.10.1 255.255.255.0Site-A(config-if)#tunnel source 172.16.1.1Site-A(config-if)#tunnel destination 172.16.2.1Site-A(config-if)#exitSite-A(config)#router ospf 1Site-A(config-router)#router-id 1.1.1.1Site-A(config-router)#network 10.10.10.0 0.0.0.255 area 0Site-A(config-router)#network 192.168.1.0 0.0.0.255 area 1Site-A(config-router)#exitSite-A(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.2

Site B

Site-B#conf tSite-B(config)#int Tunnel1Site-B(config-if)#ip address 10.10.10.2 255.255.255.0Site-B(config-if)#tunnel source 172.16.2.1Site-B(config-if)#tunnel destination 172.16.1.1Site-B(config-if)#exitSite-B(config)#router ospf 1Site-B(config-router)#router-id 2.2.2.2Site-B(config-router)#network 10.10.10.0 0.0.0.255 area 0Site-B(config-router)#network 192.168.2.0 0.0.0.255 area 1Site-B(config-router)#exitSite-B(config)#ip route 0.0.0.0 0.0.0.0 172.16.2.2

Verification

Now, let’s check the state of the tunnel using the ‘show interfaces tunnel’ command.

Site-A#sh int tunnel 1 | include Tunnel.*is|Tunnel s|Tunnel pTunnel1 is up, line protocol is up Tunnel source 172.16.1.1, destination 172.16.2.1 Tunnel protocol/transport GRE/IP
Site-B#sh int tunnel 1 | include Tunnel.*is|Tunnel s|Tunnel p Tunnel1 is up, line protocol is up Tunnel source 172.16.2.1, destination 172.16.1.1 Tunnel protocol/transport GRE/IP

Let’s also check the routing table if Site A has formed an OSPF adjacency with Site B over the GRE tunnel.

Site-A# sh ip route ospfGateway of last resort is 172.16.1.2 to network 0.0.0.0O IA 192.168.2.0/24 [110/1001] via 10.10.10.2, 00:02:22, Tunnel1

Lastly, we do a traceroute and ping to confirm reachability.

Site-A#traceroute 192.168.2.1Type escape sequence to abort.Tracing the route to 192.168.2.1VRF info: (vrf in name/id, vrf out name/id) 1 10.10.10.2 5 msec 6 msec * 
Site-A#ping 192.168.2.1Type 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 = 4/5/6 ms

Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.

We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training:

Generic Routing Encapsulation (GRE) Tunnel - Study CCNP (2)

Generic Routing Encapsulation (GRE) Tunnel - Study CCNP (2024)
Top Articles
How to open a UK bank account
Council Post: 3 Key Skills That Successful People Managers Must Develop
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Selly Medaline
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 5700

Rating: 4.1 / 5 (42 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.