WireGuard

  • 1.0.20220627 (2022年6月27日;穩定版本)[1]
編輯維基數據鏈接源代码库
  • git.zx2c4.com/wireguard-linux
編輯維基數據鏈接编程语言C语言Linux内核模块)
Go(用户空间实现)操作系统
  • Linux
  • macOS
  • Android
  • iOS
  • Windows
  • 其他[2]
类型虛擬私人網路许可协议GPLv2网站www.wireguard.com

WireGuard是由Jason A. Donenfeld开发的自由及开源加密VPN程序及协议,[3]旨在获得比IPsec和OpenVPN更好的性能[4],后两者都是常见的隧道协议[5] WireGuard协议的流量经由UDP传输。[6]

2020 年 3 月,该软件的Linux版本达到了稳定的生产版本,并被纳入Linux 5.6内核,并在一些Linux 发行版向后移植到早期的 Linux 内核。[7]Linux内核组件在GNU 通用公共许可证 (GPL) 版本 2 下获得许可;其他实现则在 GPLv2 或其他自由/开源许可证下获得许可。[3]

名称“WireGuard”是Jason A. Donenfeld的注册商标[3]

协议

WireGuard 使用以下协议:[8]

2019 年 5 月,INRIA 的研究人员使用CryptoVerif英语CryptoVerif证明辅助工具英语Proof assistant发布了WireGuard协议的机器验证证明。[9]

可选的预共享对称密钥模式

WireGuard支持预共享英语Pre-shared key对称密钥模式,该模式提供了一层额外的 对称加密,以减轻未来量子计算的进步带来的风险。这解决了流量可能被存储到量子计算机能够破解 Curve25519 的风险,届时流量可能会被解密。预共享密钥“从密钥管理的角度来看通常很麻烦,而且可能更容易被盗”,但在短期内,如果对称密钥被泄露,Curve25519 密钥仍然提供足够的保护。[10]

网络

WireGuard 仅使用[11] UDP[3] 这是因为 TCP-over-TCP 存在潜在的缺点。[11][12][13]在基于 TCP 的连接上隧道化TCP被称为“TCP-over-TCP”,这样做会导致传输性能急剧下降(这个问题被称为“TCP 崩溃”)。当一个 TCP 连接堆叠在另一个 TCP 连接之上时,就会发生 TCP 崩溃。底层可能会检测到问题并尝试进行补偿,而其上层则会因此过度补偿,这种过度补偿会导致延迟和传输性能下降。

其默认服务器端口为UDP 51820。

WireGuard 完全支持IPv6,无论是在隧道内部还是外部。它仅支持第3层IPv4IPv6,并且可以封装v4-in-v6,反之亦然。[14]

MTU 开销

WireGuard 的开销细分如下:[15]

  • 20 字节的 IPv4 报头或 40 字节的 IPv6 报头
  • 8 字节的 UDP 报头
  • 4 字节的类型
  • 4 字节的密钥索引
  • 8 字节的随机数
  • N 字节的加密数据
  • 16 字节的身份验证标签

MTU 操作注意事项

假设传输 WireGuard 数据包的底层网络保持 1500 字节的 MTU,则将所有相关对等方的 WireGuard 接口配置为 1420 字节的 MTU 是传输 IPv6 + IPv4 流量的理想选择。但是,当仅承载传统的 IPv4 流量时,WireGuard 接口的 MTU 可以设置为更高的 1440 字节。[15]

从操作角度和网络配置一致性来看,选择为 WireGuard 接口配置 1420 MTU 是有利的。这种方法确保了一致性,并促进了将来为 WireGuard 对等方和接口启用 IPv6 的更平稳过渡。

注意事项

在某些情况下,例如,一个对等方位于 MTU 为 1500 字节的网络之后,而另一个对等方位于LTE等无线网络之后,运营商通常会选择远低于 1420 字节的 MTU。在这种情况下,主机的底层 IP 网络堆栈将对 UDP 封装的数据包进行分片并发送,但隧道内的包将保持一致,并且不需要分片,因为PMTUD英语Path MTU Discovery将检测对等方之间的 MTU(在本例中为 1420 字节)并在对等方之间发送固定大小的数据包。

可扩展性

WireGuard 旨在由第三方程序和脚本进行扩展。这已被用于增强 WireGuard 的各种功能,包括更友好的管理界面(包括更轻松的密钥设置)、日志记录、动态防火墙更新、动态 IP 分配,[16] 以及LDAP集成。[來源請求]

从最小的核心代码库中排除此类复杂功能可以提高其稳定性和安全性。为了确保安全性,WireGuard 限制了实现加密控件的选项,限制了密钥交换过程的选择,并将算法[8] 映射到现代密码基元英语Cryptographic primitive的一小部分。如果在任何原语中发现缺陷,可以发布解决该问题的新版本。

反响

Ars Technica的一篇评论发现,WireGuard易于设置和使用,使用了强大的加密算法,并且代码库最小,攻击面小。[17]

WireGuard 已获得开放技术基金会的资助,[18]并接受了Mullvad、Private Internet Access、IVPN、NLnet 基金会[19]和OVPN的捐赠。[20]

俄勒冈州参议员Ron Wyden已建议美国国家标准与技术研究院 (NIST) 评估WireGuard作为现有技术的替代方案。[21]

可用性

实现

WireGuard 协议的实现包括:

  • Donenfeld 使用 C 语言和 Go 语言编写的初始实现。[22]
  • Cloudflare的BoringTun,一个使用Rust语言编写的用户空间实现。[23][24]
  • Matt Dunwoodie 为 OpenBSD 编写的使用 C 语言的实现。[25]
  • Ryota Ozaki 为 NetBSD 编写的使用 C 语言的 wg(4) 实现。[26]
  • FreeBSD的实现是用 C 语言编写的,并且与 OpenBSD 的实现共享大部分数据路径。[27]
  • 自 2021 年 8 月起,名为“wireguard-nt”的原生Windows内核实现。[28]
  • 支持 Fritz!OS 7.39 及更高版本的 AVM Fritz!Box 调制解调-路由器。从7.50版本开始允许站点到站点的WireGuard连接。[29]

历史

代码库的早期快照存在于 2016 年 6 月 30 日。[30] WireGuard 的四个早期采用者是 VPN 服务提供商 Mullvad[31] AzireVPN,[32] IVPN[33] 和 cryptostorm。[34]

2019 年 12 月 9 日,Linux 网络堆栈的主要维护者 David Miller 接受了 WireGuard 补丁到“net-next”维护者树中,以便包含在即将发布的内核中。[35][36][37]

2020 年 1 月 28 日,Linus Torvalds 合并了 David Miller 的 net-next 树,WireGuard 进入了 mainline Linux 内核树。[38]

2020 年 3 月 20 日,Debian 开发人员在其 Debian 11 版本(测试版)的内核配置中启用了 WireGuard 的模块构建选项。[39]

2020 年 3 月 29 日,WireGuard 被纳入 Linux 5.6 版本树。Windows 版本的软件仍处于测试阶段。[7]

2020 年 3 月 30 日,Android 开发人员在其通用内核映像中添加了对 WireGuard 的原生内核支持。[40]

2020 年 4 月 22 日,NetworkManager 开发人员 Beniamino Galvani 在 GNOME 中合并了对 WireGuard 的 GUI 支持。[41]

2020 年 5 月 12 日,Matt Dunwoodie 提出了在 OpenBSD 中对 WireGuard 的原生内核支持的补丁。[42]

2020 年 6 月 22 日,在 Matt Dunwoodie 和 Jason A. Donenfeld 的努力下,WireGuard 支持被导入 OpenBSD。[43]

2020 年 11 月 23 日,Jason A. Donenfeld 发布了 Windows 软件包的更新,改进了安装、稳定性、ARM支持和企业功能。[44]

2020 年 11 月 29 日,WireGuard 支持被导入 FreeBSD 13 内核。[27]

2021 年 1 月 19 日,在 pfSense 社区版 (CE) 2.5.0 开发快照中添加了对 WireGuard 的预览支持。[45]

2021 年 3 月,在 FreeBSD WireGuard 中紧急代码清理无法快速完成之后,内核模式 WireGuard 支持从仍在测试中的 FreeBSD 13.0 中删除。[46] 基于 FreeBSD 的 pfSense 社区版 (CE) 2.5.0 和 pfSense Plus 21.02 也删除了基于内核的 WireGuard。[47]

2021 年 5 月,WireGuard 支持作为 pfSense 社区成员 Christian McDonald 编写的实验包重新引入 pfSense CE 和 pfSense Plus 开发快照中。pfSense 的 WireGuard 软件包包含了最初由 Netgate 赞助的 Jason A. Donenfeld 正在进行的内核模式 WireGuard 开发工作。[48][49][50]

2021 年 6 月,pfSense CE 2.5.2 和 pfSense Plus 21.05 的官方软件包存储库都包含了 WireGuard 软件包。[51]

2023 年,WireGuard 从德国的主权科技基金英语Sovereign Tech Fund获得了超过 200,000 欧元的支持。[52]

參考來源

  1. ^ https://git.zx2c4.com/wireguard-linux-compat/tag/?h=v1.0.20220627; 检索日期: 2022年11月4日.
  2. ^ Installation. WireGuard. [23 April 2020].  已忽略未知参数|df= (帮助)
  3. ^ 3.0 3.1 3.2 3.3 WireGuard: fast, modern, secure VPN tunnel. WireGuard. [2021-03-31]. (原始内容存档于28 April 2018). 
  4. ^ Vercauteren, Bart Preneel and Frederik. Applied Cryptography and Network Security. Springer. [2018-08-27]. ISBN 978-3-319-93387-0. (原始内容存档于2019-02-18). 
  5. ^ Preneel, Bart; Vercauteren, Frederik (编). Applied Cryptography and Network Security. Springer. 11 June 2018 [25 June 2018]. ISBN 978-3-319-93387-0. (原始内容存档于18 February 2019).  已忽略未知参数|df= (帮助)
  6. ^ 6.0 6.1 Donenfeld, Jason A. Known Limitations - WireGuard. www.wireguard.com. [1 June 2020] (英语). 
  7. ^ 7.0 7.1 Salter, Jim. WireGuard VPN makes it to 1.0.0—and into the next Linux kernel. 30 March 2020 [23 April 2020]. (原始内容存档于31 March 2020). 
  8. ^ 8.0 8.1 Donenfeld, Jason A. Protocol & Cryptography - WireGuard. www.wireguard.com. [2023-05-14] (英语). 
  9. ^ Lipp, Benjamin; Blanchet, Bruno; Bhargavan, Karthikeyan, A Mechanised Cryptographic Proof of the WireGuard Virtual Private Network Protocol (report), Research Report RR-9269, Paris: Inria: 49, 2019, hal-02100345 
  10. ^ Donenfeld, Jason. WireGuard: Next Generation Kernel Network Tunnel (PDF). Wireguard.com. May 2, 2021. 
  11. ^ 11.0 11.1 Donenfeld, Jason A. Known Limitations - WireGuard. www.wireguard.com. [2021-05-02] (英语). 
  12. ^ Titz, Olaf. Why TCP Over TCP Is A Bad Idea. 2001-04-23 [2015-10-17]. 
  13. ^ Honda, Osamu; Ohsaki, Hiroyuki; Imase, Makoto; Ishizuka, Mika; Murayama, Junichi. Understanding TCP over TCP: effects of TCP tunneling on end-to-end throughput and latency. Atiquzzaman, Mohammed; Balandin, Sergey I (编). Performance, Quality of Service, and Control of Next-Generation Communication and Sensor Networks III 6011. October 2005. Bibcode:2005SPIE.6011..138H. CiteSeerX 10.1.1.78.5815可免费查阅. S2CID 8945952. doi:10.1117/12.630496. 
  14. ^ Donenfeld, Jason A. WireGuard: Next Generation Kernel Network Tunnel (PDF). (原始内容存档 (PDF)于4 March 2018).  |chapter=被忽略 (帮助)
  15. ^ 15.0 15.1 Donenfeld, Jason A. [WireGuard] Header / MTU sizes for Wireguard. December 11, 2017 [2024-01-13]. 
  16. ^ Wireguard Dynamic IP Configuration Tool, WireGuard, 2023-05-14 [2023-05-14] 
  17. ^ Salter, Jim. WireGuard VPN review: A new type of VPN offers serious advantages. Ars Technica. 26 August 2018. (原始内容存档于20 September 2018). 
  18. ^ Building a more secure, accessible and resilient WireGuard VPN protocol.. www.opentech.fund. [2022-06-20]. 
  19. ^ Donations. WireGuard. [28 April 2018]. (原始内容存档于28 April 2018). 
  20. ^ OVPN donates to support WireGuard. OVPN. 23 March 2020. 
  21. ^ US Senator Recommends Open-Source WireGuard To NIST For Government VPN. Phoronix. 30 June 2018 [5 August 2018]. (原始内容存档于5 August 2018).  已忽略未知参数|df= (帮助)
  22. ^ Donenfeld, Jason. WireGuard: fast, modern, secure VPN tunnel. 2019-06-07 [2019-06-16]. 
  23. ^ Krasnov, Vlad. BoringTun, a userspace WireGuard implementation in Rust. Cloudflare Blog. 2018-12-18 [2019-03-29]. (原始内容存档于4 April 2019) (美国英语).  已忽略未知参数|df= (帮助)
  24. ^ CloudFlare Launches "BoringTun" As Rust-Written WireGuard User-Space Implementation. phoronix.com. [29 March 2019]. 
  25. ^ Johansson, Janne. WireGuard imported into OpenBSD. 2020-06-21. 
  26. ^ wg(4) - NetBSD Manual Pages. 2020-08-20. 
  27. ^ 27.0 27.1 Import kernel WireGuard support. 
  28. ^ WireGuardNT, a high-performance WireGuard implementation for the Windows kernel. 2021-08-02. 
  29. ^ WireGuard: VPN has never been so easy. 
  30. ^ Index of /Monolithic-historical/. 
  31. ^ Mason, John. Mullvad Review. thebestwpn. 13 February 2019 [8 April 2019]. 2. Strong Tunneling Protocols – OpenVPN & WireGuard. (原始内容存档于24 June 2019).  已忽略未知参数|df= (帮助)
  32. ^ Mason, John. AzireVPN Review. thebestvpn. 19 February 2019 [8 April 2019]. 2. Impressive Protocols and Encryption. (原始内容存档于8 May 2019).  已忽略未知参数|df= (帮助)
  33. ^ Pestell, Nick. Introducing Wireguard. 11 December 2018 [2019-09-22]. 
  34. ^ WireGuard support added!. cryptostorm blog. 5 April 2019 [9 December 2019]. (原始内容存档于9 December 2019). 
  35. ^ e7096c131e5161fa3b8e52a650d7719d2857adfd - pub/scm/linux/kernel/git/davem/net-next - Git at Google. kernel.googlesource.com. 
  36. ^ LKML: David Miller: Re: [PATCH net-next v2] net: WireGuard secure network tunnel. lkml.org. 
  37. ^ [ANNOUNCE] WireGuard merged to net-next, on its way to Linux 5.6. 9 January 2020. (原始内容存档于9 January 2020). 
  38. ^ Torvalds, Linus. index : kernel/git/torvalds/linux.git. Linux kernel source tree. Kernel.org. [2 February 2020]. 
  39. ^ drivers/net: Enable WIREGUARD as module. 21 March 2020. 
  40. ^ ANDROID: GKI: enable CONFIG_WIREGUARD. 
  41. ^ merge branch 'bg/wireguard' (d321d0df) · Commits · GNOME / network-manager-applet. gitlab.gnome.org. 22 April 2020 [30 May 2020] (英语). 
  42. ^ WireGuard for OpenBSD Kernel Patches Posted. 12 May 2020. 
  43. ^ add wg(4), an in kernel driver for WireGuard vpn communication. 
  44. ^ [ANNOUNCE] WireGuard for Windows 0.3: ARM support, enterprise features, & more. 23 November 2020. 
  45. ^ WireGuard for pfSense Software. 
  46. ^ Anderson, Tim. FreeBSD 13.0 to ship without WireGuard support as dev steps in to fix 'grave issues' with initial implementation. The Register (Situation Publishing). 2021-03-23 [2021-03-31]. 
  47. ^ Thompson, Jim. WireGuard Removed from pfSense® CE and pfSense® Plus Software. Netgate blog. Rubicon Communications. 2021-03-18 [2021-03-20] (英语). 
  48. ^ Long, Scott. pfSense: WireGuard returns as an Experimental Package. Netgate - Secure networks start here. 2021-05-05 [2021-06-09] (英语). 
  49. ^ Paxson, Audian. WireGuard for pfSense Software. Netgate - Secure networks start here. 2021-01-19 [2021-06-09] (英语). 
  50. ^ wireguard-freebsd - WireGuard implementation for the FreeBSD kernel. git.zx2c4.com. [2021-06-09]. 
  51. ^ Pingle, Jim. pfSense Plus 21.05-RELEASE Now Available. Netgate - Secure networks start here. 2021-06-02 [2021-06-09] (英语). 
  52. ^ WireGuard. Sovereign Tech Fund. [2024-05-26] (英语). 

参见

  • 自由软件主题
  • iconLinux主题

外部链接

  • WireGuard官网 (页面存档备份,存于互联网档案馆
  • WireGuard源代码
  • WireGuard源代码GitHub镜像 (页面存档备份,存于互联网档案馆
  • WireGuard Android客户端 (页面存档备份,存于互联网档案馆
  • WireGuard iOS客户端
  • WireGuard macOS客户端


軟體
  • AnyConnect
  • Gbridge
  • Hamachi英语Hamachi
  • Microsoft Intelligent Application Gateway英语Microsoft Intelligent Application Gateway
  • n2n英语n2n
  • Openswan
  • OpenVPN
  • SoftEther VPN
  • strongSwan
  • Remobo
  • Socialvpn英语Socialvpn
  • tinc
  • Wippien
  • WireGuard
  • Cisco Systems VPN Client英语Cisco Systems VPN Client
機制
SSTP英语Secure Socket Tunneling Protocol · IPsec · L2TP · L2TPv3英语L2TPv3 · PPTP · 隧道分离英语Split tunneling · SSL/TLS
廠商
风险