TNS
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
✓
Angular
0%
✓
Astro
0%
✓
Svelte
0%
✓
Vue.js
0%
✓
Other
0%
✓
I only use React
0%
✓
I don't use JavaScript
0%
DevOps / Networking / Security

OpenVPN or WireGuard? A Detailed Performance Breakdown

OpenVPN, while reliable, struggles with performance and complexity compared to WireGuard.
Nov 28th, 2024 6:00am by
Featued image for: OpenVPN or WireGuard? A Detailed Performance Breakdown
Photo by Dayne Topkin on Unsplash

OpenVPN has been a dominant player in the VPN space since its release in 2001. With a 23-year history, OpenVPN has proven to be a reliable and secure protocol. However, it has some downsides, particularly regarding performance and ease of use.

OpenVPN creates a secure tunnel between two endpoints using SSL/TLS for encryption. While robust, the protocol is complex and requires considerable resources to run efficiently. Setting up and managing OpenVPN can be cumbersome, especially for DevOps teams juggling multiple environments and configurations. It wouldn’t be the first time an OpenVPN server stopped working because the TLS certificates expired.

WireGuard, on the other hand, is the new kid on the block, having been introduced in recent years. What sets WireGuard apart from OpenVPN is its simplicity and efficiency. While OpenVPN relies on older, more complex cryptographic algorithms, WireGuard uses modern encryption that is both faster and more secure.

Unlike OpenVPN, WireGuard is integrated directly into the Linux kernel, meaning it operates at a lower level and with less overhead. This results in faster connection times and lower resource usage. One of the significant benefits of WireGuard is its minimal codebase — about 10% the size of OpenVPN’s — which reduces the attack surface and makes it easier to maintain and audit for security vulnerabilities.

The beauty of WireGuard is in its simplicity. Rather than managing complicated certificates, WireGuard uses a simple key pair exchange, which dramatically reduces the administrative burden. This makes it an excellent option for DevOps professionals who need a lightweight, easy-to-configure VPN solution.

Pros and Cons of OpenVPN and WireGuard

  1. Performance:
  • OpenVPN: Known for its stability but can be slow due to the overhead associated with SSL/TLS encryption.
  • WireGuard: Faster, thanks to its kernel-level integration and efficient encryption algorithms, with quicker connection times and less CPU usage.
  1. Complexity:
  • OpenVPN is more complex to configure, especially when integrating modern authentication protocols like OIDC or SAML. It requires manual certificate management.
  • WireGuard: Simple and lightweight. No need for complex certificate management. Uses key pair authentication for secure connections.
  1. Security:
  • OpenVPN: Still secure and regularly updated, but its large codebase means more potential vulnerabilities.
  • WireGuard: Smaller codebase, making it easier to audit and maintain. It uses modern encryption algorithms, reducing the risk of vulnerabilities.
  1. Use Case:
  • OpenVPN: A good choice for legacy systems or environments where compatibility with a wide range of devices is required.
  • WireGuard: Ideal for modern DevOps environments, offering simplicity, speed, and ease of use.

Demo: A Proprietary VPN Server Product Built on WireGuard

On a recent episode of The Cloud & DevOps Pod, we demonstrated a proprietary VPN server product built on WireGuard, designed to address some of the limitations they experienced with OpenVPN. Let’s look at the demo and how this product solves common VPN challenges. Key Features of the Proprietary VPN Server

  1. OIDC Integration:

Unlike traditional VPN setups that require manual certificate management, this VPN product integrates with modern identity providers like Azure AD, OneLogin, and Okta via OIDC. This makes it easier to manage user access without dealing with the complexity of certificates.

  1. User Management:

Through its integration with identity providers, the VPN server allows for seamless user onboarding and offboarding. Users can download their VPN configuration files directly after authenticating via OIDC, and administrators can easily suspend or revoke access when necessary.

  1. TLS Integration:

A feature of the management interface is the automatic integration with Let’s Encrypt for TLS certificates. This means that the VPN server can generate and manage HTTPS certificates without requiring manual intervention, making it much easier to maintain a secure setup.

  1. Lightweight and Efficient:

The product runs on small instances, such as ARM64 machines with minimal memory. This makes it an ideal solution for companies looking to save on cloud infrastructure costs without sacrificing performance.

  1. Quick Connection Times:

One of the most impressive aspects of the demo was the quick connection time. Unlike OpenVPN, where connections could take several seconds to establish, the WireGuard-based server connected almost instantly. This speed significantly benefits DevOps teams that frequently switch between environments.

Live Demo of the Product

During the demo, we walked through setting up the VPN server on a minimal instance, starting the necessary services, and connecting a client via WireGuard.

  1. Starting the Services:

The hosts first started the root service, which manages the WireGuard VPN interface, and then started the REST API, which handles user authentication. They noted the benefits of running services as non-root users for enhanced security.

  1. Generating Keys and Configurations:

Users can authenticate via OIDC and download their VPN configuration files while the VPN server is running. The client’s private keys are generated dynamically and removed after the configuration has been downloaded, ensuring no sensitive data is stored on the server.

  1. Connecting a client:

Once authenticated, the host connected a client using the official WireGuard app. The connection was established almost instantly, with minimal latency, even from different geographic locations.

  1. Security Considerations:

One notable feature is that the server does not store private keys, adding an extra security layer. Additionally, user access can be revoked in real-time by suspending or deleting their account in the identity provider.

Winner?

OpenVPN and WireGuard are viable VPN solutions, but WireGuard stands out as the superior choice for modern DevOps environments. Its simplicity, speed, and security make it an excellent option for teams looking to streamline their VPN setup without sacrificing performance. Our proprietary VPN server product built on WireGuard, as demonstrated in the podcast, showcases how a modern VPN solution can dramatically simplify user management and improve connection times, all while maintaining robust security standards.

For DevOps teams looking to reduce overhead and improve performance, WireGuard — and products based on it — offer a powerful alternative to traditional VPN solutions like OpenVPN.


This article is part of The New Stack’s contributor network. Have insights on the latest challenges and innovations affecting developers? We’d love to hear from you. Become a contributor and share your expertise by filling out this form or emailing Matt Burns at mattburns@thenewstack.io.

Group Created with Sketch.
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.