Sub topic 14
What a VPN does and does not protect
This chapter assumes you know what a tunnel is, how split and full tunnelling change the routing table, and the basics of encryption and authentication. It covers the threats a VPN addresses and the ones it leaves alone.
Where the protection ends
A VPN protects the packets between two tunnel endpoints. Past the far endpoint, traffic travels as it did before. If you use a full tunnel from a café to a VPN server, the café network sees only encrypted packets to the server. Once the traffic leaves the server, the website's network can see it as ordinary traffic from the server's address.
Threats a VPN addresses
- Eavesdropping on the local path. Someone on shared Wi-Fi or at your ISP cannot read the tunnelled payload.
- Tampering on the path. Integrity checks cause modified packets to be dropped.
- Spoofed peers. Authentication means only holders of the right key or certificate can join.
- Exposed internal services. A site-to-site or remote-access VPN lets you keep internal services off the public internet.
- Source address visibility. The destination sees the VPN server's address instead of yours. This hides your location from the site, but not from the VPN operator.
Threats a VPN leaves untouched
| Threat | Why the VPN does not help |
|---|---|
| Malware on your device | The tunnel carries whatever the device sends, including malicious traffic. |
| Phishing | A fake site is just as fake over a tunnel. |
| Account tracking | Cookies and logins identify you regardless of your IP address. |
| Browser fingerprinting | Fonts, screen size and headers do not change. |
| A malicious or logging VPN provider | The provider sees your destinations and, for unencrypted traffic, the content. |
| Traffic analysis | Packet sizes and timing still show patterns, even when the content is hidden. |
| Compromised endpoint inside the VPN | A remote-access VPN puts you on the internal network, so a stolen laptop becomes an internal attacker. |
Traffic to an HTTPS site is still protected by TLS beyond the VPN server. The VPN adds a layer, but it does not replace end-to-end encryption.
Leaks and trust shifts
Using a VPN moves trust from your local network and ISP to the VPN operator. Choose that trade deliberately.
Traffic can also bypass the tunnel. Common leaks:
- Split tunnelling. Traffic outside
AllowedIPsor the pushed routes goes out directly. - DNS leaks. Queries go to the local resolver instead of the VPN's resolver, which reveals the sites you visit.
- IPv6 leaks. The tunnel covers only IPv4, so IPv6 traffic goes out directly. The WireGuard full-tunnel setting
AllowedIPs = 0.0.0.0/0, ::/0avoids this. - Tunnel drops. If the tunnel goes down and the default route reverts, traffic silently flows unprotected unless a kill switch (a firewall rule blocking non-tunnel traffic) is in place.
You can check for leaks by comparing what the outside world sees with and without the tunnel:
# Public address seen by a remote service (should be the VPN server's address)
curl -4 https://ifconfig.me
# Which interface and gateway would be used for a destination
ip route get 1.1.1.1
# Which DNS servers are in use
resolvectl statusChoosing based on the threat model
State the threat first, then pick the tool. For untrusted Wi-Fi, a full tunnel to a server you trust is enough. For reaching internal services, a split tunnel with strict firewall rules on the VPN subnet limits what a compromised client can reach. If the goal is anonymity from the destination or from the provider, a VPN alone does not achieve it.
Exercise
You use a full-tunnel WireGuard VPN on café Wi-Fi and log in to a shopping site over HTTPS. Name one party that can still see which site you visit, and explain why a DNS leak would make this worse.
Show answer
The VPN provider can see the destination, because your traffic exits from its server. If DNS queries leak outside the tunnel, the café network or its resolver also sees every domain name you look up, even though the page content stays encrypted.