Use it when a site-to-site tunnel must carry routing protocols or multicast, which plain IPsec cannot.
GRE over IPsec
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.
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
Operational reference
Fast context before you go deeper.
interface tunnel <id>Primary Commands
Configuration and operational commands for this Topic.
interface tunnel <id>ReferenceCreate or enter a tunnel interface.
Use when: Use this command at the Network Virtualization / Overlay boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. Healthy underlay reachability does not prove overlay mappings; an overlay mapping does not prove encapsulated forwarding.
Cisco IOS / IOS XE · mixedtunnel protection ipsec profile <name>ReferenceProtect a GRE tunnel with an IPsec profile.
Use when: Use this command at the IPsec / Site-to-Site VPN boundary in the documented evidence chain.
Quick note: Cisco IOS / IOS XE first. IKE established does not prove that the required traffic matches an IPsec SA or decrypts successfully.
Cisco IOS / IOS XE · mixedShow Commands
Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.
Verification & 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 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.
- 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.
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>andping <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
| Mode | Layout |
|---|---|
| Transport mode | Outer IP (tunnel endpoints) / ESP / GRE / original packet |
| Tunnel mode | New 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
| Need | Choose |
|---|---|
| Point-to-point, IPv4 or IPv6 payload, routing protocols | VTI: less overhead |
| Multipoint hub-and-spoke with spoke-to-spoke tunnels | GRE over IPsec as DMVPN (mGRE) |
| Non-IP payloads, or GRE keys for several tunnels between the same endpoints | GRE over IPsec |
| Third-party peers supporting only GRE + IPsec | GRE over IPsec |
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.
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.
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
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 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%Quick lookup tables
GRE over IPsec · operational reference
Compact state and interpretation boundaries for fast lookup.
| Layer | Canonical check |
|---|---|
| Underlay | Route to remote tunnel endpoint |
| GRE | Tunnel interface/address/counters |
| IPsec | SA state + encrypt/decrypt counters |
| Overlay | Routes and traffic through tunnel |