# Tutorial to set up WireGuard and protect your online privacy for €2 a month

> We show you how to protect your online privacy with a tutorial to set up WireGuard: the post-quantum VPN that beats OpenVPN
> By José Maldonado · Cybersecurity · 2026-05-26

Recently, the free software community celebrated the release of the stable version of WireGuard 1.0.20260223, along with the widespread adoption of tunnels with post-quantum resistance by default on the most widely used desktop platforms, a fundamental advance in the evolution of secure telecommunications. It should be borne in mind that in a global environment where managing our digital lives and the secure transfer of information require a zero-trust network infrastructure, traffic encryption has become an unavoidable priority.

This is where WireGuard emerges as a disruptive technological solution, consolidating itself as a secure network tunnel that operates at layer 3 of the OSI model, designed expressly to replace traditional, complex protocols such as IPsec and OpenVPN. And best of all, you can very easily install your own server to protect your digital life at all times and at minimal cost.

## Origins and design philosophy of the WireGuard protocol

The project was formally started in 2015 by security researcher and developer Jason A. Donenfeld, known in software development circles by the pseudonym "zx2c4". The tool's distinctive logo, a carved stone snake, was inspired directly by an archaeological depiction of the mythological serpent "Python", which the author saw during a visit to the museum at Delphi.

![](https://content.observatorioblockchain.com/wp-content/uploads/2026/05/jason-donenfeld.jpg)
***Jason A. Donenfeld, known in software development circles by the pseudonym "zx2c4"***

Curiously, the initial conception of this protocol did not come from standard corporate network or mass-market software design, but from the strict stealth and efficiency requirements needed to develop a kernel-level rootkit (a type of computer virus) written by Donenfeld himself.

The core requirements for that project were: high performance, absolute invisibility to network port scanning and structural simplicity, and they laid the doctrinal foundations of what WireGuard would become today. Yes, WireGuard was born with the idea of doing harm at the highest level, but its release as open source and its acceptance by the cypherpunk community turned it into the most powerful privacy tool we have now.

**[Is Florentino Pérez a cypherpunk? The connection between the Super League and Blockchain](https://observatorioblockchain.com/en/sociological-analysis/es-florentino-perez-cypherpunk-conexion-superliga-blockchain/)**

## Asymmetric cryptography: the heart of WireGuard

Unlike traditional network architectures that strictly separate the transport and routing layers, WireGuard introduces the concept of cryptokey routing.

This mechanism consists of directly and uniquely associating the allowed internal IP addresses of the private network with the cryptographic public keys of each of the nodes or peers on the network. The short static keys (based on elliptic curves, as in Bitcoin) act as host identifiers in a way similar to the behavior observed in the OpenSSH protocol.

When a packet is received, the tunnel interface verifies the cryptographic signature and checks the source IP address against the internal cryptographic routing table, guaranteeing highly efficient data filtering and delivery that is shielded against identity spoofing.

## Cross-platform support and integration into the system kernel

With this revolutionary idea, WireGuard's expansion was not long in coming. In fact, it has been characterized by an effort at direct integration within the kernel space (the most privileged space) of the main operating systems, thereby avoiding the performance losses suffered by applications that run in user space.

Thus, in March 2020, the protocol was officially accepted and integrated into the main branch of the Linux kernel, in version 5.6. This integration allows packet processing to be carried out at the operating system level optimally, drastically reducing latency times. In the Windows ecosystem, although initially it relied on generic virtual adapters, the later introduction of the native kernel driver called [**wireguard-nt**](https://github.com/WireGuard/wireguard-nt), in August 2021 transformed the protocol's speed on these systems.

## Reaching the UNIX ecosystem

On Unix operating systems of the BSD family, the development trajectory has followed rigorous methodologies that take advantage of each platform's native strengths:

*   **FreeBSD (used, for example, at Netflix)**: Native kernel integration was completed in FreeBSD 13. However, in recent updates such as FreeBSD 15.0, developers identified that the default route monitor used by generic Linux tools such as wg-quick generated anomalies when removing static routes from the local routing table. For this reason, the community recommends structuring the network interface using the native control files, avoiding tools such as wg-quick, and delegating device creation and address assignment directly to FreeBSD's base network system.
*   **OpenBSD (considered one of the most secure systems in the world)**: The proposal to incorporate kernel support was made by Matt Dunwoodie in May 2020, culminating in its official integration in June of the same year. OpenBSD stands out for doing entirely without external packages for its execution, allowing the native configuration file (/etc/hostname.wg0) to manage the WireGuard tunnel parameters. It is so good that it is the most reviewed and audited version of WireGuard of all.

## Comparative analysis: WireGuard versus OpenVPN

The choice between implementing WireGuard or keeping infrastructures based on OpenVPN lies in deep architectural differences that affect overall security and operational efficiency. One of the most significant contrasts lies in the size of its codebase.

OpenVPN, together with the OpenSSL libraries it relies on for tunnel management, accumulates hundreds of thousands of lines of source code, which exponentially increases the attack surface and makes exhaustive security audits far more difficult. By contrast, WireGuard's core is made up of fewer than 7,000 lines of code. This compact structure minimizes the likelihood of hidden memory overflow flaws and allows independent researchers to review its code comprehensively in a short time.

Additionally, WireGuard's non-conversational behavior notably optimizes the energy performance of mobile devices. While OpenVPN emits periodic control packets to verify the connection status, WireGuard remains completely silent when there is no active data ready to be sent. By not transmitting information unnecessarily, it prevents mobile network chips from waking from their low-power state, protecting the battery life of smartphones and laptops.

**[Meet Wasm: the technology that will speed up Blockchain 100 times](https://observatorioblockchain.com/en/blockchain/conoce-wasm-la-tecnologia-que-acelerara-blockchain-100-veces/)**

## Post-quantum cybersecurity and the Rosenpass integration

WireGuard's conventional cryptographic security is outstanding in the contemporary landscape, underpinned by the exclusive use of the Curve25519 elliptic curve for key exchange and ChaCha20-Poly1305 for symmetric data encryption.

However, the evolution of quantum computers represents a real threat to these public-key algorithms, which could be decrypted retrospectively by adversaries who store current encrypted traffic for later analysis. Faced with this critical scenario, the urgent need has arisen to harden digital asset communications using post-quantum cryptography methodologies.

The open source protocol [**Rosenpass**](https://rosenpass.eu/) solves this vulnerability by acting as a post-quantum key exchange layer that operates in parallel with WireGuard. Developed in Rust and backed by formal security analysis, Rosenpass uses the Classic McEliece and Kyber (ML-KEM) key encapsulation mechanisms (KEM) to offer high-level post-quantum security.

To do so, Rosenpass continuously generates a shared secret immune to quantum attacks and periodically injects it into WireGuard's pre-shared key (PSK) interface, updating that secret every two minutes. This hybrid security design preserves WireGuard's native data transmission speed while completely neutralizing attempts at future decryption using quantum computing technologies.

### Technical guide to deploying a server on the Netcup cloud

For system administrators and advanced users who want to centralize their browsing traffic under absolute control, deploying a virtual private server (VPS) on Netcup's infrastructure (a German company) is one of the most recommended options in the sector.

Netcup provides low-cost instances with optimal CPU performance and excellent bandwidth, ideal for sustaining the continuous flow of a private network, at a cost starting at about €2 a month. This makes it perfect for setting up services such as a VPN cheaply and securely, especially if you live outside the EU, and in countries where online dissent is actively persecuted.

**[Why your Anthropic shares on the blockchain could be worth nothing](https://observatorioblockchain.com/en/ai-agents/tus-acciones-de-anthropic-en-la-blockchain-podrian-no-valer-nada/)**

Now, the process we will discuss here is a bit technical, but we have synthesized and explained it in a way that is easy to follow for anyone with minimal computer and system knowledge. For our example we will use an Ubuntu Linux installation.

**[AI threatens cybersecurity: Chaos in Linux and software repositories](https://observatorioblockchain.com/en/cybersecurity/la-ia-amenaza-la-ciberseguridad-caos-en-linux-y-repositorios/)**

### Environment preparation and initial installation

After accessing the Netcup VPS console, the first thing you should do is update the system:

sudo apt update && sudo apt upgrade -y

Once this is done, you can install the tools to use WireGuard:

sudo apt install wireguard-tools

### Generating cryptographic keys

Next, you proceed to generate the public and private keys that will allow you to establish the secure cryptographic identity for both the Netcup server and the client node:

\# Generate server keys wg genkey | tee server-private.key | wg pubkey > server-public.key # Generate client keys wg genkey | tee client-private.key | wg pubkey > client-public.key

It is imperative to keep the confidentiality of the files with the .key extension to prevent unauthorized access to the encrypted network channel. This is because they are your server's private keys, and just like a Bitcoin private key, you must guard them jealously.

### Server node configuration

Now you should edit the configuration file of the network tunnel that will be created on the system, conventionally named **wg0.conf**

sudo nano /etc/wireguard/wg0.conf

Inside this file, you enter the following technical structure to enable the interface and define the authorized client peer:

\[Interface\] Address = 10.0.0.1/24 PrivateKey = <CONTENIDO\_DE\_SERVER\_PRIVATE\_KEY> ListenPort = 51820 SaveConfig = true # Routing and masquerading rules with IPTables for Internet egress PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE \[Peer\] PublicKey = <CONTENIDO\_DE\_CLIENT\_PUBLIC\_KEY> AllowedIPs = 10.0.0.2/32

The **PostUp** and **PostDown** directives ensure that the VPS's physical network interface on Netcup (generally eth0) acts as a masquerading gateway to redirect the client's traffic to the global public internet.

### Enabling IP traffic forwarding

For the server's Linux kernel to allow network packets to pass from the virtual wg0 interface to the physical network card, IPv4 packet forwarding must be explicitly enabled:

sudo nano /etc/sysctl.conf

In this file, you must locate and uncomment the following variable to enable forwarding at the kernel level:

net.ipv4.ip\_forward=1

Afterwards, the changes are applied to the system at runtime without the need to restart the Netcup server:

sysctl -f /etc/sysctl.conf

At this point, your WireGuard server is ready to receive connections.

### Client node configuration

On the client device (such as a laptop, tablet or mobile phone), the corresponding WireGuard application is installed and the following configuration is set within a local network profile:

\[Interface\] PrivateKey = <CONTENIDO\_DE\_CLIENT\_PRIVATE\_KEY> Address = 10.0.0.2/32 DNS = 1.1.1.1 \[Peer\] PublicKey = <CONTENIDO\_DE\_SERVER\_PUBLIC\_KEY> AllowedIPs = 0.0.0.0/0 Endpoint = <IP\_PUBLICA\_DEL\_VPS\_NETCUP>:51820 PersistentKeepalive = 25

The AllowedIPs = 0.0.0.0/0 parameter is directly responsible for forcing all of the client's network traffic through the VPN's secure tunnel. The PersistentKeepalive = 25 value periodically sends small connection maintenance packets every 25 seconds to prevent intermediate routers or firewalls from prematurely closing the active session.

### Automation and service startup

Now you proceed to delete the temporary plain-text key files generated at the start of the process to safeguard the server's security. We recommend that before deleting them you save them outside the server and in a safe place.

rm server-public.key server-private.key client-public.key client-private.key

Finally, the tunnel interface is started and the operating system manager is instructed to automatically initialize the secure network interface after every restart of the Netcup server:

sudo wg-quick up wg0 sudo systemctl enable wg-quick@wg0

### Browse with peace of mind and privacy

And with that, you have now created a WireGuard server and client, which will allow you to browse the Web securely. How? For example, if you are in China, creating a WireGuard server in Europe can help you get around China's Great Firewall, thereby avoiding the censorship the government imposes on its citizens online.

This is possible because, although you are in China, by using WireGuard you encrypt your connection and connect directly to the server in Europe, and this server becomes your exit point, allowing you to browse the Internet without the Chinese government being able to know what you are viewing during your browsing sessions. Moreover, to the world it will appear that you are in Europe, but you are actually thousands of kilometers away. And that is just the beginning of having true online privacy.
