Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

GRE Tunnels

Direct answer

A GRE tunnel is a virtual point-to-point link between two routers that may be many hops apart. Packets sent into it are wrapped in a new IP packet addressed to the other router, and unwrapped there.

When to use this

Use it to run routing protocols or carry private, IPv6 or multicast traffic across a network that would not route it — and when a tunnel shows up but passes nothing, or flaps.

First 30 seconds

1. show interfaces Tunnel<n> — up/up? Input and output counters both rising?

2. ping <tunnel destination> source <tunnel source> — is the underlay working?

3. show ip route <tunnel destination> — through a physical interface, not the tunnel?

4. Output only, no input → the far end's source and destination do not mirror this end, or protocol 47 is filtered.

5. Ping works, transfers stall → MTU and MSS on the tunnel.

Operational verification

tunnel source up → route to the tunnel destination through the underlay → far end configured as the mirror image → IP protocol 47 permitted → tunnel up → MTU and MSS adjusted → traffic in both directions

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard · Cisco IOS / IOS XE
Key commandshow dmvpn
Scope / prerequisiteUse it to run routing protocols or carry private, IPv6 or multicast traffic across a network that would not route it — …
Show · 2
What next?3 suggested next steps
Catalog command links2
Evidence1
On this pageJump to a specific section
Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification Verify boundary
show interfaces Tunnel0
show ip interface brief | include Tunnel
show ip route 198.51.100.2
ping 198.51.100.2 source GigabitEthernet0/0
ping 172.16.0.2 size 1400 df-bit

The interface view shows line and protocol state, tunnel source and destination, the transport MTU, keepalive setting and packet counters. The route lookup shows how the router reaches the tunnel destination — it must be through a physical interface. The first ping tests the underlay between the tunnel endpoints; the second tests the tunnel itself with a full-size packet that may not be fragmented.

Known-good: the destination is reachable through the underlay, the tunnel is up/up, the far tunnel address answers at full size, and input and output counters both increase.

Step 2 Failure boundaries & design notes Narrow the fault
  • Tunnel is up/down. No route to the tunnel destination, the source interface is down — or keepalives are not answered.
  • Tunnel is up/up but nothing passes. The other end is missing or misconfigured, or protocol 47 is filtered on the way; without keepalives the tunnel cannot tell.
  • The tunnel flaps and the log reports recursive routing. The route to the tunnel destination is being learned through the tunnel; filter it or add a static route via the underlay.
  • Ping works, large transfers stall. MTU: set ip mtu and ip tcp adjust-mss on the tunnel.
  • Output counters rise, input counters do not. Packets leave and nothing returns: the far end's source and destination do not mirror this end's, or the return path is filtered.
  • It works from one site and not through a NAT device. GRE has no ports to translate.
  • Keepalives fail once IPsec or a reverse-path check is added. The returned keepalive packet is dropped by the check; use a routing protocol or BFD across the tunnel.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

By default the tunnel is up as soon as there is a route to its destination — it does not check the far end; use keepalive or a routing protocol across it. The route to the tunnel destination must never be learned through the tunnel. Lower the MTU: ip mtu 1400 and ip tcp adjust-mss 1360. GRE is not encrypted.

Key checks
  • show interfaces Tunnel<n> — state, source, destination, keepalive, counters.
  • show ip route <tunnel destination> — must leave by a physical interface.
  • ping <tunnel destination> source <tunnel source> — the underlay.
  • ping <far tunnel address> size 1400 df-bit — the tunnel itself at full size.
ReferenceWhat it is1 section · depth on demand

Mechanics & mental model

A GRE tunnel is a virtual point-to-point link between two routers that may be many hops apart. Packets sent into the tunnel are wrapped in a new IP packet addressed to the other router and unwrapped there, so the networks in between see only traffic between the two routers.

ReferenceWhy it matters1 section · depth on demand

Why it matters operationally

GRE makes two distant routers behave as direct neighbours. That lets routing protocols run between sites over a provider network, and carries traffic the transit network could not route itself — private addresses, IPv6, multicast. It adds no protection of its own, shrinks the usable packet size, and has an unusual idea of when it is "up"; those three account for most of its problems.

ReferenceHow it works1 section · depth on demand

Operational flow & dependencies

interface Tunnel0
 ip address 172.16.0.1 255.255.255.252
 tunnel source GigabitEthernet0/0
 tunnel destination 198.51.100.2
 ip mtu 1400
 ip tcp adjust-mss 1360

Two layers of addressing. The tunnel source and destination are addresses in the transit network — the underlay. The address on the tunnel interface belongs to the virtual link itself. Routes for the remote site point into the tunnel; the route to the tunnel destination must point out of a physical interface.

Encapsulation. A packet routed into the tunnel gets a 4-byte GRE header and a new 20-byte IP header, with protocol number 47. The far router strips both and routes the original packet.

Size. The 24 bytes of overhead leave 1476 bytes on a 1500-byte path. Setting ip mtu 1400 on the tunnel, with room for IPsec, and ip tcp adjust-mss 1360 so that TCP connections through it use segments that fit, avoids fragmentation.

When the tunnel is up. By default the tunnel interface is up/up as soon as the router has a route to the tunnel destination. It does not check that the other end exists or answers. Traffic can disappear into a tunnel that shows up. keepalive 5 3 makes the router test the tunnel and take the interface down after three missed replies — or a routing protocol across the tunnel serves the same purpose.

Recursive routing. If the router learns a route to the tunnel destination through the tunnel — typically from the routing protocol running over it — the tunnel would be carrying its own outer packets. The router detects this, logs a recursive routing message and takes the tunnel down; it then comes back and repeats. The route to the tunnel destination must always come from the underlay.

Security. GRE neither encrypts nor authenticates. Across the Internet it is combined with IPsec, applied with tunnel protection ipsec profile ….

GRE has no port numbers, so it does not pass through port-based address translation, and firewalls must permit IP protocol 47 explicitly.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

GRE tunnels in operation

A GRE tunnel is a virtual point-to-point link that carries packets inside IP between two routers. RFC 2784 defines the encapsulation. GRE uses IP protocol 47. Its header holds a protocol type (an EtherType such as 0x0800 for IPv4) and an optional checksum. After decapsulation, the inner packet's TTL is decremented and the packet is forwarded on its own destination. If that destination is the tunnel source itself, the packet is discarded to prevent loops.

Typical uses

UseWhy GRE
Carrying routing protocols between sitesGRE carries multicast, which IPsec tunnel mode alone doesn't
Overlay over the Internet with IPsecGRE over IPsec, or IPsec VTIs
DMVPNmGRE plus NHRP for dynamic spoke-to-spoke tunnels
Carrying IPv6 over IPv4GRE with protocol type 0x86DD
ERSPANMirrored traffic in GRE

Configuration essentials

ItemSetting
Source and destinationStable addresses, often loopbacks
Tunnel addressing/30 or /31 on the tunnel interface
IP MTU1476 for plain GRE over IPv4; lower with IPsec (about 1400)
TCP MSS40 below the IP MTU (ip tcp adjust-mss 1436 for plain GRE)
Keepaliveskeepalive 10 3, so the interface goes down when the far end is unreachable

Recursive routing

If the route to the tunnel destination is learned through the tunnel itself, the tunnel flaps ("recursive routing"). Make sure the tunnel destination is reached through the underlay. Use a static route or filter the destination out of the routing protocol running over the tunnel.

R1(config)# interface Tunnel10
R1(config-if)# ip address 172.31.10.1 255.255.255.252
R1(config-if)# ip mtu 1476
R1(config-if)# ip tcp adjust-mss 1436
R1(config-if)# keepalive 10 3
R1(config-if)# tunnel source Loopback0
R1(config-if)# tunnel destination 203.0.113.20
R1# show interfaces Tunnel10 | include line protocol|Tunnel source|protocol/transport|MTU
  Tunnel10 is up, line protocol is up
  Tunnel source 198.51.100.2 (Loopback0), destination 203.0.113.20
  Tunnel protocol/transport GRE/IP
R1# show ip route 203.0.113.20
%TUN-5-RECURDOWN: Tunnel10 temporarily disabled due to recursive routing

Security (RFC 2784)

GRE adds no encryption or authentication. Firewalls must allow protocol 47, and they see only the outer headers unless they terminate or inspect the tunnel. The RFC suggests terminating tunnels at the firewall where filtering matters.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

GRE is the simplest way to create a virtual point-to-point link across an IP network. It is used to carry routing protocols and multicast between sites, to tunnel traffic through networks that should not see the inner addresses, and as the base for DMVPN. GRE adds no security by itself — combined with IPsec it provides encryption, while GRE provides the routable interface.

The two classic GRE failures:

SymptomCauseFix
Tunnel flaps with %TUN-5-RECURDOWNRoute to the tunnel destination learned via the tunnelStatic route to destination via physical path, or filter it
Small packets work, large transfers hangMTU/fragmentationip mtu 1400, ip tcp adjust-mss 1360

Keepalives make a tunnel go down when the far end stops answering, so routing reacts; without them a GRE tunnel stays up as long as a route to the destination exists.

show interfaces Tunnel10 | include line protocol|MTU|keepalive
ping 172.31.10.2 size 1400 df-bit
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 2784

Authoritative/upstream documentation reviewed for bounded claims in Network & Protocols → GRE Tunnels. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc2784.html · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
gretunnelip protocol 47encapsulation
Confirmation

Confirm action

Continue?