GRE tunnel
also: Generic Routing Encapsulation, GRE
A GRE (Generic Routing Encapsulation) tunnel is a networking protocol that encapsulates packets from one network inside another, creating a virtual point-to-point connection between remote networks or hosts.
GRE is a lightweight tunneling protocol that wraps data packets (the payload) inside GRE headers and IP packets for transport across an intermediate network. This allows you to create virtual network links between distant locations, making remote networks appear directly connected even though they communicate through the public internet or other networks.
GRE tunnels are commonly used to connect private networks across the internet, support legacy protocols that aren't normally routable, or create point-to-point links for routing protocols like OSPF. For example, you might use a GRE tunnel to connect a branch office network to a headquarters network securely across the internet backbone.
On Linux, GRE tunnels are typically configured using ip tunnel commands or through network configuration files. Unlike IPsec, GRE does not provide encryption by default, so it's often paired with IPsec (creating an IPsec/GRE combination) when security is required.