Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

GRE over IPsec

Direct answer

GRE over IPsec puts traffic into a GRE tunnel (which carries multicast and routing protocols) and protects it with IPsec; MTU and TCP MSS need adjusting for the added overhead.

When to use this

Use it when a site-to-site tunnel must carry routing protocols or multicast, which plain IPsec cannot.

First 30 seconds

1. GRE tunnel up? show interfaces tunnel <n>.

2. Protected? tunnel protection ipsec profile <name> on the tunnel; show crypto session.

3. show crypto ipsec sa — counters rise with tunnel traffic?

4. Routing adjacency over the tunnel up (show ip ospf neighbor)?

5. MTU: GRE + IPsec overhead → ip mtu 1400, ip tcp adjust-mss 1360.

Operational verification

GRE tunnel defined → protected by an IPsec profile → IKE and IPsec SAs up → routing protocol adjacency over the tunnel → routes point into the tunnel → MTU adjusted

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 commandinterface tunnel <id>
Scope / prerequisiteUse it when a site-to-site tunnel must carry routing protocols or multicast, which plain IPsec cannot.
Show · 1Reference · 2
What next?3 suggested next steps
Catalog command links3
Evidence0
On this pageJump to a specific section
Cisco IOS / IOS XE first

Primary Commands

Configuration and operational commands for this Topic.

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.

4 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 GRE over IPsec: bounded example and recovery Verify boundary

Use an isolated preconfigured pair with a reviewed IKE/IPsec policy and no production secrets in examples. Record exact inner flow, GRE route/interface, paired current IPsec counters and remote application result. Test both directions before a scoped failure.

Negative test: withdraw only the isolated inner test route, with no fallback carrying it, while leaving underlay/crypto intact. Expect that flow to stop selecting the GRE path without requiring SAs to disappear. Restore the route and verify paired deltas and service. Do not clear every SA or remove encryption to “show” connectivity. Restoring configuration still requires negotiation/convergence; this is not an executed crypto lab.

Step 2 Verification and output interpretation Verify boundary

Verify the underlay route to the remote tunnel endpoint first, then inspect the tunnel interface state and counters. Use show crypto session and show crypto ipsec sa to confirm negotiation/protection and to observe encapsulation/decapsulation counters increasing when real overlay traffic flows. Verify the overlay routing table separately and test a destination reached through the tunnel. If the tunnel interface is up but crypto counters are idle, the configured protection or interesting traffic path may not be active; if crypto counters increase but overlay destinations fail, move to tunnel addressing/routing and MTU. Packet size tests can reveal overhead-related black holes that ordinary small pings miss.

Step 3 GRE over IPsec: first failed boundary Narrow the fault

Work outward: inner route selects GRE, GRE packets match the intended protection, the SA encrypts them, outer ESP/NAT-T traverses the underlay, the peer decrypts, and GRE decapsulation delivers the inner packet. No IKE SA points toward outer transport/identity/proposal; IKE without usable IPsec points toward child policy/linkage. No encryption delta despite inner traffic suggests wrong route/protection match.

Local encryption without remote decryption needs outer-path/SA/error checks. Remote decryption without service needs GRE delivery, inner policy and return-path checks. Include encapsulation and encryption overhead in MTU reasoning; do not advertise one universal IPsec byte overhead.

Step 4 Verification & troubleshooting Narrow the fault

1. Verify peer underlay reachability and time/identity.

2. Verify IKE negotiation.

3. Compare selectors and proposals.

4. Generate controlled traffic.

5. Check encrypt/decrypt counters, drops, MTU and both directions.

Command lookup Jump straight to Cisco syntax
Key points
  • IKE SA and IPsec child SA are separate evidence boundaries
  • Proxy identities/selectors must agree at both peers
  • ESP commonly carries protected data; NAT traversal can encapsulate it in UDP 4500
  • Encaps and decaps counters must be interpreted with generated interesting traffic and the return path.
Key checks
  • show interfaces tunnel <n> — line/protocol state, source, destination, encapsulation, MTU.
  • show ip route <tunnel-destination> — the outer route used to reach the far end.
  • show ip interface brief | include Tunnel — tunnel address and status.
  • ping <far-tunnel-ip> and ping <tunnel-destination> source <tunnel-source> — inner vs outer reachability.
  • show ip route <inner-prefix> — inner traffic routed into the tunnel.
  • show logging | include TUN-5-RECURDOWN — recursive routing.
  • show crypto session — tunnel state per peer.
  • show crypto ikev2 sa / show crypto isakmp sa — IKE SA state.
  • show crypto ipsec sa — SAs, traffic selectors and encaps/decaps counters.
  • show crypto ikev2 proposal / show crypto ipsec transform-set — algorithms offered.
  • debug crypto ikev2 — negotiation errors (briefly).
ReferenceHow it works1 section · depth on demand

GRE over IPsec: observation versus configuration

Scope: IOS XE point-to-point IPv4 GRE with tunnel protection ipsec profile, IKEv2 and an explicitly reviewed IPsec transport/tunnel mode. Crypto-map attachment models are separate designs; do not mix their encapsulation order or selector assumptions into this example.

interface tunnel <id> is configuration entry. Read GRE interface/outer routes and actual protection linkage; for an IKEv2 design inspect show crypto ikev2 sa and show crypto ipsec sa at both endpoints. Correlate current peer/interface/SA with bounded GRE-carried traffic. Existing SAs or nonzero historical counters do not attribute this flow.

Reference: Cisco tunnel protection command reference. Verify the selected feature model and crypto mode on the deployed release before applying syntax.

ReferenceImportant terms & boundaries4 sections · depth on demand

In depth

GRE over IPsec: GRE's flexibility, IPsec's protection

GRE carries multicast, routing protocols and non-IPv4 payloads but adds no security. IPsec protects traffic but, as a crypto map, carries only unicast IP selected by ACLs. Combining them encrypts the GRE packets: the original packet is wrapped in GRE, and the GRE packet is protected by ESP. On IOS XE it's configured by adding tunnel protection ipsec profile to a GRE tunnel (tunnel mode gre ip), the same command Cisco's VTI guide uses for VTIs.

R1(config)# crypto ipsec transform-set TS-GRE esp-gcm 256
R1(cfg-crypto-trans)# mode transport
R1(config)# crypto ipsec profile GRE-PROF
R1(ipsec-profile)# set transform-set TS-GRE
R1(ipsec-profile)# set ikev2-profile SITE-B
R1(config)# interface Tunnel10
R1(config-if)# ip address 172.31.10.1 255.255.255.252
R1(config-if)# ip mtu 1400
R1(config-if)# ip tcp adjust-mss 1360
R1(config-if)# tunnel source GigabitEthernet0/0/0
R1(config-if)# tunnel destination 203.0.113.2
R1(config-if)# tunnel mode gre ip
R1(config-if)# tunnel protection ipsec profile GRE-PROF
R1# show interfaces Tunnel10 | include protocol|protection
  Tunnel protocol/transport GRE/IP
  Tunnel protection via IPSec (profile "GRE-PROF")

Packet layout

ModeLayout
Transport modeOuter IP (tunnel endpoints) / ESP / GRE / original packet
Tunnel modeNew IP / ESP / outer IP / GRE / original packet (about 20 bytes more)

Transport mode is enough for GRE over IPsec, because the GRE tunnel's outer addresses are already the IPsec peers. Note that the VTI guide requires tunnel mode for VTIs; transport mode is a GRE-over-IPsec option.

GRE over IPsec versus VTI

NeedChoose
Point-to-point, IPv4 or IPv6 payload, routing protocolsVTI: less overhead
Multipoint hub-and-spoke with spoke-to-spoke tunnelsGRE over IPsec as DMVPN (mGRE)
Non-IP payloads, or GRE keys for several tunnels between the same endpointsGRE over IPsec
Third-party peers supporting only GRE + IPsecGRE over IPsec

MTU

GRE (24 bytes) plus ESP adds about 70–80 bytes per packet. Set ip mtu and ip tcp adjust-mss on the tunnel so that encrypted packets fit the path MTU without fragmentation.

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 over IPsec combines a GRE tunnel, which carries multicast and therefore routing protocols, with IPsec encryption. Today this is usually configured as a GRE tunnel with tunnel protection ipsec profile, or replaced by a native IPsec VTI when multicast/non-IP is not needed.

crypto ipsec profile GRE-PROT
 set ikev2-profile IKEV2-PROF
interface Tunnel0
 tunnel source Gi0/0
 tunnel destination 198.51.100.2
 tunnel protection ipsec profile GRE-PROT
 ip mtu 1400
 ip tcp adjust-mss 1360

Documented example, not captured output.

Combined overhead is larger than either alone, so lower the tunnel MTU and MSS accordingly.

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

State model and protocol mechanics

GRE provides a logical point-to-point tunnel that can carry routed payloads and multicast/control traffic across an IP underlay. When protected by IPsec, the GRE packets themselves become the traffic selected for encryption/authentication, so the forwarding chain is inner packet → GRE encapsulation → IPsec protection → outer underlay routing. This layered design is useful when dynamic routing or multicast must traverse a secure site-to-site path. Each layer has independent state: the tunnel interface can be administratively/up based on source/destination reachability while IPsec SAs are absent, or IPsec can be established while overlay routing is incomplete. Encapsulation adds overhead from inner headers, GRE, IPsec and outer IP, reducing effective MTU.

Limits and common misconceptions

Tunnel up/up does not show encryption is active, and an established IPsec SA does not show the GRE overlay has correct routes. Underlay reachability must not depend recursively on the tunnel being built over it. A successful small ping is weak evidence for MTU-sensitive application traffic because combined encapsulation overhead can affect larger packets. GRE adds no confidentiality by itself; IPsec is the security layer. Conversely, IPsec tunnel mode without GRE has different multicast/routing behavior and should not be assumed equivalent. Keep underlay, GRE tunnel, IPsec SA, overlay routing and end application as explicit evidence layers.

ReferenceConfiguration & state1 section · depth on demand

Design and configuration model

Configure the tunnel source/destination against stable underlay addresses, assign overlay addressing as required, choose GRE tunnel mode, then apply an IPsec profile/tunnel protection method that protects the GRE transport. Ensure the underlay route to the remote tunnel endpoint exists independently of routes learned through the tunnel so recursive routing does not occur. Plan MTU/MSS for the combined GRE and IPsec overhead, especially for TCP applications that otherwise send near-1500-byte packets. Dynamic routing can run across the GRE interface once overlay reachability is established, but route policy must keep the outer endpoint reachable outside the tunnel. Document which layer provides reachability, which provides encapsulation and which provides cryptographic protection.

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 Virtualization & Overlays → IPsec → GRE over IPsec. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc2784.html · confidence 94%
Embedded reference data

Quick lookup tables

GRE over IPsec · operational reference

Compact state and interpretation boundaries for fast lookup.

LayerCanonical check
UnderlayRoute to remote tunnel endpoint
GRETunnel interface/address/counters
IPsecSA state + encrypt/decrypt counters
OverlayRoutes and traffic through tunnel
Confirmation

Confirm action

Continue?