GRE Tunnel Tutorial

4 min read

Generic Routing Encapsulation (GRE) is a simple tunneling technique that makes two routers behave as though they were directly connected, even when there are other networks sitting physically between them. This is extremely useful when a company has two sites far apart from each other, each with its own local network, and wants to connect them as if they were on the same link.

GRE tunnel connecting two distant routers
A GRE tunnel lets two routers at opposite ends of a company behave as if directly connected.

How a GRE Tunnel Works

When a router sends a packet into a GRE tunnel, it wraps the original packet in two additional headers: a 4-byte GRE header and a 20-byte delivery (outer IP) header. The delivery header carries the physical, routable addresses of the two tunnel endpoints, so the underlying network only ever needs to know how to reach those addresses — it has no idea what is actually being carried inside.

GRE encapsulation process adding GRE and delivery headers
GRE wraps the original packet with a GRE header and an outer delivery header.

It’s worth being clear about what GRE does and does not do: it encapsulates traffic, but it does not encrypt it. If confidentiality is required, GRE needs to be paired with IPsec. On the other hand, GRE does support multicast traffic, which is exactly why routing protocols that rely on multicast — such as OSPF and EIGRP — can run directly over a GRE tunnel without any special workaround.

The physical addresses used as the tunnel’s source and destination don’t need to be in the same subnet, or even directly connected — they simply need to be reachable from one router to the other across the underlying network.

Tunnel source and destination addresses used by GRE
The tunnel source and destination are the physical addresses the underlying network routes between.
// members only

The rest of this article is for members

The full walkthrough, configuration examples and verification steps are available exclusively to paid members.

View membership plans Log in