WireGuard "kommer" til Linux-kernen — hvorfor?

I slutningen af juli foreslog udviklerne af VPN-tunnelen WireGuard et sæt patches, som vil gøre deres software til organisation af VPN-tunneler til en del af Linux-kernen. Den præcise dato for implementeringen af "ideen" forbliver dog ukendt. Under overskriften taler vi nærmere om dette værktøj.

WireGuard "kommer" til Linux-kernen — hvorfor?
/ фото Tambako The Jaguar CC

Kort om projektet

WireGuard er en next-gen VPN-tunnel skabt af Jason Donenfeld, leder af Edge Security. Projektet er blevet udviklet som en forenklet og hurtig alternativ til OpenVPN og IPsec. Den første version af produktet indeholdt kun 4.000 linjer kode. Til sammenligning har OpenVPN cirka 120.000 linjer, mens IPSec har 420.000.

Ifølge ifølge udviklerne har gjort WireGuard let at konfigurere, og sikkerheden af protokollen opnås gennem velafprøvede kryptografiske algoritmer. Når netværket skiftes: Wi-Fi, LTE eller Ethernet skal man hver gang genoprette forbindelsen til VPN-serveren. WireGuard-servere bryder derimod ikke forbindelsen, selvom brugeren har fået en ny IP-adresse.

Selvom WireGuard oprindeligt er designet til Linux-kernen, har udviklerne taget sig af og en portabel version af værktøjet til Android-enheder. Appen er stadig under udvikling, men man kan allerede nu prøve den. For at gøre det skal man blive en af testerne.

Generelt nyder WireGuard relativt stor popularitet og er endda blevet implementeret brugt af flere VPN-udbydere, såsom Mullvad og AzireVPN. Der er offentliggjort et stort antal vejledninger til opsætning af denne løsning. For eksempel der er guides, som brugerne laver, og der er guides, forberedt af projektets forfattere.

Tekniske detaljer

I den officielle dokumentation (s.18) nævner, at gennemstrømningen hos WireGuard er fire gange højere end hos OpenVPN: 1011 Mbit/s mod 258 Mbit/s. WireGuard overgår også den standard løsning for Linux, IPsec — den har 881 Mbit/s. Den overgår også den med hensyn til nem opsætning.

Efter nøgleudveksling (VPN-forbindelsen initieres næsten ligesom i SSH) og etablering af forbindelsen løser WireGuard selv alle andre opgaver: der er ikke behov for at bekymre sig om routing, overvågning af forbindelse osv. Yderligere indsats til opsætning er kun nødvendig, hvis man vil benytte symmetrisk kryptering.

WireGuard "kommer" til Linux-kernen — hvorfor?
/ фото Anders Hojbjerg CC

For installation, you'll need a Linux kernel distribution "older than" 4.1. You can find it in the repositories of major Linux distributions.

$ sudo add-apt-repository ppa:hda-me/wireguard
$ sudo apt update
$ sudo apt install wireguard-dkms wireguard-tools

As noted by the editors of xakep.ru, building from source is also straightforward. You just need to bring up the interface and generate the public and private keys:

$ sudo ip link add dev wg0 type wireguard
$ wg genkey | tee privatekey | wg pubkey > publickey

WireGuard does not use an interface to work with the cryptographic provider CryptoAPI. Instead, a stream cipher is used ChaCha20, cryptographic message authentication Poly1305 and proprietary cryptographic hash functions.

The secret key is generated using the Diffie-Hellman protocol based on the elliptic curve Curve25519. During hashing, the hash functions BLAKE2 og SipHash. Thanks to the timestamp format TAI64N , the protocol drops packets with lower timestamp values, thus preventing DoS- og replay attacks..

In this case, WireGuard employs the ioctl function for input/output control (previously used Netlink), making the code cleaner and simpler. You can verify this by looking at the configuration code..

The developers' plans

So far, WireGuard is an out-of-tree kernel module. However, the project's author Jason Donenfeld says, that the time has come for full integration into the Linux kernel. Because it is simpler and more reliable than other solutions. Jason has the support of even Linus Torvalds himself — he called the WireGuard code "a work of art." But no one is currently talking about the exact dates for the implementation of WireGuard into the kernel. And

hardly this will happen with the release of the August Linux kernel 4.18. However, there is a possibility that it will occur in the near future: in versions 4.19 or 5.0. Once WireGuard is added to the kernel, the developers

want to refine the application for Android devices and start developing an app for iOS. Additionally, they plan to finish the implementations in Go and Rust and port them to macOS, Windows, and BSD. A WireGuard implementation for more "exotic systems" is also planned: FPGA DPDK, , as well as many other interesting things. All of them are listed in theto-do list of the project authors. P.S. A few more articles from our corporate blog:

Cloud Technologies in the Financial Sector: Experience of Russian Companies

Hovedfokus for vores virksomhed er at tilbyde cloud-tjenester:

Virtuel infrastruktur (IaaS) | PCI DSS hosting | Cloud FZ-152 | SAP-hosting | Virtuel SAN | Datakryptering i skyen | Cloud-lagring

Kilde: habr.com

Køb pålidelig webhosting med DDoS-beskyttelse, VPS VDS-servere 🔥 Køb pålidelig webhosting med DDoS-beskyttelse, VPS VDS-servere | ProHoster