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.
GRE Tunnels
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.
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.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show dmvpnShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
show dmvpnShowLists DMVPN peers per tunnel interface: NBMA address, tunnel address, state and up/down time.
Use when: A DMVPN spoke has no connection to the hub or to other spokes.
Quick note: State UP is good. IKE points at IPsec, NHRP at registration with the hub. "show dmvpn detail" adds crypto details.
Cisco IOS / IOS XE · control plane · verifiesshow ip nhrpShowShows the NHRP mappings from tunnel IP addresses to NBMA (public) addresses.
Use when: Spokes cannot reach each other over DMVPN, or the hub has no entry for a spoke.
Quick note: On the hub, each registered spoke should appear as a dynamic entry. Static entries come from ip nhrp map.
Cisco IOS / IOS XE · control plane · verifiesVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 mtuandip tcp adjust-msson 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 · 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.
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.
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
| Use | Why GRE |
|---|---|
| Carrying routing protocols between sites | GRE carries multicast, which IPsec tunnel mode alone doesn't |
| Overlay over the Internet with IPsec | GRE over IPsec, or IPsec VTIs |
| DMVPN | mGRE plus NHRP for dynamic spoke-to-spoke tunnels |
| Carrying IPv6 over IPv4 | GRE with protocol type 0x86DD |
| ERSPAN | Mirrored traffic in GRE |
Configuration essentials
| Item | Setting |
|---|---|
| Source and destination | Stable addresses, often loopbacks |
| Tunnel addressing | /30 or /31 on the tunnel interface |
| IP MTU | 1476 for plain GRE over IPv4; lower with IPsec (about 1400) |
| TCP MSS | 40 below the IP MTU (ip tcp adjust-mss 1436 for plain GRE) |
| Keepalives | keepalive 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.
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:
| Symptom | Cause | Fix |
|---|---|---|
Tunnel flaps with %TUN-5-RECURDOWN | Route to the tunnel destination learned via the tunnel | Static route to destination via physical path, or filter it |
| Small packets work, large transfers hang | MTU/fragmentation | ip 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
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%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.