Use it to read GRE in a capture taken between the endpoints, and when packets arrive but the tunnel does not accept them.
GRE Header Evidence
A GRE packet is the original packet with two headers in front: a new IP header (protocol 47) to the other tunnel endpoint, and a 4-byte GRE header naming what is inside. Optional checksum, key and sequence fields add four bytes each.
1. Capture between the endpoints, filter gre — packets in both directions?
2. One direction only → the return path filters protocol 47, or the far end points elsewhere.
3. Packets arrive but the tunnel's input counter does not move → key or endpoints do not match the local tunnel.
4. Compare flags and key in both directions.
inner packet routed into the tunnel → GRE header with matching options and key → outer IP header, protocol 47, to the far endpoint → permitted on the path → accepted by the matching tunnel → inner packet routed on
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show interfaces Tunnel0Verification & 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 workflow Verify boundary
show interfaces Tunnel0
show interfaces Tunnel0 | include key|Key|keepalive|Checksumming
The interface view shows whether a key, checksums or sequencing are enabled and the keepalive setting, together with counters of packets in and out and input errors.
In a capture taken in the underlay, filter on gre or ip.proto == 47. Read the outer source and destination (the endpoints), the GRE flags and protocol type, the key if present, and then the inner packet's own addresses. To follow one conversation through the tunnel, filter on the inner addresses.
Known-good: GRE packets flow in both directions between the two endpoints, with the same flags and key each way and the expected inner protocol.
Step 2 Failure isolation workflow Narrow the fault
- GRE packets in one direction only. The return path filters protocol 47, or the far end's tunnel destination does not point back here.
- Packets arrive but the tunnel's input counter does not rise. They match no tunnel: the key differs, or source and destination do not mirror the local tunnel.
- One side has a key or checksums configured and the other does not. The headers differ and packets are dropped.
- The protocol type is not carried by the receiving tunnel. For example IPv6 into a tunnel with no IPv6 configured.
- Only keepalive-shaped packets appear. The tunnel is up at the GRE level and nothing is being routed into it.
- GRE packets are fragmented. The inner packets are too large for the path after encapsulation; lower the tunnel's MTU.
- Nothing passes a firewall that permits "all TCP and UDP". GRE is neither; protocol 47 needs its own rule.
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.
show interfaces Tunnel<n>— key, checksum and keepalive settings; packets in and out; input errors.- Capture filter
greorip.proto == 47— outer endpoints, flags, protocol type, key, inner addresses.
ReferenceWhat it is1 section · depth on demand
Mental model
A GRE packet is the original packet with two headers placed in front: a new IP header that carries it to the other end of the tunnel, and a short GRE header that says what kind of packet is inside.
ReferenceWhy it matters1 section · depth on demand
Why it matters operationally
In a capture taken between the tunnel endpoints, everything looks like traffic between two routers. The GRE header is what reveals the content — and its optional fields, the key in particular, must agree on both ends or packets are silently dropped on arrival.
ReferenceHow it works1 section · depth on demand
How it works
Layout.
| Part | Size | Contents |
|---|---|---|
| Outer IP header | 20 bytes | Source and destination: the tunnel endpoints. Protocol field = 47 |
| GRE header | 4 bytes, up to 16 with options | Flags and the type of the inner packet |
| Inner packet | The original packet, unchanged |
The GRE header.
| Field | Size | Meaning |
|---|---|---|
| C flag | 1 bit | A checksum field follows |
| K flag | 1 bit | A key field follows |
| S flag | 1 bit | A sequence number field follows |
| Version | 3 bits | 0 |
| Protocol type | 16 bits | What the inner packet is, using EtherType values |
| Checksum | 4 bytes, optional | Covers the GRE header and payload |
| Key | 4 bytes, optional | A number that must match on both ends |
| Sequence number | 4 bytes, optional | For detecting packets out of order |
Common protocol types:
| Value | Inner packet |
|---|---|
| 0x0800 | IPv4 |
| 0x86DD | IPv6 |
| 0x8847 | MPLS |
| 0x6558 | An Ethernet frame (used for Layer 2 over GRE) |
With no options, as in a plain Cisco tunnel, the header is four bytes and the total overhead 24. Each option adds four.
The key (tunnel key <number>) distinguishes several tunnels between the same pair of addresses and acts as a weak check against misdelivery. It is not a security feature — it is sent in clear. A packet whose key does not match the receiving tunnel's is discarded.
Keepalives have a recognisable shape: the router sends a GRE packet whose inner packet is itself a GRE packet addressed back to the sender, with protocol type 0. The far end unwraps the outer layer and simply routes the inner packet back.
On the way, only the outer header is looked at. The outer TTL decreases at each hop; the inner packet's TTL decreases once, as the tunnel counts as a single hop.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
GRE header fields
The GRE header is small. RFC 2784 defines it as a 4-byte minimum, plus an optional 4 bytes:
- C bit: when set, a checksum and a reserved field follow.
- Reserved0 bits: receivers discard packets where bits 1–5 are set, unless they support the older RFC 1701.
- Version: must be 0. Version 1 is the enhanced GRE used by PPTP.
- Protocol type: the EtherType of the payload, such as 0x0800 for IPv4.
The base specification has no key or sequence fields. RFC 2890 adds them back as extensions.
Header layout
| Field | Bits | Notes |
|---|---|---|
| C (checksum present) | 1 | Usually 0 |
| Reserved0 | 12 | Bits 1–5 must be 0 (otherwise RFC 1701 keys, sequence numbers, routing) |
| Version | 3 | 0 (1 = PPTP enhanced GRE) |
| Protocol type | 16 | EtherType of the payload |
| Checksum + Reserved1 | 16 + 16 | Only when C = 1 |
| Key (RFC 2890) | 32 | Optional; identifies flows or tunnels (used by mGRE and ERSPAN) |
| Sequence (RFC 2890) | 32 | Optional; ordering |
Common protocol types
| Value | Payload |
|---|---|
| 0x0800 | IPv4 |
| 0x86DD | IPv6 |
| 0x88BE | ERSPAN type II |
| 0x22EB | ERSPAN type III |
| 0x6558 | Transparent Ethernet bridging (Layer 2 over GRE) |
| 0x8847 | MPLS |
Overhead
| Encapsulation | Added bytes |
|---|---|
| GRE over IPv4, no options | 24 (20 IP + 4 GRE) |
| With a key | 28 |
| With a key and checksum | 32 |
| GRE over IPv6 | 44 |
analyst$ tshark -r gre.pcap -Y gre -T fields -e ip.src -e ip.dst -e gre.flags_and_version -e gre.proto -e gre.key | sort | uniq -c
812 198.51.100.2 203.0.113.20 0x0000 0x0800
40 10.255.0.11 10.99.0.40 0x1000 0x88be
analyst$ sudo tcpdump -ni eth0 -v -c 2 'ip proto 47'
IP (tos 0x0, ttl 254, id 0, offset 0, flags [DF], proto GRE (47), length 108)
198.51.100.2 > 203.0.113.20: GREv0, length 88: IP 10.110.0.64 > 10.40.0.20: ICMP echo request, id 3, seq 1, length 64
Reading the example
The first line is plain GRE carrying IPv4, with no flags set. The second has flag 0x1000, which is the sequence number present bit, and protocol 0x88be. That is ERSPAN type II, which uses GRE sequence numbers. Seeing both in one capture is normal on a switch that also mirrors traffic.
Documented example, not captured output.
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 Header Evidence. 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.