What is a VPN tunnel? How tunneling and split tunneling work
A VPN tunnel is the encrypted connection between your device and a VPN server: each piece of your traffic is encrypted and wrapped inside a new packet addressed to the server, so the networks in between only see sealed packets going to one place. At the server, the wrapper comes off and your traffic continues to its real destination.
Two ideas make it work: encapsulation, which is the wrapping, and encryption, which is the sealing. Tunnel protocols such as WireGuard, IKEv2 with IPsec and OpenVPN are different ways of doing both.
What is VPN tunneling, step by step?
NIST's glossary describes a VPN as a network built "often by tunneling links of the virtual network across the real network." In practice, for every packet you send:
- Your device builds the original packet. It has your device's VPN address as the sender and, say, a website as the destination.
- The VPN encrypts it. The whole original packet, including where it is going, becomes unreadable.
- The VPN wraps it in an outer packet. The outer packet's sender is your real network address, and its destination is the VPN server.
- The outer packet crosses the internet. Your Wi-Fi, your provider and every router on the way only see your address talking to the server's address.
- The server unwraps and decrypts. It reads the original packet and sends it on to the website, from the server's own address.
The IKEv2 standard, RFC 7296, describes exactly this for a laptop connecting to a gateway. On each packet, it says, "the outer IP header will contain the source IP address associated with its current location," while "the inner IP header will contain the source IP address assigned by the security gateway." The outer destination is always the gateway; the inner destination is "the ultimate destination for the packet."
That inner and outer split is the tunnel. Anyone outside sees the outer header. Only the two ends see what is inside.
Encapsulation vs encryption
People often use "tunnel" and "encryption" as if they meant the same thing. They do not.
- Encapsulation is putting one packet inside another. On its own, it hides nothing. Some tunnels in networking carry traffic without encrypting it at all.
- Encryption is what makes the inner packet unreadable and tamper-evident. A VPN tunnel is useful for privacy because it does both.
WireGuard, for example, encrypts each packet with ChaCha20Poly1305, according to its protocol page, and uses Curve25519 for the key exchange. That combination means the inner packet can be read only by the server holding the right keys, and any change in transit is detected.
Tunnel protocols: WireGuard, IKEv2 and OpenVPN
A tunnel protocol is the rulebook both ends follow: how they agree on keys, how packets are wrapped, and how the connection survives a change of network. Three are common in VPN apps today.
WireGuard
WireGuard "securely encapsulates IP packets over UDP." It adds a network interface to your device, called wg0 on Linux, which in its own words "acts as a tunnel interface." Each side has a public key, and the connection is made by exchanging those keys, much like SSH. It is built to be small; the project says it aims to be "faster, simpler, leaner, and more useful than IPsec." It also handles roaming, so moving from Wi-Fi to mobile data does not have to drop the tunnel.
IKEv2 with IPsec
IPsec is a family of standards that protects IP traffic, and IKEv2 is the part that sets up the connection. RFC 7296 defines it: "IKE is a component of IPsec used for performing mutual authentication and establishing and maintaining Security Associations." The Security Associations then carry your traffic, usually using ESP, the Encapsulating Security Payload. IKE normally runs on UDP port 500, with UDP port 4500 also used, per the RFC. RFC 7296, from October 2014, advanced IKEv2 to an Internet Standard.
OpenVPN
OpenVPN's own how-to guide calls it "a full-featured SSL VPN that implements OSI layer 2 or 3 secure network extension using the industry standard SSL/TLS protocol." It runs over a single TCP or UDP port, which makes it flexible on networks that only allow certain kinds of traffic.
For how WireGuard and OpenVPN compare on speed, security and privacy, see WireGuard vs OpenVPN.
| WireGuard | IKEv2 / IPsec | OpenVPN | |
|---|---|---|---|
| Defined by | wireguard.com protocol paper | IETF, RFC 7296 | OpenVPN project |
| Runs over | UDP | UDP 500 and 4500 | TCP or UDP |
| Key exchange | Noise handshake, Curve25519 | IKE | SSL/TLS |
| Main idea | Small and simple | An IETF Internet Standard | SSL/TLS over one TCP or UDP port |
Full tunnel vs split tunnel
Once the tunnel exists, a second question remains: which traffic goes into it?
- Full tunnel: everything your device sends goes through the VPN.
- Split tunnel: only some traffic goes through the VPN, and the rest goes out over your normal connection.
Each protocol's own documentation shows both modes.
OpenVPN is split by default in a basic setup. Its routing guide says: "By default, when an OpenVPN client is active, only network traffic to and from the OpenVPN server site passes over the VPN." The redirect-gateway option changes that and "will cause all IP network traffic originating on client machines to pass through the OpenVPN server."
WireGuard decides with a setting called AllowedIPs. The WireGuard site explains that "when sending packets, the list of allowed IPs behaves as a sort of routing table." Its client example uses AllowedIPs = 0.0.0.0/0, a wildcard that sends all IPv4 traffic into the tunnel. A narrower list sends only matching traffic.
IKEv2 describes the same choice for remote workers. RFC 7296 says a laptop "might use this tunnel only to access information on the corporate network, or it might tunnel all of its traffic back through the corporate network."
That last example is where split tunneling comes from. Work VPNs often send only office traffic through the tunnel, so video calls and personal browsing do not load the company's connection.
What split tunneling is good for, and what to watch
In a consumer VPN app, split tunneling usually means picking apps or sites that skip the VPN. It is handy when:
- A banking or work app refuses to work over a VPN.
- You need a printer, TV or other device on your home network while connected.
- A game or video call needs the most direct route.
The trade-off is simple: anything outside the tunnel is exposed in the usual way. The Wi-Fi owner and your provider can see where it goes, and sites see your real IP address.
Watch DNS too. DNS is how your device turns a name like example.com into an address. OpenVPN's guide notes that with redirect-gateway on, "OpenVPN clients will route DNS queries through the VPN." With a split tunnel, lookups for the traffic outside the tunnel may go to your normal DNS server, which can reveal the sites you visit. If privacy is the goal, keep split tunneling to the few apps that need it, and check your setup with our guide on how to tell if your VPN is working.
A kill switch is the partner setting to all of this. It blocks traffic if the tunnel drops, so a full tunnel does not quietly turn into no tunnel.
Frequently asked questions
What is a VPN tunnel and how does it work?
It is an encrypted link between your device and a VPN server. Your device encrypts each packet, wraps it in an outer packet addressed to the server, and the server unwraps it and forwards it to its destination.
Is VPN tunneling safe?
A tunnel built with a current protocol and strong keys protects your traffic from the networks it crosses. It does not protect you from the sites you visit or from malware, and the VPN server itself can see where your traffic goes once it leaves the tunnel. See what does a VPN hide.
What is a VPN tunneling protocol?
It is the set of rules both ends use to agree on keys, encrypt and wrap packets, and keep the connection up. WireGuard, IKEv2 with IPsec and OpenVPN are the common ones.
Should I use split tunneling?
Use a full tunnel by default. Turn on split tunneling only for specific apps or devices that do not work over the VPN, and remember that their traffic is outside the tunnel.
Is a VPN tunnel quantum safe?
Standard WireGuard key exchange uses Curve25519, a classical algorithm. WireGuard's protocol supports an optional pre-shared key that it says is there "for, say, post-quantum resistance." More in is WireGuard quantum safe.
How Secria VPN builds its tunnel
Secria VPN uses a WireGuard tunnel with an ML-KEM-1024 post-quantum key added to every session, on by default. ML-KEM is the standard NIST published as FIPS 203. Every plan gets the same encryption, Free included, along with a kill switch, Stealth mode for networks that block VPN traffic, and DNS blocking that helps block ads and trackers. Servers are RAM-only: keys, configs and connection state are never written to disk. No activity logs: we do not record browsing, DNS queries or traffic contents.
Secria VPN Free works on iPhone, iPad, Mac and Android with a free Secria account, no card needed, on free servers in Frankfurt and Dallas, one device at a time. Paid plans, Secria VPN Plus at $7.99 a month or Secria Pro at $9.99 a month, add split tunneling, Multi-Hop, every location and 5 devices. See secria.me/vpn.
Secria fact-checks every post against primary sources. Spotted something wrong or out of date? Email hq@secria.me and we will correct it.