What is WireGuard? Secure, simple VPN now part of Linux (2024)

Feature

The WireGuard VPN offers better performance and a simpler, effective approach to cryptography, and now it's built into Linux 5.6. Is it ready for the enterprise?

By Lucian Constantin

CSO Senior Writer, CSO |

What is WireGuard? Secure, simple VPN now part of Linux (2)

WireGuard definition

WireGuard is a security-focused virtual private network (VPN) known for its simplicity and ease of use. It uses proven cryptography protocols and algorithms to protect data. Originally developed for the Linux kernel, it is now deployable on Windows, macOS, BSD, iOS and Android.

Virtual private networks (VPNs) are indispensable to businesses. They link remote office branches to the main corporate network, they allow roaming employees to use internal company applications and enable cloud servers to be part of the same network as on-premises ones.

Most VPN solutions that exist today were designed a long time ago, so they’re quite slow and are overly engineered. Enter WireGuard, a project that puts security and simplicity first.

Security researcher and kernel developer Jason Donenfeld got the idea for WireGuard in 2017 while in need of a stealthy traffic tunneling solution that could be used during penetration testing engagements. The more he looked at the existing options, the more he realized that VPN tunnels like IPsec and OpenVPN did not perform well and were difficult to configure and manage properly.

So, he set out to create an entirely new VPN protocol and implementation that would avoid some of the design decisions that transformed other tunneling technologies into monster projects with huge code bases and countless knobs and switches.

How WireGuard’s cryptography works

For one, the WireGuard protocol does away with cryptographic agility -- the concept of offering choices among different encryption, key exchange and hashing algorithms -- as this has resulted in insecure deployments with other technologies. Instead the protocol uses a selection of modern, thoroughly tested and peer-reviewed cryptographic primitives that result in strong default cryptographic choices that users cannot change or misconfigure. If any serious vulnerability is ever discovered in the used crypto primitives, a new version of the protocol is released and there’s a mechanism of negotiating protocol version between peers.

WireGuard uses ChaCha20 for symmetric encryption with Poly1305 for message authentication, a combination that’s more performant than AES on embedded CPU architectures that don’t have cryptographic hardware acceleration; Curve25519 for elliptic-curve Diffie-Hellman (ECDH) key agreement; BLAKE2s for hashing, which is faster than SHA-3; and a 1.5 Round Trip Time (1.5-RTT) handshake that’s based on the Noise framework and provides forward secrecy. It also includes built-in protection against key impersonation, denial-of-service and replay attacks, as well as some post-quantum cryptographic resistance.

In the WireGuard protocol, each peer is identified to others through short public keys in a similar way to how key-based authentication works in OpenSSH. The public keys are also used to establish which IP addresses are assigned to each peer inside the tunnel as part of a new concept that WireGuard developers call cryptokey routing.

The protocol is also stealthy, as it does not respond to any packets from peers it doesn’t recognize, so a network scan will not reveal that WireGuard is running on a machine. Furthermore, the connection between peers, which can act as both clients and servers at the same time, go silent when there’s no exchange of data.

The WireGuard protocol has been reviewed by multiple teams of security researchers from the private sector and academia and has been formally verified in different computational models.

The main WireGuard implementation is for Linux and comes in the form of a kernel module. The code is intended to be easily auditable, with Donenfeld saying it can be read in an afternoon.

Compared to OpenVPN which has over 100,000 lines of code and depends on OpenSSL -- another huge codebase -- the WireGuard kernel module has around 4,000 lines of code and the crypto code is built into it. This means that it has a smaller attack surface compared to other VPN projects and, since it doesn’t respond to unauthenticated packets, it’s much harder to attack.

How well does WireGuard perform?

On Linux, WireGuard operates exclusively in kernel space, so its performance is much better than OpenVPN, which lives in userspace and uses a virtual network interface driver. Many of WireGuard benchmarks -- including on the project’s own website -- show up to four times better performance and connection speeds than OpenVPN and better speeds than IPsec-based VPNs on the same hardware.

However, WireGuard implementations for Android, iOS, macOS, OpenBSD and Windows are written in the Go memory-safe programming language. Aside from some community-supported Android firmware projects that integrated the WireGuard kernel module, the non-Linux WireGuard implementations run in userspace and don’t benefit from the same performance as the kernel implementation. That said, they still manage to match or outperform OpenVPN in most cases.

How WireGuard integrates into the Linux kernel

The WireGuard kernel module is available in the package repositories of all major Linux distributions and even some specialized ones. Starting with the Linux Kernel version 5.6, released on March 29, 2020, WireGuard is one of the technologies that are built in by default. This is also considered WireGuard's first stable release, or version 1.0.0.

"The last several weeks of 5.6 development and stabilization have been exciting, with our codebase undergoing a quick security audit, and some real headway in terms of getting into distributions," Donenfeld said in the release announcement. "We'll also continue to maintain our wireguard-linux-compat backports repo for older kernels."

Being part of the Linux kernel itself will not make WireGuard ubiquitous immediately, because some distributions will continue to use older LTS (long-term support) kernels. Embedded devices such as routers, which could benefit from the technology, are very slow to adopt new kernel versions. However, the installable WireGuard module is already available for the OpenWRT community firmware for routers, as well as for EdgeOS, the firmware used on Ubiquiti networking devices.

Donenfeld has been working to integrate WireGuard into the main Linux kernel since 2018. Progress has been slow because merging it required making significant changes to both the Linux kernel’s cryptographic API and the networking stack, but it received a favorable review from Linus Torvalds himself early on.

“I see that Jason actually made the pull request to have WireGuard included in the kernel,” Torvalds said on the Linux kernel mailing list in 2018. “Can I just once again state my love for it and hope it gets merged soon? Maybe the code isn't perfect, but I've skimmed it, and compared to the horrors that are OpenVPN and IPSec, it's a work of art.”

Donenfeld’s plans involved merging a new, simpler cryptographic API to the Linux kernel that he dubbed Zinc. According to him, Zinc would have made it easier for developers to perform cryptographic operations in their applications compared to using the kernel’s existing crypto API, which is overly complex for most use cases. In a presentation on Zinc, he described the Linux crypto API as a “super crazy ‘enterprise' API that is very prone to failure and overwhelmingly hard to use."

His attempts to merge a second crypto API was met with mixed responses from other kernel developers who raised various concerns regarding feature duplication and whether it was needed instead of fixing the problems with the existing API. The mailing list discussion about the Zinc patch submission stopped in April 2019, but another kernel developer later took on the task of integrating most of the Zinc features into the existing crypto API and the changes were merged into the kernel in November. Donenfeld accepted the compromise and was mostly satisfied with the result.

“It's not called ‘Zinc’ any more, and some of the design decisions I liked aren't there, but I think the lion's share of what we were after is there, and a few other pieces should be possible to upstream one at a time,” he said in a message to the WireGuard project’s mailing list at the time.

The integration of the Zinc cryptographic primitives marked an important step in the process of upstreaming WireGuard into the Linux networking subsystem. From then on, things moved relatively fast, with several reviews, bug fixes and changes in the course of a few months before the stable release.

Windows and a new TUN driver

To improve WireGuard performance on Windows, Donenfeld and the other WireGuard developers have created a new, simpler open-source TUN driver called Wintun. Windows doesn’t provide a native TUN virtual device and while some drivers exist to achieve this from projects such as OpenVPN or SoftEther, they were written a long time ago and have various issues.

“These projects were written in a different age, the era of NDIS5, and then ported later to NDIS6,” Donenfeld wrote in an email in March announcing the project. “This means they haven't benefited from things like Windows 7's NdisMediumIP, which allows for native layer 3 tunneling, without having to do layer 2 emulation. Drivers like OpenVPN's tap-windows6 also do some somewhat nasty things, like emulate DHCP from inside the kernel for network configuration. The code is old and complicated. As usual, I wanted instead something tiny and dumb that we can reason about, which does things in a ‘right’ and ‘boring’ way for a narrower use case: layer 3 TUN.”

Like Zinc and WireGuard itself, Wintun seems to be developed with the same focus on simplicity, auditability and security. Developers from the OpenVPN project are also working on adding support for OpenVPN to use it as an alternative to their old driver.

When will WireGuard be enterprise ready?

Even before reaching a stable version WireGuard was already being used in production. Some commercial VPN service providers offer WireGuard servers and there are ongoing efforts to build mesh networking tools around it. It is not yet “enterprise ready” and it’s unclear if it will ever be because its developers are reluctant to add new features that are only useful to a subset of users or cover edge cases because that’s how other projects became overly complex.

However, WireGuard can be a building block on top of which more complex solutions can be created. For example, enterprises need to deploy and configure new software on a large number of computers in an automated manner, but the distribution of public keys among peers and key management are not covered by the WireGuard project itself and will have to be implemented as a separate tool.

Related:

  • Communications Security
  • Security
  • Network Security

Lucian Constantin is a senior writer at CSO, covering information security, privacy, and data protection.

Follow

Copyright © 2020 IDG Communications, Inc.

7 hot cybersecurity trends (and 2 going cold)

What is WireGuard? Secure, simple VPN now part of Linux (2024)

FAQs

What is WireGuard VPN used for? ›

WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circ*mstances. Initially released for the Linux kernel, it is now cross-platform (Windows, macOS, BSD, iOS, Android) and widely deployable.

Is WireGuard VPN any good? ›

WireGuard is an excellent VPN protocol, but OpenVPN is still the best choice for the most privacy-conscious user. Surfshark supports both the WireGuard and OpenVPN protocols. Virtual private networks (VPN) use VPN protocols to create and secure your internet connection.

How to use WireGuard in Linux? ›

Procedure: Ubuntu 20.04 set up WireGuard VPN server ↑
  1. Step 1 – Update your system ↑ ...
  2. Step 2 – Installing a WireGuard VPN server on Ubuntu 20.04 LTS ↑ ...
  3. Step 3 – Configuring WireGuard server ↑ ...
  4. Step 4 – Set up UFW firewall rules to open required ports ↑ ...
  5. Step 5 – Enable and start WireGuard service ↑ ...
  6. Step 7 – Verification ↑
Jan 3, 2023

How do I know if WireGuard is installed Linux? ›

Once WireGuard is installed, you can check that the installation succeeded by running: wg , if you get no output it's all good. In order to check that the WireGuard kernel module has loaded you can run sudo modprobe wireguard .

What are the downsides of WireGuard? ›

Known Limitations
  • Deep Packet Inspection. WireGuard does not focus on obfuscation. ...
  • TCP Mode. ...
  • Hardware Crypto. ...
  • Roaming Mischief. ...
  • Identity Hiding Forward Secrecy. ...
  • Post-Quantum Secrecy. ...
  • Denial of Service. ...
  • Unreliable Monotonic Counter.

Does WireGuard hide your IP? ›

When you connect to our VPN server via WireGuard, your device can only see the IP address 10.2. 0.2, and the website you visit can only see the public IP address of our VPN server. Your true IP address remains secure and private, just as it would with OpenVPN.

Can WireGuard be hacked? ›

VPN services can be hacked, but it's extremely difficult to do so. Most premium VPNs use OpenVPN or WireGuard protocols in combination with AES or ChaCha encryption – a combination almost impossible to decrypt using brute force attacks.

Does WireGuard cost money? ›

WireGuard is a communication protocol and free and open-source software that implements encrypted virtual private networks (VPNs), and was designed with the goals of ease of use, high speed performance, and low attack surface.

Who supports WireGuard? ›

IPVanish is a top provider for those looking for a VPN with Wireguard support. It accesses popular sites like BBC iPlayer, Prime Video, and Netflix effortlessly and offers excellent connection speeds across over 2000 servers worldwide.

What is Linux WireGuard? ›

WireGuard is a security-focused virtual private network (VPN) known for its simplicity and ease of use. It uses proven cryptography protocols and algorithms to protect data. Originally developed for the Linux kernel, it is now deployable on Windows, macOS, BSD, iOS and Android.

Is there a WireGuard client for Linux? ›

WireGuard is an application that allows you to set up a secure virtual private network (VPN), known for its simplicity and ease of use. It uses proven cryptographic protocols and algorithms to protect data. Originally designed for the Linux kernel, it can be deployed on Windows, macOS, BSD, iOS and Android.

How do I access VPN on Linux? ›

How to set up a VPN on Linux with Network Manager
  1. Download our OpenVPN configuration files.
  2. Update your system and the Network manager.
  3. Import OpenVPN configuration files in the VPN settings.
  4. Connect to the VPN server, which settings you've just imported.
Sep 27, 2022

What is the default port for WireGuard? ›

The default port is 51820 , additional tunnels must use a different port. The GUI will automatically suggest the next highest available port. The private and public key pair for this WireGuard tunnel.

Is WireGuard free? ›

WireGuard is known for being secure, fast, and free, but it logs your IP address.

How do I know if WireGuard is enabled? ›

Double check that the WireGuard service is active with the following command. You should see active (running) in the output: sudo systemctl status wg-quick@wg0.service.

Does WireGuard have a firewall? ›

WireGuard VPN solves that by routing them through NG Firewall, where all of the same in-office network policies and protections are provided via a fast yet secure encrypted tunnel directly between your network and the user.

Does WireGuard need a public IP address? ›

The Peer – or server – configuration requires the server's public key, which is added here. The Endpoint is where you tell WireGuard where to find the server. Nothing will work without this one! That would require the server's public IP – or it's domain name – followed by the port you've chosen.

Does all traffic go through WireGuard? ›

Route the entire Internet traffic through the WireGuard tunnel. Routing your entire Internet traffic is optional, however, it can be advantageous in cases where you are expecting eavesdropping on the network. This may not only happen in insecure open Wi-Fi networks (airports, hotels, trains, etc.)

Can someone track your IP address with a VPN? ›

When you connect to the internet through a VPN, your ISP only knows that you're connecting to a VPN server. And when you're connected to a server, the service sees its IP address instead of your actual one, so your real IP address cannot be tracked.

Can someone see my IP through a VPN? ›

The best VPNs will not allow your IP to identify you. However, there are ways to identify VPN traffic: VPN IP address. The IP addresses of VPN servers aren't difficult to recognize — there are even databases specializing in VPN detection, that try to determine whether an IP belongs to a particular provider.

Can people see your IP address if you use a VPN? ›

No, a VPN cannot make you anonymous. They help secure what you're doing, but your ISP still knows when you're using the internet. They just can't see what you're doing, what sites you visit, or how long you've been on a site.

Can VPN hack your bank account? ›

A VPN is safe for online banking, but you should also take other precautions. If you don't have up-to-date antivirus software installed, your operating system is old, or you ignore virus alerts, you will still be at risk of being hacked even if you are using a VPN.

Does WireGuard change your IP address? ›

As discussed in previous sections, WireGuard relies on statically assigned tunnel IP addresses, while other protocols like OpenVPN and IPSec, can change the tunnel IP address on every connection.

Can a VPN be tracked? ›

There is no way to track live, encrypted VPN traffic.

That's why police or government agencies who need information about websites you visited have to contact your internet service provider (ISP for short), and only then your VPN provider.

Can I trust WireGuard? ›

WireGuard is extremely secure, but only when it's coupled with a solid VPN. WireGuard has its own state-of-the-art security protocols that ensure there are no data leaks or risks of cyberattack to its users.

Where is WireGuard located? ›

The config files are generally stored in /etc/wireguard folder. Create a new configuration file called wg0. conf in that folder. The configuration below will make your WireGuard server accept connections to 51820 and allow a client with the public key corresponding to the private key we made above.

Is WireGuard a site to site VPN? ›

This guide will show you how to connect two (or more) networks (not just clients) to each other via standard Linux machines and Wireguard VPN.

What's the best VPN for Linux? ›

Here are the best VPN apps for Linux.
  • NordVPN – hands-down best VPN for Linux. Based in: ...
  • Surfshark – the most affordable Linux VPN. Based in: ...
  • Atlas VPN – privacy-focused VPN for Linux. Based in: ...
  • ExpressVPN – well-performing and secure VPN for Linux. ...
  • IPVanish – overall affordable protection. ...
  • Pure VPN – reliable VPN for Linux.
Feb 10, 2023

How do I setup a WireGuard client in Linux? ›

Table of Contents
  1. Step 1: Enable IP Forwarding on the Server.
  2. Step 2: Install WireGuard on Ubuntu.
  3. Step 3: Configure WireGuard VPN Server on Ubuntu. ...
  4. Step 4: Enable and Start WireGuard VPN Service.
  5. Step 5: Install and Configure WireGuard Client.
  6. Step 6: Connecting the WireGuard Client to the Server.
  7. Conclusion.

Do I need a VPN with Linux? ›

A VPN is a great step toward securing your Linux system, but you'll need more than that for full protection. Like all operating systems, Linux has its vulnerabilities and hackers who want to exploit them. Here are a few more tools we recommend for Linux users: Antivirus software.

Is VPN free on Linux? ›

Safe unlimited VPN for Linux

Proton VPN is a free and unlimited VPN for Linux from the team that created Proton Mail, the world's most popular encrypted email service.

How to install free VPN in Linux? ›

Let us go through the steps now.
  1. Step 1: Checking to see which version of Ubuntu you have. ...
  2. Step 2: Updating System Apt Cache and Packages. ...
  3. Step 3: Installation of OpenVPN. ...
  4. Step 4: Installation of Network Manager Packages. ...
  5. Step 5: Download the OpenVPN Configurations. ...
  6. Step 5: Setting up the VPN.

How do I use WireGuard VPN on my router? ›

Go to Setup > Tunnels > and click the Add Tunnel button. Choose Enable and select WireGuard from the dropdown menu. Set the MTU value of the WireGuard tunnel to 1412 . Click the Generate Key button and go to the Client Area on the IVPN website to add the generated public key to the Key Management area.

What is WireGuard IP address? ›

WireGuard Configuration

We selected the 10.90. 90.1/24 IP address for the WireGuard interface. This can be any private IP address, as long as it doesn't conflict with the network you are on, so double check that. If it needs changing, don't forget to also change the IP for the WireGuard interface on the gateway server.

Do I have to port forward for WireGuard? ›

So any port forwarding setting in the router is not needed. However if you are running Mullvad directly on the router (with OpenVPN or WireGuard set up) and don't use the Mullvad app then you need to forward the Mullvad port from the VPN interface or zone to your computer that runs the service that you want to use.

Does WireGuard change your IP? ›

This means that for any traffic routed to the interface within an IP address in the range of 192.168. 200.0 to 192.168. 200.255, WireGuard will encrypt and reroute the traffic over a “real” network interface to the “real” remote address of 203.0.

How do I know if WireGuard is working? ›

To check if WireGuard Server is working properly

Then open the WireGuard app, import the WireGuard configuration from QR code. Enable the connection, check if the phone has Internet access and whether its IP address is the IP of your WireGuard Server.

Can hackers see you on VPN? ›

It depends on your VPN. Reliable VPN services prevent tracking altogether, even in those countries where ISPs are legally obligated to keep online activity logs. That said, sketchy and free VPN services will make it easier for you to get hacked. Many sell your data to advertisers and various third parties.

What IP address does WireGuard use? ›

WireGuard Configuration

We selected the 10.90. 90.1/24 IP address for the WireGuard interface. This can be any private IP address, as long as it doesn't conflict with the network you are on, so double check that. If it needs changing, don't forget to also change the IP for the WireGuard interface on the gateway server.

What ports does WireGuard use? ›

The port used by the peer for WireGuard traffic. The default port is 51820 if left empty. If the Endpoint is empty, this value is ignored.

What is WireGuard in Linux? ›

WireGuard is a security-focused virtual private network (VPN) known for its simplicity and ease of use. It uses proven cryptography protocols and algorithms to protect data. Originally developed for the Linux kernel, it is now deployable on Windows, macOS, BSD, iOS and Android.

How do I access WireGuard VPN? ›

Tunnel Configuration
  1. Navigate to VPN > WireGuard > Tunnels.
  2. Click Add Tunnel.
  3. Fill in the options using the information determined earlier: Enable. Checked. Description. Remote Access. Listen Port. 51820. Interface Keys. Click Generate to create a new set of keys. Interface Addresses. 10.6. 210.1/24.
  4. Click Save.
Jul 1, 2022

Top Articles
Latest Posts
Article information

Author: Edmund Hettinger DC

Last Updated:

Views: 6326

Rating: 4.8 / 5 (78 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Edmund Hettinger DC

Birthday: 1994-08-17

Address: 2033 Gerhold Pine, Port Jocelyn, VA 12101-5654

Phone: +8524399971620

Job: Central Manufacturing Supervisor

Hobby: Jogging, Metalworking, Tai chi, Shopping, Puzzles, Rock climbing, Crocheting

Introduction: My name is Edmund Hettinger DC, I am a adventurous, colorful, gifted, determined, precious, open, colorful person who loves writing and wants to share my knowledge and understanding with you.