Networking · Virtualization & Overlays
GRE
Cheat sheet · https://pcornel.dk/topic.php?topic=697
Answer
GRE is a stateless IP encapsulation that creates a logical point-to-point tunnel and can carry routed payloads.
Remember
- GRE uses IP protocol 47, not TCP/UDP port 47
- Tunnel line protocol depends on local source and recursive reachability to the destination
- GRE adds overhead and can expose MTU, MSS and fragmentation problems
- GRE alone provides no encryption, integrity or peer authentication.
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>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.
Commands
show ip interface brief- Compact IPv4 interface/address/protocol state.
show interfaces tunnel <id>- Inspect tunnel state and endpoints.
ip address <address> <mask>- Assign an IPv4 address and mask to an interface.
interface tunnel <id>- Create or enter a tunnel interface.
tunnel source <interface|ip>- Set the tunnel source interface or address.
tunnel destination <ip>- Set the tunnel destination address.
tunnel mode gre ip- Use GRE over IPv4 as the tunnel mode (default).
show tunnel- Display tunnel interface state.
Verify in this order
tunnel source up → outer route to the destination (not via the tunnel) → GRE packets reach the far end → far end has the reverse tunnel → inner routes point into the tunnel → MTU fits
Where it usually breaks
underlay recursion → wrong endpoints/mode or protocol47 policy → MTU → missing inner/return route
GRE · operational reference
| GRE layer | Must be healthy |
|---|---|
| Underlay | Route to tunnel destination resolves outside tunnel |
| Tunnel | Source/destination and line protocol are correct |
| Overlay | Intended routes use tunnel path |
| MTU | Encapsulation overhead fits the real path |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=697