tonia.ai · Concepts

Virtual Private Networks

A VPN makes a private network out of a public one by wrapping traffic in an encrypted tunnel between two trusted endpoints. It protects data in transit along that tunnel, and nothing else, so knowing exactly where the tunnel starts and stops is the whole game.

01The idea

Organizations once linked offices with leased lines: private, but expensive and inflexible. A VPN gets the same effect over the internet by giving each packet two properties it lacks on a shared network, confidentiality and integrity in transit, and by placing remote hosts logically inside the private address space.

Branch office10.1.0.0/16 gateway Headquarters10.0.0.0/16 gateway untrusted internet encrypted tunnel to the two networks, it behaves like one private link
The protection boundary is the two tunnel endpoints. Before and after them, traffic is as exposed as it always was.

02Tunneling and encapsulation

Tunneling places one complete packet inside another. The inner packet carries private addresses the internet cannot route; the outer packet carries the two gateways' public addresses so it can cross the internet. Encryption of the inner packet is what makes the tunnel private, not the tunneling itself. GRE, for example, tunnels without encrypting anything.

1. Original 10.1.4.7→10.0.2.9 TCP · payload 2. Encrypt + MAC ▒▒▒▒ ciphertext ▒▒▒▒ tag 3. Encapsulate 198.51.x→203.0.x ▒▒▒▒ ciphertext ▒▒▒▒ tag public gateway IPs real addresses and data hidden extra headers cost bytes: lower the inner MTU or large packets fragment and stall
An observer sees only gateway-to-gateway traffic: its timing, size, and volume, but not who inside is talking or about what.

03Site-to-site vs remote access

Site-to-site Remote access office Amany hosts office Bmany hosts gateway ↔ gateway always on · hosts unaware usually IPsec tunnel mode corporatenetwork concentrator homehotelcafé client software · per-user login · on demand
Site-to-site trusts a network; remote access trusts a user on a device you may not fully control.
Site-to-siteRemote access
EndpointsTwo fixed gatewaysIndividual device to a concentrator
Who authenticatesThe gateways (certs or PSK)The user and ideally the device
Main riskOne compromised site reaches every other siteStolen credentials, infected or unmanaged endpoints
Key controlFirewall rules between sites, not just a flat tunnelMFA, device posture checks, least-privilege access

04IPsec, TLS, and WireGuard VPNs

IPsec / IKEv2

Network layer, transparent to applications. Standard for site-to-site and built into most OSes. Powerful but complex to configure; NAT needs UDP encapsulation.

TLS ("SSL") VPN

Rides on TLS, often over TCP/UDP 443, so it passes most firewalls. Either a full tunnel client (OpenVPN, AnyConnect) or a clientless browser portal to specific apps.

WireGuard

Roughly 4,000 lines of kernel code, one fixed modern cipher suite, keys tied to peers like SSH. Fast, auditable, formally analyzed, but no negotiation and no built-in user directory.

IPsecTLS VPNWireGuard
Layer3 (IP)4–73 (over UDP)
Crypto agilityNegotiated suitesNegotiated suitesFixed: Curve25519, ChaCha20-Poly1305
Firewall traversalUDP 500/4500, ESP443, rarely blockedOne UDP port
Granular app accessNetwork-widePer app (portal mode)Network-wide
Code size / auditLargeMediumSmall

PPTP and L2TP without IPsec are legacy options: PPTP's MS-CHAPv2 authentication can be broken offline and should never be used.

05Authentication: the real perimeter

A VPN with a stolen password is a private network for the attacker. The tunnel's encryption is rarely what fails; the login is.

Remote-access VPN credentials are among the most targeted assets on the internet. The 2021 Colonial Pipeline ransomware intrusion began with a legacy VPN account protected only by a password and no MFA.

Phishing-resistant MFA

FIDO2/WebAuthn or certificate-based login. Push and SMS codes help but can be phished or fatigued.

Device identity

A machine certificate in a TPM proves the connection comes from a managed laptop, not just someone with the password.

Posture checks

Verify patch level, disk encryption, and endpoint protection before granting access.

Account hygiene

Disable dormant accounts, centralize identity (SAML/RADIUS), log and alert on unusual logins.

06Split tunneling and leaks

A full tunnel sends all traffic through the VPN. A split tunnel sends only corporate destinations through it and everything else straight to the internet. Split tunneling saves bandwidth and latency, but it makes the laptop a bridge between an untrusted network and the corporate one.

Full tunnel Split tunnel laptop corp gateway corp apps internet corporate filtering sees everything laptop corp gateway internet malware on the direct path can pivot into the tunnel
Neither is universally right: split tunneling is acceptable when endpoints are well protected and corporate access is narrowly scoped.

Leaks

Even "full" tunnels leak when the operating system routes some traffic around them: DNS queries to the local resolver, IPv6 when only IPv4 is tunneled, or routes injected by a hostile local network. Research such as TunnelCrack and TunnelVision showed attackers on the same Wi-Fi can force traffic outside the tunnel on many clients.

07Topologies at scale

Hub and spoke Full mesh hub n tunnels · simple policy · hub is a bottleneck n(n−1)/2 tunnels · direct paths · complex
Large networks often mix both: a hub for policy, dynamic spoke-to-spoke tunnels for performance, or an overlay mesh managed by a central controller.

Modern mesh tools (WireGuard-based overlays and SD-WAN) automate key distribution and NAT traversal, so a mesh no longer means hand-configuring every pair.

08The VPN as an attack surface

A VPN concentrator is, by design, an internet-facing device that grants internal network access. That makes it one of the most valuable targets an organization has. Over the past several years, pre-authentication vulnerabilities in widely used commercial VPN and remote-access appliances have been exploited at scale, often within days of disclosure and sometimes before.

Patch fast

Treat the VPN gateway as the highest-priority patch target; subscribe to vendor advisories and the CISA KEV catalog.

Minimize exposure

Disable unused portals and features; restrict the management interface to an internal network.

Assume breach

Segment what VPN users can reach and monitor the gateway's own logs and integrity, not just user sessions.

Consumer VPNs are a different product

Commercial "privacy VPNs" move trust from your ISP to the VPN provider, which sees all your traffic. Measurement studies have found clients that leak traffic, inject content, mislabel server locations, or request excessive permissions.

09Beyond VPNs: zero-trust access

A traditional VPN authenticates once and then places the user on the network, where they can reach anything routing allows. Zero-trust network access (ZTNA) inverts this: every request to every application is authenticated and authorized, using user identity, device health, and context, and nothing else on the network is reachable.

VPN: network access ZTNA: per-app access user HRwikidbadmin all reachable user policyengine wiki ✓ db ✗admin ✗ apps are invisible unless policy grants each one
ZTNA does not eliminate encrypted tunnels; it shrinks what each tunnel can reach to one application at a time.

VPNs remain the right tool for site-to-site links and for protocols that need full network access; ZTNA increasingly replaces them for user-to-application access.

10Common misconceptions

MythA VPN makes me anonymous and secure online.
RealityIt protects the path to the VPN server only. Beyond it, traffic is as visible as ever, and the provider sees everything.
MythAll VPNs are equally secure.
RealityProtocol, cipher, authentication, and implementation differ enormously. PPTP is broken; unpatched appliances are open doors.
MythInside the VPN means trusted.
RealityA VPN user can be a phished account or an infected laptop. Segment and monitor VPN traffic like any other.
MythEncryption makes the VPN too slow to use.
RealityModern ciphers run at line rate. Latency usually comes from routing everything through a distant hub.

—References

Peer-reviewed

  1. Donenfeld, J. (2017). WireGuard: next generation kernel network tunnel. NDSS. doi:10.14722/ndss.2017.23160
  2. Dowling, B. & Paterson, K. (2018). A cryptographic analysis of the WireGuard protocol. ACNS. doi:10.1007/978-3-319-93387-0_1
  3. Ikram, M. et al. (2016). An analysis of the privacy and security risks of Android VPN permission-enabled apps. ACM IMC. doi:10.1145/2987443.2987471
  4. Khan, M. T. et al. (2018). An empirical analysis of the commercial VPN ecosystem. ACM IMC. doi:10.1145/3278532.3278570
  5. Perta, V. et al. (2015). A glance through the VPN looking glass. PoPETs. doi:10.1515/popets-2015-0006
  6. Schneier, B. & Mudge (1998). Cryptanalysis of Microsoft's PPTP. ACM CCS. doi:10.1145/288090.288119
  7. Ward, R. & Beyer, B. (2014). BeyondCorp. ;login:, 39(6). usenix.org
  8. Xue, D. et al. (2022). OpenVPN is open to VPN fingerprinting. USENIX Security. usenix.org
  9. Xue, N. et al. (2023). Bypassing tunnels: leaking VPN client traffic by abusing routing tables. USENIX Security. usenix.org

Standards and guidance