什么是 WireGuard？为什么 Linux 用户为它疯狂？
WireGuard
从普通的 Linux 用户到 Linux 创建者 [Linus Torvalds](https://itsfoss.com/linus-torvalds-facts/)，每个人都对 WireGuard 很感兴趣。什么是 WireGuard，它为何如此特别？


### 什么是 WireGuard？


![](/data/attachment/album/202002/21/215945i6h6hs5qt5tb6hqv.png)


[WireGuard](https://www.wireguard.com/) 是一个易于配置、快速且安全的开源 [VPN](https://en.wikipedia.org/wiki/Virtual_private_network)，它利用了最新的加密技术。目的是提供一种更快、更简单、更精简的通用 VPN，它可以轻松地在树莓派这类低端设备到高端服务器上部署。


[IPsec](https://en.wikipedia.org/wiki/IPsec) 和 OpenVPN 等大多数其他解决方案是几十年前开发的。安全研究人员和内核开发人员 Jason Donenfeld 意识到它们速度慢且难以正确配置和管理。


这让他创建了一个新的开源 VPN 协议和解决方案，它更加快速、安全、易于部署和管理。


WireGuard 最初是为 Linux 开发的，但现在可用于 Windows、macOS、BSD、iOS 和 Android。它仍在活跃开发中。


### 为什么 WireGuard 如此受欢迎？


![](/data/attachment/album/202002/21/215947x5i5wldkw50jjuwp.png)


除了可以跨平台之外，WireGuard 的最大优点之一就是易于部署。配置和部署 WireGuard 就像配置和使用 SSH 一样容易。


看看 [WireGuard 设置指南](https://www.linode.com/docs/networking/vpn/set-up-wireguard-vpn-on-ubuntu/)。安装 WireGuard、生成公钥和私钥（像 SSH 一样），设置防火墙规则并启动服务。现在将它和 [OpenVPN 设置指南](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04)进行比较——有太多要做的了。


WireGuard 的另一个好处是它有一个仅 4000 行代码的精简代码库。将它与 [OpenVPN](https://openvpn.net/)（另一个流行的开源 VPN）的 100,000 行代码相比。显然，调试 WireGuard 更加容易。


不要因其简单而小看它。WireGuard 支持所有最新的加密技术，例如 [Noise 协议框架](https://noiseprotocol.org/)、[Curve25519](https://cr.yp.to/ecdh.html)、[ChaCha20](https://cr.yp.to/chacha.html)、[Poly1305](https://cr.yp.to/mac.html)、[BLAKE2](https://blake2.net/)、[SipHash24](https://131002.net/siphash/)、[HKDF](https://eprint.iacr.org/2010/264) 和安全受信任结构。


由于 WireGuard 运行在[内核空间](http://www.linfo.org/kernel_space.html)，因此可以高速提供安全的网络。


这些是 WireGuard 越来越受欢迎的一些原因。Linux 创造者 Linus Torvalds 非常喜欢 WireGuard，以至于将其合并到 [Linux Kernel 5.6](https://itsfoss.com/linux-kernel-5-6/) 中：



> 
> 我能否再次声明对它的爱，并希望它能很快合并？也许代码不是完美的，但我不在乎，与 OpenVPN 和 IPSec 的恐怖相比，这是一件艺术品。
> 
> 
> Linus Torvalds
> 
> 
> 


### 如果 WireGuard 已经可用，那么将其包含在 Linux 内核中有什么大惊小怪的？


这可能会让新的 Linux 用户感到困惑。你知道可以在 Linux 上安装和配置 WireGuard VPN 服务器，但同时也会看到 Linux Kernel 5.6 将包含 WireGuard 的消息。让我向您解释。


目前，你可以将 WireGuard 作为[内核模块](https://wiki.archlinux.org/index.php/Kernel_module)安装在 Linux 中。而诸如 VLC、GIMP 等常规应用安装在 Linux 内核之上（在 [用户空间](http://www.linfo.org/user_space.html)中），而不是内部。


当将 WireGuard 安装为内核模块时，基本上需要你自行修改 Linux 内核并向其添加代码。从 5.6 内核开始，你无需手动添加内核模块。默认情况下它将包含在内核中。


在 5.6 内核中包含 WireGuard 很有可能[扩展 WireGuard 的采用，从而改变当前的 VPN 场景](https://www.zdnet.com/article/vpns-will-change-forever-with-the-arrival-of-wireguard-into-linux/)。


### 总结


WireGuard 之所以受欢迎是有充分理由的。诸如 [Mullvad VPN](https://mullvad.net/en/) 之类的一些流行的[关注隐私的 VPN](https://itsfoss.com/best-vpn-linux/) 已经在使用 WireGuard，并且在不久的将来，采用率可能还会增长。


希望你对 WireGuard 有所了解。与往常一样，欢迎提供反馈。




---


via: <https://itsfoss.com/wireguard/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
From normal Linux users to Linux creator [Linus Torvalds](https://itsfoss.com/linus-torvalds-facts/), everyone is in awe of WireGuard. What is WireGuard and what makes it so special?

## What is WireGuard?

![WireGuard](https://itsfoss.com/content/images/wordpress/2020/02/wireguard.png)

[WireGuard](https://www.wireguard.com/) is an easy to configure, fast, and secure open source [VPN](https://en.wikipedia.org/wiki/Virtual_private_network) that utilizes state-of-the-art cryptography. It’s aim is to provide a faster, simpler and leaner general purpose VPN that can be easily deployed on low-end devices like Raspberry Pi to high-end servers.

Most of the other solutions like [IPsec](https://en.wikipedia.org/wiki/IPsec) and OpenVPN were developed decades ago. Security researcher and kernel developer Jason Donenfeld realized that they were slow and difficult to configure and manage properly.

This made him create a new open source VPN protocol and solution which is faster, secure easier to deploy and manage.

WireGuard was originally developed for Linux but it is now available for Windows, macOS, BSD, iOS and Android. It is still under heavy development.

## Why is WireGuard so popular?

![WireGuard Logo](https://itsfoss.com/content/images/wordpress/2020/02/wireguard-logo.png)

Apart from being a cross-platform, one of the biggest plus point for WireGuard is the ease of deployment. Configuring and deploying WireGuard is as easy as configuring and using SSH.

Look at [WireGuard set up guide](https://www.linode.com/docs/networking/vpn/set-up-wireguard-vpn-on-ubuntu/). You install WireGuard, generate public and private keys (like SSH), set up firewall rules and start the service. Now compare it to the [OpenVPN set up guide](https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04). There are way too many things to do here.

Another good thing about WireGuard is that it has a lean codebase with just 4000 lines of code. Compare it to 100,000 lines of code of [OpenVPN](https://openvpn.net/) (another popular open source VPN). It is clearly easier to debug WireGuard.

Don’t go by its simplicity. WireGuard supports all the state-of-the-art cryptography like like the [Noise protocol framework](http://www.noiseprotocol.org/), [Curve25519](http://cr.yp.to/ecdh.html), [ChaCha20](http://cr.yp.to/chacha.html), [Poly1305](http://cr.yp.to/mac.html), [BLAKE2](https://blake2.net/), [SipHash24](https://131002.net/siphash/), [HKDF](https://eprint.iacr.org/2010/264), and secure trusted constructions.

Since WireGuard runs in the [kernel space](http://www.linfo.org/kernel_space.html), it provides secure networking at a high speed.

These are some of the reasons why WireGuard has become increasingly popular. Linux creator Linus Torvalds loves WireGuard so much that he is merging it in the [Linux Kernel 5.6](https://itsfoss.com/linux-kernel-5-6/):

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.

Linus Torvalds

## If WireGuard is already available, then what’s the fuss about including it in Linux kernel?

This could be confusing to new Linux users. You know that you can install and configure a WireGuard VPN server on Linux but then you also read the news that Linux Kernel 5.6 is going to include WireGuard. Let me explain it to you.

At present, you can install WireGuard on Linux as a [kernel module](https://wiki.archlinux.org/index.php/Kernel_module). Regular applications like VLC, GIMP etc are installed on top of the Linux kernel (in [user space](http://www.linfo.org/user_space.html)), not inside it.

When you install WireGuard as a kernel module, you are basically modifying the Linux kernel on your own and add some code to it. Starting kernel 5.6, you won’t need manually add the kernel module. It will be included in the kernel by default.

The inclusion of WireGuard in Kernel 5.6 will most likely [extend the adoption of WireGuard and thus change the current VPN scene](https://www.zdnet.com/article/vpns-will-change-forever-with-the-arrival-of-wireguard-into-linux/).

**Conclusion**

WireGuard is gaining popularity for the good reasons. Some of the popular [privacy focused VPNs](https://itsfoss.com/best-vpn-linux/) like [Mullvad VPN](https://mullvad.net/) are already using WireGuard and the adoption is likely to grow in the near future.

I hope you have a slightly better understanding of WireGuard. Your feedback is welcome, as always.