WireGuard

維基百科,自由的百科全書
(差異) ←上一修訂 | 最新修訂 (差異) | 下一修訂→ (差異)
跳至導覽 跳至搜尋
WireGuard
File:Logo of WireGuard.svg
原作者Jason A. Donenfeld
開發者Edge Security LLC.
目前版本
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    原始碼庫
    • {{URL|example.com|可选的显示文本}}
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    程式語言C語言LinuxFreeBSD內核模組、NetBSDOpenBSD內核模組、Windows內核驅動)
    Go(用戶空間實現)
    引擎
      Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
      作業系統
      類型虛擬私人網絡
      許可協定
        Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)

        WireGuard是一項加密VPN協定和自由及開源程式。[2]旨在獲得比IPsecOpenVPN更好的效能[3],後兩者都是常見的隧道協定[4]WireGuard協定的流量經由UDP傳輸。[5]

        2020年3月,該軟件的Linux版本達到了穩定的生產版本,並被納入Linux 5.6內核,並在一些Linux發行版向後移植到早期的Linux內核。[6]Linux內核組件在GNU通用公共許可證(GPL)版本2下獲得許可;其他實現則在GPLv2或其他自由/開源許可證下獲得許可。[2]

        協定[編輯]

        WireGuard使用以下協定:[7]

        2019年5月,INRIA的研究人員使用CryptoVerif英語CryptoVerif證明輔助工具英語Proof assistant發佈了WireGuard協定的機器驗證證明。[8]

        可選的預共用對稱金鑰模式[編輯]

        WireGuard支援預共用對稱金鑰(英語:Pre-shared key)模式,該模式提供了一層額外的對稱加密,以減輕未來量子計算的進步帶來的風險。參照錯誤:<ref>標籤中沒有內容這消除了流量被儲存後,未來可能被量子電腦解密的風險,因為量子電腦最終可能破解Curve25519(Wireguard中必選的基於非對稱金鑰的金鑰交換方法)。預共用金鑰「從金鑰管理的角度來看通常很麻煩,而且可能更容易被盜」,但在短期內,如果對稱金鑰被泄露,Curve25519金鑰仍能提供足夠的保護。[9][10]

        網絡[編輯]

        WireGuard僅使用[11]UDP[2]這是因為TCP-over-TCP存在潛在問題。[11][12][13]在基於TCP的連接上隧道化TCP被稱為「TCP-over-TCP」,這樣做會導致傳輸效能急劇下降(該問題被稱為「TCP熔斷」,英語:TCP Meltdown):基礎層遇到問題的時候會嘗試進行補償,而(被基礎層承載着的)上層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介面組態1420MTU是有利的。這種方法確保了一致性,並促進了將來為WireGuard對等方和介面啟用IPv6的更平穩過渡。

        注意事項[編輯]

        在某些情況下,例如,一個對等方位於MTU為1500位元組的網絡之後,而另一個對等方位於LTE等無線網絡之後,運營商通常會選擇遠低於1420位元組的MTU。在這種情況下,主機的底層IP網絡堆疊將對UDP封裝的封包進行分片並行送,但隧道內的包將保持一致,並且不需要分片,因為PMTUD英語Path MTU Discovery將檢測對等方之間的MTU(在本例中為1420位元組)並在對等方之間傳送固定大小的封包。

        可延伸性[編輯]

        WireGuard旨在由第三方程式和指令碼進行擴充。這已被用於增強WireGuard的各種功能,包括更友好的管理介面(包括更輕鬆的金鑰設置)、紀錄檔記錄、動態防火牆更新、動態IP分配,[16]以及LDAP整合。[來源請求]

        從最小的核心代碼庫中排除此類複雜功能可以提高其穩定性和安全性。為了確保安全性,WireGuard限制了實現加密控制項的選項,限制了金鑰交換過程的選擇,並將演算法[7] 對映到現代密碼基元英語Cryptographic primitive的一小部分。如果在任何原語中發現缺陷,可以發佈解決該問題的新版本。

        反響[編輯]

        ArsTechnica的一篇評論發現,WireGuard易於設置和使用,使用了強大的加密演算法,並且代碼庫最小,攻擊面小。[17]

        WireGuard已獲得開放技術基金會的資助,[18]並接受了MullvadPrivate Internet AccessIVPNNLnet基金會[19]和OVPN的捐贈。[20]

        俄勒岡州參議員Ron Wyden已建議美國國家標準與技術研究院評估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及更高版本的AVMFritz!Box調製解調-路由器。從7.50版本開始允許站點到站點的WireGuard連接。[29]

        歷史[編輯]

        代碼庫的早期快照存在於2016年6月30日。[30]WireGuard的四個早期採用者是VPN服務提供商Mullvad[31]AzireVPN,[32]IVPN[33]和cryptostorm。[34]該協定標誌的靈感源於Jason Donenfeld在參觀德爾斐的博物館時見到的一塊希臘神話中的巨蟒石刻。[35]

        2019年12月9日,Linux網絡堆疊的主要維護者DavidMiller接受了WireGuard修補程式到「net-next」維護者樹中,以便包含在即將發佈的內核中。[36][37][38]

        2020年1月28日,Linus Torvalds合併了David Miller的net-next樹,WireGuard進入了mainline Linux內核樹。[39]

        2020年3月20日,Debian開發人員在其Debian 11版本(測試版)的內核組態中啟用了WireGuard的模組構建選項。[40]

        2020年3月29日,WireGuard被納入Linux 5.6版本樹。Windows版本的軟件仍處於測試階段。[6]

        2020年3月30日,Android開發人員在其通用內核映像中添加了對WireGuard的原生內核支援。[41]

        2020年4月22日,NetworkManager開發人員BeniaminoGalvani在GNOME中合併了對WireGuard的GUI支援。[42]

        2020年5月12日,Matt Dunwoodie提出了在OpenBSD中對WireGuard的原生內核支援的修補程式。[43]

        2020年6月22日,在MattDunwoodie和Jason A. Donenfeld的努力下,WireGuard支援被匯入OpenBSD。[44]

        2020年11月23日,Jason A. Donenfeld發佈了Windows軟件套件的更新,改進了安裝、穩定性、ARM支援和企業功能。[45]

        2020年11月29日,WireGuard支援被匯入FreeBSD13內核。[27]

        2021年1月19日,在pfSense社群版 (CE)2.5.0開發快照中添加了對WireGuard的預覽支援。[46]

        2021年3月,在FreeBSDWireGuard中緊急代碼清理無法快速完成之後,內核模式WireGuard支援從仍在測試中的FreeBSD13.0中刪除。[47] 基於FreeBSD的pfSense社群版 (CE)2.5.0和pfSense Plus 21.02也刪除了基於內核的WireGuard。[48]

        2021年5月,WireGuard支援作為pfSense社群成員Christian McDonald編寫的實驗包重新引入pfSense CE和pfSense Plus開發快照中。pfSense的WireGuard軟件套件包含了最初由Netgate贊助的Jason A. Donenfeld正在進行的內核模式WireGuard開發工作。[49][50][51]

        2021年6月,pfSense CE 2.5.2和pfSense Plus 21.05的官方軟件套件儲存庫都包含了WireGuard軟件套件。[52]

        2023年,WireGuard從德國的主權科技基金英語Sovereign Tech Fund獲得了超過200,000歐元的支援。[53]

        參見[編輯]

        註釋[編輯]

        參考來源[編輯]

        1. ^ Installation. WireGuard. [23 April 2020]. (原始內容存檔於2025-02-11). 
        2. ^ 2.0 2.1 2.2 WireGuard: fast, modern, secure VPN tunnel. WireGuard. [2021-03-31]. (原始內容存檔於28 April 2018). 
        3. ^ Vercauteren, Bart Preneel and Frederik. Applied Cryptography and Network Security. Springer. [2018-08-27]. ISBN 978-3-319-93387-0. (原始內容存檔於2019-02-18). 
        4. ^ 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). 
        5. ^ 5.0 5.1 Donenfeld, Jason A. Known Limitations - WireGuard. www.wireguard.com. [1 June 2020]. (原始內容存檔於2022-05-31) (English). 
        6. ^ 6.0 6.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). 
        7. ^ 7.0 7.1 Donenfeld, Jason A. Protocol & Cryptography - WireGuard. www.wireguard.com. [2023-05-14]. (原始內容存檔於2020-05-11) (English). 
        8. ^ 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 [2024-08-26], hal-02100345, (原始內容存檔於2020-04-29) 
        9. ^ Donenfeld, Jason. WireGuard: Next Generation Kernel Network Tunnel (PDF). Wireguard.com. May 2, 2021 [2018-08-27]. (原始內容存檔 (PDF)於2018-03-04). 
        10. ^ Preshared Keys | Pro Custodibus Documentation. docs.procustodibus.com. [2025-01-14]. (原始內容存檔於2025-01-14). 
        11. ^ 11.0 11.1 Donenfeld, Jason A. Known Limitations - WireGuard. www.wireguard.com. [2021-05-02]. (原始內容存檔於2022-05-31) (English). 
        12. ^ Titz, Olaf. Why TCP Over TCP Is A Bad Idea. 2001-04-23 [2015-10-17]. (原始內容存檔於2015-09-01). 
        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]. (原始內容存檔於2025-01-26). 
        16. ^ Wireguard Dynamic IP Configuration Tool, WireGuard, 2023-05-14 [2023-05-14], (原始內容存檔於2023-05-17) 
        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]. (原始內容存檔於2023-10-12). 
        19. ^ Donations. WireGuard. [28 April 2018]. (原始內容存檔於28 April 2018). 
        20. ^ OVPN donates to support WireGuard. OVPN. 23 March 2020 [2024-08-26]. (原始內容存檔於2020-03-28). 
        21. ^ US Senator Recommends Open-Source WireGuard To NIST For Government VPN. Phoronix. 30 June 2018 [5 August 2018]. (原始內容存檔於5 August 2018). 
        22. ^ Donenfeld, Jason. WireGuard: fast, modern, secure VPN tunnel. 2019-06-07 [2019-06-16]. (原始內容存檔於2018-04-28). 
        23. ^ Krasnov, Vlad. BoringTun, a userspace WireGuard implementation in Rust. Cloudflare Blog. 2018-12-18 [2019-03-29]. (原始內容存檔於4 April 2019) (en-US). 
        24. ^ CloudFlare Launches "BoringTun" As Rust-Written WireGuard User-Space Implementation. phoronix.com. [29 March 2019]. (原始內容存檔於2009-09-21). 
        25. ^ Johansson, Janne. WireGuard imported into OpenBSD. 2020-06-21 [2024-08-26]. (原始內容存檔於2022-05-29). 
        26. ^ wg(4) - NetBSD Manual Pages. 2020-08-20 [2024-08-26]. (原始內容存檔於2021-10-28). 
        27. ^ 27.0 27.1 Import kernel WireGuard support. [2024-08-26]. (原始內容存檔於2022-04-30). 
        28. ^ WireGuardNT, a high-performance WireGuard implementation for the Windows kernel. 2021-08-02 [2024-08-26]. (原始內容存檔於2022-04-23). 
        29. ^ WireGuard: VPN has never been so easy. [2024-08-26]. (原始內容存檔於2025-01-14). 
        30. ^ Index of /Monolithic-historical/. [2024-08-26]. (原始內容存檔於2020-01-31). 
        31. ^ Mason, John. Mullvad Review. thebestwpn. 13 February 2019 [8 April 2019]. 2. Strong Tunneling Protocols – OpenVPN & WireGuard. (原始內容存檔於24 June 2019). 
        32. ^ Mason, John. AzireVPN Review. thebestvpn. 19 February 2019 [8 April 2019]. 2. Impressive Protocols and Encryption. (原始內容存檔於8 May 2019). 
        33. ^ Pestell, Nick. Introducing Wireguard. 11 December 2018 [2019-09-22]. (原始內容存檔於2019-01-03). 
        34. ^ WireGuard support added!. cryptostorm blog. 5 April 2019 [9 December 2019]. (原始內容存檔於9 December 2019). 
        35. ^ How one hacker's push to secure the internet became a crucial part of Mac, Linux, and Windows operating systems. Business Insider. 16 Jan 2021. (原始內容存檔於16 Jan 2021). 
        36. ^ e7096c131e5161fa3b8e52a650d7719d2857adfd - pub/scm/linux/kernel/git/davem/net-next - Git at Google. kernel.googlesource.com. [2024-08-26]. (原始內容存檔於2020-05-16). 
        37. ^ LKML: David Miller: Re: [PATCH net-next v2] net: WireGuard secure network tunnel. lkml.org. [2024-08-26]. (原始內容存檔於2019-12-09). 
        38. ^ [ANNOUNCE] WireGuard merged to net-next, on its way to Linux 5.6. 9 January 2020. (原始內容存檔於9 January 2020). 
        39. ^ Torvalds, Linus. index : kernel/git/torvalds/linux.git. Linux kernel source tree. Kernel.org. [2 February 2020]. (原始內容存檔於2020-05-16). 
        40. ^ drivers/net: Enable WIREGUARD as module. 21 March 2020 [2024-08-26]. (原始內容存檔於2020-03-21). 
        41. ^ ANDROID: GKI: enable CONFIG_WIREGUARD. [2024-08-26]. (原始內容存檔於2020-04-03). 
        42. ^ merge branch 'bg/wireguard' (d321d0df) · Commits · GNOME / network-manager-applet. gitlab.gnome.org. 22 April 2020 [30 May 2020]. (原始內容存檔於2022-06-14) (English). 
        43. ^ WireGuard for OpenBSD Kernel Patches Posted. 12 May 2020 [2024-08-26]. (原始內容存檔於2022-09-15). 
        44. ^ add wg(4), an in kernel driver for WireGuard vpn communication. [2024-08-26]. (原始內容存檔於2020-06-22). 
        45. ^ [ANNOUNCE] WireGuard for Windows 0.3: ARM support, enterprise features, & more. 23 November 2020 [2024-08-26]. (原始內容存檔於2021-04-10). 
        46. ^ WireGuard for pfSense Software. [2024-08-26]. (原始內容存檔於2021-05-17). 
        47. ^ 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]. (原始內容存檔於2022-06-14). 
        48. ^ Thompson, Jim. WireGuard Removed from pfSense® CE and pfSense® Plus Software. Netgate blog. Rubicon Communications. 2021-03-18 [2021-03-20]. (原始內容存檔於2021-06-18) (English). 
        49. ^ Long, Scott. pfSense: WireGuard returns as an Experimental Package. Netgate - Secure networks start here. 2021-05-05 [2021-06-09]. (原始內容存檔於2021-06-18) (English). 
        50. ^ Paxson, Audian. WireGuard for pfSense Software. Netgate - Secure networks start here. 2021-01-19 [2021-06-09]. (原始內容存檔於2021-05-17) (English). 
        51. ^ wireguard-freebsd - WireGuard implementation for the FreeBSD kernel. git.zx2c4.com. [2021-06-09]. (原始內容存檔於2022-10-24). 
        52. ^ Pingle, Jim. pfSense Plus 21.05-RELEASE Now Available. Netgate - Secure networks start here. 2021-06-02 [2021-06-09]. (原始內容存檔於2021-06-18) (English). 
        53. ^ WireGuard. Sovereign Tech Fund. [2024-05-26]. (原始內容存檔於2024-11-03) (English). 

        外部連結[編輯]