All guides
Term

VPN

A technology that creates an encrypted tunnel over a public network to ensure secure data transmission.

VPN (Virtual Private Network) is a technology that creates an encrypted tunnel over a public network to ensure secure data transmission. By establishing a logical network layer over existing physical infrastructure, it isolates traffic through encapsulation and encryption, preventing unauthorized interception or modification. In hosting and DevOps environments, VPNs are used to link remote branch offices (Site-to-Site), grant administrators private access to internal servers, and protect traffic on untrusted networks.

How it works

When a VPN session begins, the client and server authenticate each other and negotiate shared cryptographic keys. Once established, the VPN client wraps each original IP packet inside a new outer packet—a process called tunneling—using protocols such as WireGuard, OpenVPN, or IPsec. The inner packet containing private payload data is encrypted, while the outer packet carries routing headers needed to traverse the public internet.

Modern WireGuard deployments rely on ChaCha20 for symmetric encryption and Poly1305 for authentication. Because it runs directly in the Linux kernel and uses a minimal codebase, WireGuard delivers lower latency and higher throughput than user-space OpenVPN or legacy IPsec stacks. For practical server sizing and protocol comparisons, see our Best VPS for Own VPN Server: Performance and Cost Data.

Example

A common DevOps setup uses WireGuard to restrict SSH and database access so internal ports are never exposed to the public internet. Below is a minimal server configuration (/etc/wireguard/wg0.conf) assigning an internal subnet and registering an authorized administrator peer:

[Interface]
Address = 10.200.0.1/24
ListenPort = 51820
PrivateKey = <server_private_key>

[Peer]
PublicKey = <client_public_key>
AllowedIPs = 10.200.0.2/32

With this interface active, firewall rules can block public port 22 and accept SSH connections exclusively from the 10.200.0.0/24 tunnel subnet.

What matters when choosing a server or hosting

When deploying a self-hosted VPN gateway on a VPS, hardware and network characteristics directly affect tunnel stability and speed:

  • Network throughput and peering: Unmetered or high-cap bandwidth with low-latency routing to your client locations prevents bottlenecks during large transfers. Regional routing quality matters heavily, as detailed in our Best VPN Server for Russia: Performance and Setup Data.
  • Virtualization type: KVM or dedicated instances allow loading kernel modules like wireguard directly, whereas restricted container virtualization (such as older OpenVZ) often forces slower user-space fallbacks.
  • CPU cryptographic support: Hardware acceleration (such as AES-NI for OpenVPN/IPsec or modern multi-core CPUs for ChaCha20) prevents encryption overhead from saturating a single vCPU.
  • IP reputation and dual-stack support: Clean IPv4 addresses and native IPv6 routing reduce false security blocks and prevent IPv6 traffic leaks.

To evaluate real-world server trade-offs before provisioning, review VPS for Your Own VPN: Hard-Won Performance and Cost Data.

Common mistakes

  • DNS and IPv6 leaks: Routing IPv4 traffic through the tunnel while leaving IPv6 or system DNS resolvers on the default public interface exposes browsing and query metadata.
  • MTU fragmentation issues: Encapsulation adds packet overhead; failing to lower the tunnel interface MTU (typically to 1420 for WireGuard) causes dropped packets and stalled HTTPS handshakes.
  • Overly broad AllowedIPs: Setting AllowedIPs = 0.0.0.0/0 when you only need private subnet access forces all public internet traffic through the VPN gateway, adding unnecessary latency.
  • Leaving management ports public: Deploying a VPN for administrative access without updating firewall rules to close public SSH or database ports defeats the isolation layer.

FAQ

What is the difference between split-tunnel and full-tunnel VPNs?

A full-tunnel VPN routes all client traffic through the VPN server, which is useful on untrusted public Wi-Fi. A split-tunnel configuration routes only specific internal subnets through the tunnel while sending regular internet traffic directly through the local ISP.

Should I choose WireGuard or OpenVPN for a self-hosted server?

WireGuard is generally preferred for modern Linux deployments due to faster throughput, simpler configuration, and faster roaming between networks. OpenVPN remains useful when TCP fallback on port 443 is required to bypass restrictive firewalls that block UDP.

Does a VPN replace application-level encryption like TLS?

No. A VPN encrypts traffic only between the client and the VPN gateway; once packets exit the tunnel onto the destination network, they rely on transport-layer security such as HTTPS/TLS to remain protected end-to-end.

All glossary terms

Glossary

Related terms

Full glossary

New guides every week.

A digest of the best pieces on servers, VPN and self-hosted software. No ads, no spam.

1 email a weekOne-click unsubscribeRU · EN
Only slipjar.app articles, nothing else.