EXAMTOPICS / TECHNOLOGY INSIGHTS

GRE over IPsec on Cisco Routers: Configuration and Troubleshooting

A point-to-point GRE tunnel can carry routed traffic and multicast-dependent routing protocols between Cisco routers, but GRE does not encrypt its payload. IPsec can provide confidentiality, integrity, and peer authentication for that traffic. The essential design decision is where encryption occurs in relation to GRE encapsulation. Treating “IPsec over GRE” and “GRE over IPsec” as interchangeable can produce an unprotected tunnel or an access list that never matches the packets it is supposed to secure. In Cisco CCNP Enterprise 300-410 ENARSI-level tunnel troubleshooting, prove the GRE interface, tunnel destination reachability, IPsec security associations and protected packet counters as separate checks.

The established Cisco design used in the procedure below is GRE protected by IPsec: the originating router wraps an original packet in GRE and then IPsec protects the GRE packet for travel across the untrusted WAN. Some documentation calls that GRE over IPsec. In contrast, encrypting a payload with IPsec before placing that encrypted packet inside GRE is a different encapsulation order and is not what the tunnel-protection procedure below configures. The existing article title uses historical terminology; changing the published title or slug is a separate metadata decision.

1. Decide what must cross the tunnel and what must stay on the WAN

Consider two branches. Router R1 serves 10.10.10.0/24 and Router R2 serves 10.20.20.0/24. Their public-facing interfaces have working underlay connectivity, while Tunnel10 uses 10.255.0.1/30 and 10.255.0.2/30 for overlay addressing. In illustrations, 198.51.100.1 and 203.0.113.2 represent the WAN endpoints; both belong to documentation-only address ranges and are not reachable public Internet addresses.

Before creating the overlay, verify that each router can reach its peer’s real WAN endpoint via an ordinary physical or provider next hop. Underlay reachability is a prerequisite for IKE negotiation, GRE transport, and subsequent tunnel protection. A ping between the branch LANs is not an appropriate first check because it conflates underlay routing, GRE, IPsec, and the return path.

GRE makes multicast-capable routing exchanges possible across the logical link, which is useful when OSPF or EIGRP runs between sites. But the router must first have a reliable, independent path to the remote tunnel destination. Do not resolve the public IPsec peer through Tunnel10; that creates recursive tunnel routing and often causes the tunnel to oscillate.

2. Confirm the actual encapsulation and protection model

For the design here, the outbound logical sequence is: original LAN packet → GRE encapsulation using the WAN tunnel source and destination → IPsec protection of the GRE packet → physical WAN forwarding. The receiving router reverses that sequence. IPsec can protect traffic carried inside GRE, including routing updates, when the whole GRE packet is selected for protection. The claim that this construction necessarily encrypts only unicast data while leaving GRE routing updates in cleartext is incorrect.

Cisco supports more than one attachment model, subject to platform and software release. A tunnel protection ipsec profile applied under the GRE tunnel interface protects GRE packets with the referenced IPsec profile. In another design, a crypto map attached to an outbound physical interface selects the outer GRE traffic between the two WAN peers after GRE encapsulation. Applying a crypto map to the tunnel interface is not equivalent: it changes where crypto processing occurs and must not be copied into a standard GRE-protected-by-IPsec lab.

In the physical-interface crypto-map model, a selector that matches only branch LAN subnets or the inner tunnel /30 may fail to match the GRE packets seen on the WAN. A correctly scoped extended ACL should identify the intended protected flow at the relevant processing stage. Keep the two attachment models separate; the remaining steps use a tunnel protection profile, not a physical-interface crypto map.

3. Build and test GRE before relying on encryption

After documenting the underlay and tunnel addresses, create a point-to-point tunnel on each side. The illustrative interface fragments below show the GRE layer only. Interface names, addressing, VRF handling, and support for individual commands vary by Cisco platform. They must be adapted and verified against the exact IOS/IOS XE release before they are used in a real deployment.

! R1 — GRE layer only; NOT YET protected
interface Tunnel10
 description GRE overlay to R2
 ip address 10.255.0.1 255.255.255.252
 tunnel source GigabitEthernet0/0/0
 tunnel destination 203.0.113.2
 tunnel mode gre ip

! R2 — reciprocal GRE layer; NOT YET protected
interface Tunnel10
 description GRE overlay to R1
 ip address 10.255.0.2 255.255.255.252
 tunnel source GigabitEthernet0/0/0
 tunnel destination 198.51.100.1
 tunnel mode gre ip

This unprotected interim configuration belongs only in an isolated, authorized lab. Confirm that the tunnel endpoints are pointed at the expected WAN addresses, that show interface Tunnel10 reports the intended state, and that the overlay /30 can be reached when the lab permits GRE. Do not transport sensitive production traffic through unprotected GRE while waiting to finish IPsec configuration.

Then prove branch reachability over the overlay using a deliberate route, rather than a guessed default route. For example, a lab could point the remote 10.20.20.0/24 network toward 10.255.0.2 at R1 and the reverse toward 10.255.0.1 at R2. This is a case for static routes if the design is small; dynamic routing can be more appropriate when the sites exchange many prefixes. Verify the route in both directions, and confirm the WAN peer’s underlay host route never points through Tunnel10.

4. Create an IKEv2/IPsec profile appropriate to the platform

IKEv2 negotiates the peer relationship and cryptographic security associations; IPsec supplies packet protection. Select supported, current cryptographic algorithms and authentication appropriate to the platform and security policy, such as an approved AES-GCM proposal with certificate-based authentication where the environment supports it. The exact IKEv2 proposal, policy, keyring or trustpoint, peer-identity match, transform set, and IPsec-profile syntax must come from the platform’s current configuration guide. The deliberately incomplete fragment below is a configuration relationship, not a ready-to-run security policy.

! Conceptual IOS XE relationship; first define and validate
! IKEv2 peer authentication, identities and crypto proposals.
crypto ipsec profile GRE-IPSEC-PROFILE
 set transform-set YOUR_PLATFORM_APPROVED_TRANSFORM
 set ikev2-profile YOUR_VERIFIED_IKEV2_PROFILE

interface Tunnel10
 tunnel protection ipsec profile GRE-IPSEC-PROFILE

Do not paste placeholder values or weak sample keys into a production router. Where a pre-shared key is permitted, generate a unique high-entropy secret, protect its storage, and match peer identities explicitly. Consult the device’s release notes for supported transform combinations, dead-peer detection, rekeying, and IPsec profile behavior. The example intentionally avoids the old ISAKMP/IKEv1 Diffie–Hellman group-2 recipe and hard-coded demonstration password because those are poor defaults for a new secure deployment.

Apply the matching protected-tunnel configuration to both routers, with reciprocal peer identities, compatible negotiation parameters, and the correct WAN/tunnel addresses. Avoid mixing a tunnel-protection profile on one router with an unrelated crypto-map selector on the other. If VRFs are used, distinguish the transport or front-door VRF used to reach the peer from any inside VRF carrying tenant routes.

5. Route through the overlay without protecting the wrong traffic

The overlay route for a branch LAN should lead into Tunnel10. The route for the IPsec peer’s WAN address must leave on the real WAN interface. Check these paths separately using show ip route and the forwarding table. If a dynamic routing protocol is established over Tunnel10, ensure only the intended branch prefixes are exchanged and that its route selection cannot override reachability to the remote public endpoint.

A dynamic adjacency on Tunnel10 can exchange multicast hello packets because GRE transports them as part of its payload. With tunnel protection configured correctly, those exchanges travel inside the protected GRE flow over the WAN. Do not try to exempt the routing protocol from encryption on the assumption that routing control messages are harmless; they may expose topology and can be targets for injection or spoofing.

For a hub-and-spoke architecture or many dynamic tunnel endpoints, DMVPN introduces additional NHRP and multipoint GRE behavior. Its design and verification are different from the fixed two-peer Tunnel10 example here; copying a DMVPN NHRP command into this topology adds complexity without a benefit.

6. Prove that packets are actually encrypted

Start with a baseline: the underlay peer must be reachable, Tunnel10’s source and destination must be correct, and both peers must be running compatible IKEv2 and IPsec configurations. Generate a known stream of LAN-to-LAN traffic while recording the local and remote IPsec counters. On a supported Cisco IOS XE router, useful starting points are:

show interface Tunnel10
show ip route 203.0.113.2
show ip route 10.20.20.0
show crypto ikev2 sa
show crypto ipsec sa
show crypto session detail

Run reciprocal commands and substitute the actual peer and branch prefixes on the second router. An established IKE security association shows that peers authenticated and negotiated IKE; it does not prove the desired data packets are encrypted. Look for matching inbound/outbound IPsec security associations and increasing encapsulation and decapsulation counters while the intended branch flow runs. Interpret drops, anti-replay events, and rekey state alongside the packet counters.

If policy allows observation on the WAN, packet captures can help distinguish a protected ESP/UDP-encapsulated ESP flow from an unintended unencrypted GRE flow. Depending on NAT traversal, IPsec may use ESP protocol 50 directly or UDP 4500; IKE commonly uses UDP 500, with UDP 4500 when NAT traversal is active. Capture metadata should corroborate the SA counters and the expected endpoints, not be treated as proof that the correct inner application traffic was protected.

7. Troubleshoot in the order packets encounter dependencies

Underlay fails: If neither peer can reach the other’s WAN address, inspect the physical interfaces, neighbor adjacency, ISP route, WAN ACL, and NAT rules. A healthy tunnel cannot compensate for missing underlay reachability. In a firewall-controlled environment, confirm that IKE and the actual encapsulated IPsec transport are permitted between the correct public addresses.

GRE looks up but IPsec does not: Confirm the tunnel protection statement is attached to the intended interface and the referenced profile exists. Inspect IKEv2 authentication identity, proposals, transform set compatibility, time/certificate validity, packet filters, and whether NAT traversal is needed. Do not respond to a failed negotiation by enabling deprecated ciphers or disabling authentication checks.

IKE succeeds but protected counters remain flat: This is a selector or forwarding investigation, not a reason to assume encryption is working. Check whether test traffic truly traverses the tunnel, whether the route resolves to the correct interface, and whether the installed IPsec security associations correspond to the GRE flow. In a physical crypto-map design, inspect the outer GRE selectors and physical-interface application; in the tunnel-protection design, inspect the tunnel’s profile and software support.

One direction works but the return fails: Inspect both LAN routes, the reverse VPN association, NAT exemptions where applicable, stateful filters, and asymmetric WAN paths. The original request and reply must both traverse the intended security domain. A local tunnel-interface ping can succeed even when a remote branch host cannot return to the initiating LAN.

Small packets work, large packets fail: Calculate encapsulation overhead, inspect underlay MTU and path-MTU discovery, and consider an appropriate TCP MSS adjustment. GRE plus ESP and possibly UDP encapsulation consumes extra bytes. Do not hard-code a universal MTU or MSS because transform choice, IP version, NAT traversal, and WAN framing can change the overhead.

8. Verify operations after the first successful test

A secure GRE deployment needs more than an initial green tunnel state. Record the intended peer WAN addresses, tunnel addresses, cryptographic profile identifiers, expected routing protocols, protected prefixes, and a small set of known-good interface and SA counters. Repeat reachability and IPsec counter checks after reloads and during planned rekeys. Watch for tunnel recursion, frequent dead-peer events, persistent encapsulation/decapsulation imbalance, and unexpected unencrypted GRE traffic.

Capacity planning should include software crypto performance, CPU headroom, SA lifetime and rekey behavior, MTU-sensitive applications, and any failover path that could bypass protection. Hardware acceleration differs among router families; neither GRE nor IPsec guarantees line-rate forwarding without device-specific validation. If the tunnel carries dynamic routing, apply routing authentication and policy controls appropriate to that protocol, in addition to IPsec peer authentication.

The implementation test is straightforward: the underlay reaches only the configured peer through the WAN; the expected branch route resolves to the GRE overlay; IKEv2 authentication succeeds; and packet-by-packet test traffic causes the intended IPsec encapsulation and decapsulation counters to increase. That is the evidence for GRE protected by IPsec. It is not evidence for a distinct design that places already IPsec-encrypted packets inside GRE, which would require separate platform-specific configuration and a different packet-order analysis.