Pcornel
Networking · Virtualization & Overlays › IPsec

GRE over IPsec

Cheat sheet · https://pcornel.dk/topic.php?topic=700

Back to the Topic

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.

Remember

  • 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.

First 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).

Commands

interface tunnel <id>
Create or enter a tunnel interface.
tunnel protection ipsec profile <name>
Protect a GRE tunnel with an IPsec profile.
show crypto ipsec sa
Display IPsec SAs with encrypt/decrypt counters.
ip mtu
ip tcp adjust-mss
show crypto ikev2 sa
show crypto session

Verify in this order

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

Where it usually breaks

inner selection → GRE/protection mismatch → IKE/child policy → outer loss → remote inner/return path

GRE over IPsec · operational reference

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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=700

Confirmation

Confirm action

Continue?