跳至內容

WireGuard

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
WireGuard
原作者Jason A. Donenfeld
開發者Edge Security LLC.
目前版本
  • 1.0.20220627 (2022年6月27日;穩定版本)[1]
編輯維基數據連結
原始碼庫 編輯維基數據連結
程式語言C語言Linux內核模組)
Go(用戶空間實現)
作業系統
類型虛擬私人網路
許可協定GPLv2
網站www.wireguard.com

WireGuard是由Jason A. Donenfeld開發的自由及開源加密VPN程式及協定,[3]旨在獲得比IPsecOpenVPN更好的效能[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熔斷」[a],英語:TCP Meltdown)。當一個TCP連接被承載於另一個TCP連接之上時,就可能發生TCP熔斷:基礎層遇到問題的時候會嘗試進行補償,而其上層則會因此過度補償(英語:overcompensates),這種過度補償會導致延遲並使傳輸效能下降。

其預設伺服器埠為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]並接受了MullvadPrivate Internet AccessIVPNNLnet 基金會[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. ^ 不確定「TCP Meltdown」的常用中文譯名,暫時翻譯為「TCP熔斷」。

參考來源

[編輯]
  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] (英語). 

外部連結

[編輯]