GRE
also: Generic Routing Encapsulation, GRE tunnel, GRE protocol
Generic Routing Encapsulation (GRE) is a tunneling protocol that encapsulates packets from one protocol inside another for transmission across networks, commonly used to create virtual point-to-point links.
GRE is a lightweight tunneling protocol defined in RFC 2784 that wraps (encapsulates) data packets from a source protocol inside GRE headers and an outer IP header, allowing them to traverse networks that may not natively support the original protocol.
GRE is stateless and connectionless, meaning it doesn't establish formal connections before sending data. It supports various payload types including IPv4, IPv6, and other protocols, making it useful for creating logical network topologies that span physical infrastructure.
A common use case is tunneling IPv6 traffic over an IPv4-only network: an IPv6 packet gets wrapped in a GRE header, then placed inside an IPv4 packet for transit, and unwrapped at the destination. GRE tunnels are often used alongside routing protocols like OSPF or BGP to build resilient multi-site networks.
In Linux, GRE tunnels are configured using tools like ip tunnel or ip link to create virtual tunnel interfaces, which then participate in normal routing just like physical network interfaces.