GRE and WireGuard can both carry a routed IPv4 address between two networks. The protocol choice changes the operating conditions around that route. GRE fits a link between stable public endpoints. WireGuard suits encrypted links and endpoints that sit behind a changing home connection, NAT, or CGNAT.
Start with the endpoint. A network operator with two public routers has a different constraint from someone exposing a home server through an outbound tunnel. The following comparison keeps that distinction visible, then covers the routing work shared by both options.
GRE and WireGuard carry packets differently
GRE is a standardized encapsulation format. It places a GRE header around a payload packet, then sends that packet inside an outer IP packet. IPv4 GRE uses IP protocol number 47. The base GRE specification covers encapsulation and forwarding. It has no encryption mechanism.
WireGuard creates a network interface with a peer relationship defined by public keys. Its encrypted packets are carried by UDP. On Linux, the wg utility sets peer keys, allowed IP ranges, and an optional endpoint, while normal IP tools assign addresses and routes to the interface.
47. WireGuard uses UDP. Both add an outer delivery packet around traffic from the routed network.That transport difference is immediately useful. Firewalls and NAT devices commonly understand UDP state. GRE needs the path to permit IP protocol 47, and a router performing translation must support it correctly. A GRE tunnel can work well on controlled infrastructure, though it needs more coordination at the network edge.
Choose WireGuard for encryption or a changing endpoint
WireGuard encrypts and authenticates packets between configured peers. Its public-key model gives each peer a distinct identity, and its UDP transport lets an inside endpoint open the tunnel outward. This is a practical fit for a home server, a branch connection with a changing public address, or a deployment where traffic must be protected over the transit network.
A peer behind NAT can use PersistentKeepalive = 25 when it needs to receive traffic after idle periods. WireGuard documents 25 seconds as a useful interval across many firewalls. The setting creates periodic UDP traffic from the inside peer, which keeps the stateful mapping available for the provider's reply traffic.
WireGuard still needs careful routing. The address assignment and return route need host configuration. Add the routed address where the provider specifies, then send traffic sourced from that address back through the WireGuard interface. The guide to a public IP for a home server shows the policy-routing pattern on Linux.
Choose GRE for a stable, controlled network link
GRE is often a straightforward option when both tunnel endpoints have stable public IPv4 addresses and the network path accepts protocol 47. It is widely implemented by network equipment and Linux. An operator can build the interface with the local and remote outer addresses, then place point-to-point tunnel addresses and routed prefixes on top.
ip tunnel add gre1 mode gre local 198.51.100.2 remote 198.51.100.10 ttl 255
ip link set gre1 up
ip address add 10.255.0.2/30 peer 10.255.0.1 dev gre1
These are documentation addresses. The actual outer addresses and tunnel addresses come from the provider. A static endpoint makes the configuration durable. A changing endpoint requires an update mechanism, and a CGNAT connection usually cannot receive the GRE protocol from the Internet at all.
GRE traffic is visible to the networks that carry it unless another protection layer is applied. Keep sensitive applications on a protected transport, use an encrypted overlay, or select WireGuard when the tunnel itself must provide confidentiality.
Compare the operating requirements
| Requirement | GRE | WireGuard |
|---|---|---|
| Tunnel transport | IP protocol 47. | UDP. |
| Encryption in the tunnel | No. | Yes, between configured peers. |
| Public endpoint | Stable public IPv4 is the usual deployment. | An inside peer can initiate outbound UDP. |
| CGNAT home connection | Usually unsuitable. | Suitable with an outbound tunnel and keepalive when needed. |
| Routed IPv4 | Supported when the provider routes it through the tunnel. | Supported when the provider routes it through the tunnel. |
| Key management | No encryption keys in base GRE. | Each peer has a public and private key. |
