{"id":1362,"date":"2026-09-08T09:37:48","date_gmt":"2026-09-08T01:37:48","guid":{"rendered":"https:\/\/www.suannai.link\/blog\/wireguard%e9%80%82%e5%90%88%e4%b8%aa%e4%ba%ba%e6%97%a5%e5%b8%b8%e4%bd%bf%e7%94%a8%e5%90%97%ef%bc%9a%e9%85%8d%e7%bd%ae%e9%80%bb%e8%be%91%e4%b8%8e%e9%80%82%e7%94%a8%e5%9c%ba%e6%99%af%e8%a7%a3%e6%9e%90\/"},"modified":"2026-09-08T09:37:48","modified_gmt":"2026-09-08T01:37:48","slug":"wireguard%e9%80%82%e5%90%88%e4%b8%aa%e4%ba%ba%e6%97%a5%e5%b8%b8%e4%bd%bf%e7%94%a8%e5%90%97%ef%bc%9a%e9%85%8d%e7%bd%ae%e9%80%bb%e8%be%91%e4%b8%8e%e9%80%82%e7%94%a8%e5%9c%ba%e6%99%af%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.suannai.link\/blog\/wireguard%e9%80%82%e5%90%88%e4%b8%aa%e4%ba%ba%e6%97%a5%e5%b8%b8%e4%bd%bf%e7%94%a8%e5%90%97%ef%bc%9a%e9%85%8d%e7%bd%ae%e9%80%bb%e8%be%91%e4%b8%8e%e9%80%82%e7%94%a8%e5%9c%ba%e6%99%af%e8%a7%a3%e6%9e%90\/","title":{"rendered":"WireGuard\u9002\u5408\u4e2a\u4eba\u65e5\u5e38\u4f7f\u7528\u5417\uff1a\u914d\u7f6e\u903b\u8f91\u4e0e\u9002\u7528\u573a\u666f\u89e3\u6790"},"content":{"rendered":"<p>WireGuard \u662f\u5426\u9002\u5408\u4e2a\u4eba\u65e5\u5e38\u4f7f\u7528\uff0c\u6838\u5fc3\u53d6\u51b3\u4e8e\u4f60\u5bf9\u201c\u8f7b\u91cf\u7ea7\u201d\u3001\u201c\u4f4e\u5ef6\u8fdf\u201d\u4ee5\u53ca\u201c\u914d\u7f6e\u81ea\u4e3b\u6743\u201d\u7684\u9700\u6c42\u3002\u4e0e\u4f20\u7edf\u7684 OpenVPN \u6216 IPSec \u534f\u8bae\u76f8\u6bd4\uff0cWireGuard \u7684\u8bbe\u8ba1\u54f2\u5b66\u662f\u6781\u7b80\u548c\u73b0\u4ee3\uff0c\u5b83\u5728\u4e2a\u4eba\u65e5\u5e38\u573a\u666f\uff08\u5982\u79fb\u52a8\u7aef\u5207\u6362\u3001PC \u540e\u53f0\u6302\u673a\u3001\u4f4e\u914d\u7f6e\u8bbe\u5907\u8fd0\u884c\uff09\u4e2d\u901a\u5e38\u80fd\u63d0\u4f9b\u66f4\u7a33\u5b9a\u7684\u8fde\u63a5\u548c\u66f4\u4f4e\u7684\u8d44\u6e90\u5360\u7528\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u7b80\u5355\u6027\u4e5f\u610f\u5473\u7740\u5b83\u7f3a\u4e4f\u5185\u7f6e\u7684\u8eab\u4efd\u8ba4\u8bc1\u590d\u6742\u5ea6\u548c\u591a\u56e0\u7d20\u652f\u6301\uff0c\u4e14\u914d\u7f6e\u903b\u8f91\u4e0e\u4f20\u7edf\u534f\u8bae\u4e0d\u540c\u3002<\/p>\n<p>\u672c\u6587\u5c06\u91cd\u70b9\u89e3\u51b3\u201c\u5982\u4f55\u5224\u65ad WireGuard \u662f\u5426\u6ee1\u8db3\u4f60\u7684\u65e5\u5e38\u9700\u6c42\u201d\u4ee5\u53ca\u201c\u5982\u4f55\u6b63\u786e\u914d\u7f6e\u4ee5\u53d1\u6325\u5176\u4f18\u52bf\u201d\u8fd9\u4e24\u4e2a\u6838\u5fc3\u95ee\u9898\u3002\u6587\u7ae0\u4e0d\u4f1a\u8ba8\u8bba\u5177\u4f53\u7684\u670d\u52a1\u5546\u4f18\u52a3\uff0c\u800c\u662f\u4ece\u534f\u8bae\u7279\u6027\u3001\u914d\u7f6e\u903b\u8f91\u3001\u6027\u80fd\u8868\u73b0\u548c\u6f5c\u5728\u5c40\u9650\u56db\u4e2a\u7ef4\u5ea6\uff0c\u4e3a\u4f60\u63d0\u4f9b\u53ef\u64cd\u4f5c\u7684\u5224\u65ad\u6807\u51c6\u548c\u8bbe\u7f6e\u6307\u5357\u3002<\/p>\n<h2>WireGuard \u7684\u6838\u5fc3\u7279\u6027\u4e0e\u65e5\u5e38\u4f7f\u7528\u5339\u914d\u5ea6<\/h2>\n<p>\u8981\u5224\u65ad WireGuard \u662f\u5426\u9002\u5408\u4f60\uff0c\u9996\u5148\u9700\u8981\u7406\u89e3\u5b83\u4e0e\u4f20\u7edf\u4ee3\u7406\u534f\u8bae\uff08\u5982 OpenVPN\uff09\u5728\u5e95\u5c42\u903b\u8f91\u4e0a\u7684\u6839\u672c\u5dee\u5f02\u3002\u8fd9\u4e9b\u5dee\u5f02\u76f4\u63a5\u51b3\u5b9a\u4e86\u5b83\u5728\u65e5\u5e38\u4f7f\u7528\u4e2d\u7684\u4f53\u9a8c\u3002<\/p>\n<h3>1. \u6781\u7b80\u4ee3\u7801\u5e26\u6765\u7684\u6027\u80fd\u4f18\u52bf<\/h3>\n<p>WireGuard \u7684\u4ee3\u7801\u5e93\u4ec5\u6709\u6570\u5343\u884c\uff0c\u8fdc\u5c11\u4e8e OpenVPN \u7684\u6570\u4e07\u884c\u3002\u8fd9\u79cd\u6781\u7b80\u8bbe\u8ba1\u5e26\u6765\u4e86\u4e24\u4e2a\u76f4\u63a5\u597d\u5904\uff1a<br \/>* <strong>\u8d44\u6e90\u5360\u7528\u6781\u4f4e<\/strong>\uff1a\u5728\u4e2a\u4eba\u65e5\u5e38\u4f7f\u7528\u4e2d\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u7684 CPU \u548c\u5185\u5b58\u5360\u7528\u4f1a\u66f4\u5c11\u3002\u5bf9\u4e8e\u8001\u65e7\u624b\u673a\u3001\u4f4e\u914d\u7b14\u8bb0\u672c\u6216\u8def\u7531\u5668\u800c\u8a00\uff0cWireGuard \u51e0\u4e4e\u4e0d\u4f1a\u9020\u6210\u5361\u987f\u3002<br \/>* <strong>\u8fde\u63a5\u901f\u5ea6\u66f4\u5feb<\/strong>\uff1aWireGuard \u4f7f\u7528\u73b0\u4ee3\u52a0\u5bc6\u7b97\u6cd5\uff08\u5982 ChaCha20\u3001Poly1305\uff09\uff0c\u63e1\u624b\u8fc7\u7a0b\u901a\u5e38\u53ea\u9700\u4e00\u4e2a\u5f80\u8fd4\uff081-RTT\uff09\uff0c\u800c OpenVPN \u53ef\u80fd\u9700\u8981\u591a\u6b21\u63e1\u624b\u3002\u5728\u65e5\u5e38\u6d4f\u89c8\u7f51\u9875\u3001\u52a0\u8f7d\u56fe\u7247\u6216\u8fdb\u884c\u89c6\u9891\u6d41\u5a92\u4f53\u4f20\u8f93\u65f6\uff0c\u8fd9\u79cd\u4f4e\u5ef6\u8fdf\u611f\u66f4\u4e3a\u660e\u663e\u3002<\/p>\n<h3>2. \u201c\u72b6\u6001\u673a\u201d\u800c\u975e\u201c\u8fde\u63a5\u201d\u7684\u6982\u5ff5<\/h3>\n<p>\u4f20\u7edf\u534f\u8bae\u901a\u5e38\u88ab\u89c6\u4e3a\u4e00\u4e2a\u201c\u8fde\u63a5\u201d\uff0c\u9700\u8981\u9891\u7e41\u7684\u5fc3\u8df3\u4fdd\u6d3b\u3002WireGuard \u5219\u662f\u4e00\u4e2a\u201c\u72b6\u6001\u673a\u201d\uff0c\u5b83\u59cb\u7ec8\u4fdd\u6301\u4e00\u4e2a\u865a\u62df\u7684\u7f51\u7edc\u63a5\u53e3\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u3002<br \/>* <strong>\u65e5\u5e38\u4f53\u9a8c<\/strong>\uff1a\u5f53\u4f60\u4ece Wi-Fi \u5207\u6362\u5230\u79fb\u52a8\u6570\u636e\uff0c\u6216\u4ece\u7761\u7720\u4e2d\u5524\u9192\u8bbe\u5907\u65f6\uff0cWireGuard \u901a\u5e38\u80fd\u65e0\u7f1d\u5207\u6362\uff0c\u65e0\u9700\u91cd\u65b0\u63e1\u624b\u3002\u8fd9\u5bf9\u4e8e\u79fb\u52a8\u7aef\u7528\u6237\u662f\u5de8\u5927\u7684\u4f18\u52bf\u3002<br \/>* <strong>\u5224\u65ad\u6807\u51c6<\/strong>\uff1a\u5982\u679c\u4f60\u7ecf\u5e38\u5728\u4e0d\u540c\u7f51\u7edc\u73af\u5883\u95f4\u5207\u6362\uff0c\u6216\u5e0c\u671b\u8bbe\u5907\u5728\u540e\u53f0\u957f\u671f\u4fdd\u6301\u8fde\u63a5\u800c\u4e0d\u6389\u7ebf\uff0cWireGuard \u662f\u7406\u60f3\u9009\u62e9\u3002<\/p>\n<h3>3. \u914d\u7f6e\u6587\u4ef6\u7684\u9759\u6001\u6027<\/h3>\n<p>WireGuard \u7684\u914d\u7f6e\u662f\u9759\u6001\u7684\u3002\u4e00\u65e6\u914d\u7f6e\u5b8c\u6210\uff0c\u9664\u975e\u4f60\u624b\u52a8\u66f4\u6539\u5bc6\u94a5\u6216 IP\uff0c\u5426\u5219\u534f\u8bae\u5c42\u4e0d\u4f1a\u81ea\u52a8\u534f\u5546\u53c2\u6570\u3002<br \/>* <strong>\u4f18\u52bf<\/strong>\uff1a\u914d\u7f6e\u7b80\u5355\uff0c\u4e0d\u6613\u51fa\u9519\u3002<br \/>* <strong>\u52a3\u52bf<\/strong>\uff1a\u5982\u679c\u670d\u52a1\u5668\u7aef\u66f4\u6539\u4e86\u7aef\u53e3\u6216\u52a0\u5bc6\u53c2\u6570\uff0c\u5ba2\u6237\u7aef\u5fc5\u987b\u624b\u52a8\u66f4\u65b0\u914d\u7f6e\uff0c\u65e0\u6cd5\u50cf\u67d0\u4e9b\u52a8\u6001\u534f\u8bae\u90a3\u6837\u81ea\u52a8\u9002\u5e94\u3002<\/p>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u7279\u6027<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">WireGuard<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u4f20\u7edf OpenVPN (UDP)<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u5bf9\u65e5\u5e38\u7528\u6237\u7684\u5f71\u54cd<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u4ee3\u7801\u590d\u6742\u5ea6<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u6781\u4f4e<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u9ad8<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">WireGuard \u66f4\u7a33\u5b9a\uff0cBug \u66f4\u5c11<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u63e1\u624b\u901f\u5ea6<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u5feb (1-RTT)<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u6162 (\u591a\u8f6e\u534f\u5546)<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">WireGuard \u6253\u5f00\u5e94\u7528\u65f6\u51e0\u4e4e\u65e0\u611f\u5ef6\u8fdf<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u8d44\u6e90\u5360\u7528<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4f4e<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4e2d\u9ad8<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u65e7\u8bbe\u5907\u6216\u8def\u7531\u5668\u4e0a WireGuard \u66f4\u6d41\u7545<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u914d\u7f6e\u96be\u5ea6<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u9700\u7406\u89e3\u5bc6\u94a5\u6982\u5ff5<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u901a\u5e38\u63d0\u4f9b\u73b0\u6210\u6587\u4ef6<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">WireGuard \u9700\u8981\u4e00\u5b9a\u7684\u6280\u672f\u7406\u89e3\u529b<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>NAT \u7a7f\u900f<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u539f\u751f\u652f\u6301<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u9700\u989d\u5916\u914d\u7f6e<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">WireGuard \u5728\u590d\u6742\u7f51\u7edc\u73af\u5883\u4e0b\u66f4\u53ef\u9760<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/p>\n\n<h2>\u4e2a\u4eba\u65e5\u5e38\u4f7f\u7528\u7684\u5178\u578b\u573a\u666f\u5206\u6790<\/h2>\n<p>\u5e76\u975e\u6240\u6709\u573a\u666f\u90fd\u9002\u5408 WireGuard\u3002\u4f60\u9700\u8981\u6839\u636e\u81ea\u5df1\u7684\u5177\u4f53\u4f7f\u7528\u4e60\u60ef\u6765\u5224\u65ad\u3002<\/p>\n<h3>\u573a\u666f\u4e00\uff1a\u79fb\u52a8\u7aef\uff08iOS\/Android\uff09\u65e5\u5e38\u6d4f\u89c8<\/h3>\n<p><strong>\u9002\u5408\u5ea6\uff1a\u9ad8<\/strong><br \/>\u5728\u79fb\u52a8\u7aef\uff0c<a href=\"https:\/\/www.suannai.link\/blog\/wireguard%e6%89%8b%e6%9c%ba%e7%ab%af%e8%80%97%e7%94%b5%e6%83%85%e5%86%b5%ef%bc%9a%e4%b8%ba%e4%bb%80%e4%b9%88%e5%ae%83%e6%af%94%e4%bc%a0%e7%bb%9f%e5%8d%8f%e8%ae%ae%e6%9b%b4%e7%9c%81%e7%94%b5%ef%bc%9f\/\" target=\"_blank\" rel=\"noopener\">\u7535\u6c60\u7eed\u822a<\/a>\u548c\u8fde\u63a5\u7a33\u5b9a\u6027\u662f\u5173\u952e\u3002WireGuard \u7684\u540e\u53f0\u9a7b\u7559\u673a\u5236\u975e\u5e38\u9ad8\u6548\uff0c\u4e0d\u4f1a\u50cf\u67d0\u4e9b\u4f20\u7edf\u534f\u8bae\u90a3\u6837\u9891\u7e41\u5524\u9192 CPU \u5bfc\u81f4\u8017\u7535\u3002<br \/>* <strong>\u64cd\u4f5c\u5efa\u8bae<\/strong>\uff1a\u5728\u624b\u673a\u4e0a\u4f7f\u7528\u652f\u6301 WireGuard \u7684\u5ba2\u6237\u7aef\uff08\u5982\u7cfb\u7edf\u81ea\u5e26\u6216\u7b2c\u4e09\u65b9\u5de5\u5177\uff09\u65f6\uff0c\u786e\u4fdd\u542f\u7528\u201cAlways-On\u201d\u6216\u201c\u540e\u53f0\u5524\u9192\u201d\u6743\u9650\u3002<br \/>* <strong>\u6ce8\u610f\u4e8b\u9879<\/strong>\uff1a\u7531\u4e8e WireGuard \u4e0d\u5185\u7f6e\u5e94\u7528\u5c42\u534f\u8bae\uff0c\u5982\u679c\u67d0\u4e9b\u7279\u5b9a App \u9700\u8981\u6df1\u5ea6\u5305\u68c0\u6d4b\uff08DPI\uff09\u7ed5\u8fc7\uff0c\u9700\u786e\u8ba4\u4f60\u7684\u8282\u70b9\u670d\u52a1\u662f\u5426\u652f\u6301\u5728 WireGuard \u4e4b\u4e0a\u5c01\u88c5\u5176\u4ed6\u534f\u8bae\uff08\u5982 mKCP \u6216 WebSocket\uff09\u3002<\/p>\n<h3>\u573a\u666f\u4e8c\uff1aPC \u7aef\u957f\u671f\u6302\u673a\u6216\u4e0b\u8f7d<\/h3>\n<p><strong>\u9002\u5408\u5ea6\uff1a\u4e2d\u9ad8<\/strong><br \/>\u5bf9\u4e8e\u957f\u671f\u6302\u673a\uff0cWireGuard \u7684\u4f4e CPU \u5360\u7528\u610f\u5473\u7740\u4f60\u7684\u7535\u8111\u53ef\u4ee5\u5904\u7406\u5176\u4ed6\u4efb\u52a1\u800c\u4e0d\u53d7\u5f71\u54cd\u3002<br \/>* <strong>\u64cd\u4f5c\u5efa\u8bae<\/strong>\uff1a\u5728 Windows \u6216 macOS \u4e0a\uff0c\u5efa\u8bae\u5c06 WireGuard \u5ba2\u6237\u7aef\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f\u3002<br \/>* <strong>\u6f5c\u5728\u95ee\u9898<\/strong>\uff1a\u7531\u4e8e WireGuard \u7684 IP \u5730\u5740\u662f\u9759\u6001\u5206\u914d\u7684\uff0c\u5982\u679c\u4f60\u7684\u8282\u70b9\u670d\u52a1\u63d0\u4f9b\u7684\u662f\u5171\u4eab IP\uff0c\u4e14\u8be5 IP \u88ab\u4ed6\u4eba\u6ee5\u7528\u5bfc\u81f4\u88ab\u5c01\u7981\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u8054\u7cfb\u670d\u52a1\u5546\u66f4\u6362\u8282\u70b9 IP\u3002\u8fd9\u5728\u4e2a\u4eba\u65e5\u5e38\u4f7f\u7528\u4e2d\u662f\u4e00\u4e2a\u9700\u8981\u6ce8\u610f\u7684\u98ce\u9669\u70b9\u3002<\/p>\n<h3>\u573a\u666f\u4e09\uff1a\u516c\u5171 Wi-Fi \u4e0b\u7684\u9690\u79c1\u4fdd\u62a4<\/h3>\n<p><strong>\u9002\u5408\u5ea6\uff1a\u4e2d<\/strong><br \/>WireGuard \u63d0\u4f9b\u52a0\u5bc6\u96a7\u9053\uff0c\u80fd\u4fdd\u62a4\u4f60\u7684\u6570\u636e\u4e0d\u88ab\u516c\u5171 Wi-Fi \u70ed\u70b9\u7a83\u53d6\u3002<br \/>* <strong>\u9650\u5236<\/strong>\uff1aWireGuard \u672c\u8eab\u4e0d\u9690\u85cf\u4f60\u7684\u771f\u5b9e IP \u5730\u5740\u7ed9\u76ee\u6807\u7f51\u7ad9\uff0c\u5b83\u53ea\u662f\u52a0\u5bc6\u4e86\u4f60\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u4f20\u8f93\u3002\u5982\u679c\u76ee\u6807\u662f\u5b8c\u5168\u533f\u540d\uff0c\u9700\u7ed3\u5408\u5176\u4ed6\u5de5\u5177\u3002<br \/>* <strong>\u5224\u65ad\u6807\u51c6<\/strong>\uff1a\u5982\u679c\u4f60\u7684\u4e3b\u8981\u9700\u6c42\u662f\u9632\u6b62\u7a83\u542c\u800c\u975e\u533f\u540d\uff0cWireGuard \u662f\u6781\u4f73\u9009\u62e9\u3002<\/p>\n<h2>WireGuard \u914d\u7f6e\u903b\u8f91\u4e0e\u5173\u952e\u8bbe\u7f6e\u6b65\u9aa4<\/h2>\n<p><a href=\"https:\/\/www.suannai.link\/blog\/wireguard%e9%85%8d%e7%bd%ae%e6%8c%87%e5%8d%97%ef%bc%9a%e4%bb%8e%e5%8e%9f%e7%90%86%e5%88%b0%e5%ae%9e%e6%88%98%e7%9a%84%e5%bf%ab%e9%80%9f%e4%b8%8a%e6%89%8b\/\" target=\"_blank\" rel=\"noopener\">WireGuard \u7684\u914d\u7f6e\u903b\u8f91<\/a>\u57fa\u4e8e\u201c\u975e\u5bf9\u79f0\u5bc6\u94a5\u5bf9\u201d\u3002\u7406\u89e3\u8fd9\u4e00\u903b\u8f91\u662f\u6b63\u786e\u914d\u7f6e\u7684\u524d\u63d0\u3002<\/p>\n<h3>1. \u5bc6\u94a5\u5bf9\u7684\u751f\u6210\u4e0e\u5206\u914d<\/h3>\n<p>WireGuard \u9700\u8981\u4e24\u5bf9\u5bc6\u94a5\uff1a<br \/>* <strong>\u670d\u52a1\u5668\u7aef<\/strong>\uff1a\u751f\u6210\u4e00\u5bf9\u79c1\u94a5\u548c\u516c\u94a5\u3002\u79c1\u94a5\u4fdd\u5bc6\uff0c\u516c\u94a5\u53d1\u7ed9\u5ba2\u6237\u7aef\u3002<br \/>* <strong>\u5ba2\u6237\u7aef<\/strong>\uff1a\u751f\u6210\u4e00\u5bf9\u79c1\u94a5\u548c\u516c\u94a5\u3002\u79c1\u94a5\u4fdd\u5bc6\uff0c\u516c\u94a5\u53d1\u7ed9\u670d\u52a1\u5668\u3002<br \/>* <strong>\u5173\u952e\u8bbe\u7f6e<\/strong>\uff1a\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\uff0c`PrivateKey` \u5fc5\u987b\u4e25\u683c\u4fdd\u5bc6\uff0c\u7edd\u4e0d\u80fd\u6cc4\u9732\u3002`PublicKey` \u53ef\u4ee5\u516c\u5f00\u3002\u5982\u679c\u5bc6\u94a5\u6cc4\u9732\uff0c\u653b\u51fb\u8005\u53ef\u4ee5\u89e3\u5bc6\u4f60\u7684\u6d41\u91cf\u3002<\/p>\n<h3>2. \u63a5\u53e3\u914d\u7f6e\uff08Interface\uff09<\/h3>\n<p>\u8fd9\u662f\u5ba2\u6237\u7aef\u7684\u914d\u7f6e\u6838\u5fc3\u3002<br \/>* <strong>Address<\/strong>\uff1a\u5ba2\u6237\u7aef\u5728\u865a\u62df\u7f51\u7edc\u4e2d\u7684 IP \u5730\u5740\u3002\u901a\u5e38\u7531\u670d\u52a1\u5668\u5206\u914d\uff0c\u5982 `10.0.0.2\/32`\u3002<br \/>* <strong>PrivateKey<\/strong>\uff1a\u5ba2\u6237\u7aef\u7684\u79c1\u94a5\u3002<br \/>* <strong>DNS<\/strong>\uff1a\u6307\u5b9a\u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\u3002\u5efa\u8bae\u8bbe\u7f6e\u4e3a\u8282\u70b9\u7684 DNS \u6216\u516c\u5171 DNS\uff08\u5982 `1.1.1.1` \u6216 `8.8.8.8`\uff09\uff0c\u4ee5\u907f\u514d DNS \u6cc4\u6f0f\u3002<br \/>* <strong>\u64cd\u4f5c\u5efa\u8bae<\/strong>\uff1a\u786e\u4fdd `PrivateKey` \u548c `Address` \u51c6\u786e\u65e0\u8bef\u3002\u4efb\u4f55\u5b57\u7b26\u9519\u8bef\u90fd\u4f1a\u5bfc\u81f4\u8fde\u63a5\u5931\u8d25\u3002<\/p>\n<h3>3. \u5bf9\u7b49\u4f53\u914d\u7f6e\uff08Peer\uff09<\/h3>\n<p>\u8fd9\u662f\u4e0e\u670d\u52a1\u5668\u7684\u8fde\u63a5\u4fe1\u606f\u3002<br \/>* <strong>PublicKey<\/strong>\uff1a\u670d\u52a1\u5668\u7684\u516c\u94a5\u3002<br \/>* <strong>Endpoint<\/strong>\uff1a\u670d\u52a1\u5668\u7684 IP \u5730\u5740\u548c\u7aef\u53e3\uff08\u5982 `example.com:51820`\uff09\u3002<br \/>* <strong>AllowedIPs<\/strong>\uff1a\u6307\u5b9a\u54ea\u4e9b\u6d41\u91cf\u901a\u8fc7\u96a7\u9053\u4f20\u8f93\u3002\u901a\u5e38\u8bbe\u7f6e\u4e3a `0.0.0.0\/0`\uff08\u6240\u6709\u6d41\u91cf\uff09\u6216 `::\/0`\uff08IPv6\uff09\u3002<br \/>* <strong>PersistentKeepalive<\/strong>\uff1a\u4fdd\u6301\u8fde\u63a5\u7684\u5fc3\u8df3\u95f4\u9694\u3002\u5728 NAT \u8bbe\u5907\u540e\uff0c\u5efa\u8bae\u8bbe\u7f6e\u4e3a `25` \u79d2\uff0c\u4ee5\u786e\u4fdd\u8fde\u63a5\u4e0d\u88ab\u8def\u7531\u5668\u8d85\u65f6\u65ad\u5f00\u3002<br \/>* <strong>\u5e38\u89c1\u9519\u8bef<\/strong>\uff1a\u5fd8\u8bb0\u8bbe\u7f6e `PersistentKeepalive` \u5bfc\u81f4\u5728\u79fb\u52a8\u7f51\u7edc\u4e0b\u9891\u7e41\u65ad\u8fde\u3002<\/p>\n<h3>4. \u914d\u7f6e\u9a8c\u8bc1\u65b9\u6cd5<\/h3>\n<p>\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u9a8c\u8bc1\uff1a<br \/>\u2022 <strong>\u72b6\u6001\u68c0\u67e5<\/strong>\uff1a\u5728\u5ba2\u6237\u7aef\u754c\u9762\u67e5\u770b\u72b6\u6001\u662f\u5426\u4e3a `Up`\u3002<br \/>\u2022 <strong>Ping \u6d4b\u8bd5<\/strong>\uff1aPing \u670d\u52a1\u5668\u7684\u865a\u62df IP\uff08\u5982 `ping 10.0.0.1`\uff09\u3002\u5982\u679c\u80fd\u901a\uff0c\u8bf4\u660e\u96a7\u9053\u5efa\u7acb\u6210\u529f\u3002<br \/>\u2022 <strong>\u6d41\u91cf\u6d4b\u8bd5<\/strong>\uff1a\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u4e00\u4e2a\u663e\u793a IP \u7684\u7f51\u7ad9\uff0c\u786e\u8ba4 IP \u5df2\u53d8\u66f4\u4e3a\u76ee\u6807\u8282\u70b9\u7684 IP\u3002<br \/>\u2022 <strong>DNS \u6cc4\u6f0f\u6d4b\u8bd5<\/strong>\uff1a\u4f7f\u7528\u5728\u7ebf DNS \u6cc4\u6f0f\u68c0\u6d4b\u5de5\u5177\uff0c\u786e\u8ba4\u6ca1\u6709\u6cc4\u9732\u672c\u5730 DNS\u3002<\/p>\n<h2>\u5e38\u89c1\u8bef\u533a\u4e0e\u6f5c\u5728\u5c40\u9650<\/h2>\n<p>\u5c3d\u7ba1 WireGuard \u6027\u80fd\u4f18\u8d8a\uff0c\u4f46\u5b83\u5e76\u975e\u4e07\u80fd\u3002\u4e86\u89e3\u5176\u5c40\u9650\u6027\u80fd\u5e2e\u52a9\u4f60\u907f\u514d\u65e5\u5e38\u4f7f\u7528\u4e2d\u7684\u56f0\u6270\u3002<\/p>\n<h3>\u8bef\u533a\u4e00\uff1aWireGuard \u81ea\u5e26\u52a0\u5bc6\uff0c\u65e0\u9700\u5176\u4ed6\u534f\u8bae<\/h3>\n<p>WireGuard \u786e\u5b9e\u63d0\u4f9b\u4f20\u8f93\u5c42\u52a0\u5bc6\uff0c\u4f46\u5b83\u4e0d\u5904\u7406\u5e94\u7528\u5c42\u534f\u8bae\u3002\u5982\u679c\u67d0\u4e9b\u7f51\u7ad9\u6216 App \u4f7f\u7528\u81ea\u5b9a\u4e49\u534f\u8bae\u6216\u6df1\u5ea6\u68c0\u6d4b\uff0c\u5355\u7eaf WireGuard \u53ef\u80fd\u65e0\u6cd5\u7ed5\u8fc7\u3002<br \/>* <strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a\u9009\u62e9\u652f\u6301\u201c\u534f\u8bae\u6df7\u6dc6\u201d\u6216\u201c\u591a\u534f\u8bae\u5c01\u88c5\u201d\u7684\u8282\u70b9\u670d\u52a1\u3002\u8bb8\u591a\u73b0\u4ee3\u4ee3\u7406\u5de5\u5177\u5141\u8bb8\u4f60\u5728 WireGuard \u4e4b\u4e0a\u6dfb\u52a0 WebSocket \u6216 mKCP \u5c01\u88c5\uff0c\u4ee5\u589e\u5f3a\u9690\u853d\u6027\u3002<\/p>\n<h3>\u8bef\u533a\u4e8c\uff1aWireGuard \u914d\u7f6e\u8d8a\u590d\u6742\u8d8a\u597d<\/h3>\n<p>WireGuard \u7684\u8bbe\u8ba1\u521d\u8877\u662f\u7b80\u5355\u3002\u8fc7\u5ea6\u590d\u6742\u7684\u914d\u7f6e\uff08\u5982\u624b\u52a8\u8def\u7531\u8868\u3001\u7b56\u7565\u8def\u7531\uff09\u53cd\u800c\u5bb9\u6613\u51fa\u9519\u3002<br \/>* <strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a\u9664\u975e\u4f60\u6709\u9ad8\u7ea7\u7f51\u7edc\u77e5\u8bc6\uff0c\u5426\u5219\u4f7f\u7528\u9ed8\u8ba4\u914d\u7f6e\uff08`AllowedIPs: 0.0.0.0\/0`\uff09\u5373\u53ef\u3002\u5927\u591a\u6570\u65e5\u5e38\u9700\u6c42\u65e0\u9700\u590d\u6742\u8def\u7531\u3002<\/p>\n<h3>\u5c40\u9650\u4e00\uff1a\u7f3a\u4e4f\u5185\u7f6e\u7684\u591a\u7528\u6237\u8ba4\u8bc1<\/h3>\n<p>WireGuard \u672c\u8eab\u4e0d\u652f\u6301\u7528\u6237\u540d\/\u5bc6\u7801\u8ba4\u8bc1\u3002\u6240\u6709\u8ba4\u8bc1\u90fd\u57fa\u4e8e\u5bc6\u94a5\u3002<br \/>* <strong>\u5f71\u54cd<\/strong>\uff1a\u5982\u679c\u5bc6\u94a5\u6cc4\u9732\uff0c\u65e0\u9700\u5bc6\u7801\u5373\u53ef\u63a5\u5165\u3002\u56e0\u6b64\uff0c\u5bc6\u94a5\u7ba1\u7406\u81f3\u5173\u91cd\u8981\u3002<br \/>* <strong>\u5e94\u5bf9\u7b56\u7565<\/strong>\uff1a\u5b9a\u671f\u66f4\u6362\u5bc6\u94a5\uff0c\u6216\u4f7f\u7528\u652f\u6301\u5bc6\u94a5\u8f6e\u6362\u7684\u670d\u52a1\u5546\u3002<\/p>\n<h3>\u5c40\u9650\u4e8c\uff1aIPv6 \u652f\u6301\u4e0d\u5b8c\u5584<\/h3>\n<p>\u867d\u7136 WireGuard \u539f\u751f\u652f\u6301 IPv6\uff0c\u4f46\u8bb8\u591a\u8282\u70b9\u670d\u52a1\u6216\u5ba2\u6237\u7aef\u5bf9 IPv6 \u7684\u652f\u6301\u4ecd\u4e0d\u5b8c\u5584\u3002<br \/>* <strong>\u5f71\u54cd<\/strong>\uff1a\u5728 IPv6 \u7f51\u7edc\u4e0b\uff0c\u53ef\u80fd\u51fa\u73b0\u6d41\u91cf\u6cc4\u6f0f\uff08IPv6 \u6d41\u91cf\u672a\u8d70\u96a7\u9053\uff09\u3002<br \/>* <strong>\u5e94\u5bf9\u7b56\u7565<\/strong>\uff1a\u5728\u5ba2\u6237\u7aef\u914d\u7f6e\u4e2d\uff0c\u660e\u786e\u7981\u7528 IPv6 \u6216\u786e\u4fdd IPv6 \u6d41\u91cf\u4e5f\u901a\u8fc7\u96a7\u9053\u4f20\u8f93\u3002\u68c0\u67e5\u7cfb\u7edf\u7684\u7f51\u7edc\u8bbe\u7f6e\uff0c\u786e\u4fdd\u6ca1\u6709 IPv6 \u4f18\u5148\u3002<\/p>\n<h2>\u5982\u4f55\u5224\u65ad\u4f60\u662f\u5426\u5e94\u8be5\u7ee7\u7eed\u4f7f\u7528 WireGuard<\/h2>\n<p>\u5728\u65e5\u5e38\u4f7f\u7528\u4e2d\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6807\u51c6\u5224\u65ad WireGuard \u662f\u5426\u4ecd\u9002\u5408\u4f60\uff1a<\/p>\n<table style=\"width:100%;border-collapse:collapse;margin:24px 0;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u5224\u65ad\u7ef4\u5ea6<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u9002\u5408\u7ee7\u7eed\u4f7f\u7528<\/th>\n<th style=\"border:1px solid #ddd;padding:10px;background:#f7f7f7;text-align:left;\">\u5efa\u8bae\u66f4\u6362\u6216\u8865\u5145<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u8fde\u63a5\u7a33\u5b9a\u6027<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u5207\u6362\u7f51\u7edc\u65f6\u65e0\u611f\uff0c\u540e\u53f0\u4e0d\u6389\u7ebf<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u9891\u7e41\u65ad\u8fde\uff0c\u9700\u624b\u52a8\u91cd\u8fde<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u8d44\u6e90\u5360\u7528<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u624b\u673a\u53d1\u70ed\u4f4e\uff0c\u7535\u8111\u65e0\u5361\u987f<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u8bbe\u5907\u8001\u65e7\uff0c\u6027\u80fd\u4e0d\u8db3<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u914d\u7f6e\u7ef4\u62a4<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u914d\u7f6e\u4e00\u6b21\uff0c\u957f\u671f\u6709\u6548<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u8282\u70b9\u9891\u7e41\u53d8\u52a8\uff0c\u914d\u7f6e\u9700\u9891\u7e41\u66f4\u65b0<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u9690\u853d\u9700\u6c42<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u4ec5\u9700\u52a0\u5bc6\uff0c\u65e0\u9700\u9ad8\u5ea6\u4f2a\u88c5<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u88ab\u4e25\u683c\u5ba1\u67e5\uff0c\u9700\u534f\u8bae\u6df7\u6dc6<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\"><strong>\u591a\u5e73\u53f0\u540c\u6b65<\/strong><\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u5e0c\u671b\u591a\u8bbe\u5907\u914d\u7f6e\u4e00\u81f4<\/td>\n<td style=\"border:1px solid #ddd;padding:10px;vertical-align:top;\">\u9700\u8981\u590d\u6742\u7684\u7528\u6237\u8ba4\u8bc1\u548c\u6743\u9650\u7ba1\u7406<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/p>\n<h3>\u6700\u7ec8\u5efa\u8bae<\/h3>\n<p>\u5bf9\u4e8e\u5927\u591a\u6570\u4e2a\u4eba\u65e5\u5e38\u7528\u6237\uff0cWireGuard \u662f\u4e00\u4e2a\u9ad8\u6548\u3001\u7a33\u5b9a\u4e14\u8d44\u6e90\u53cb\u597d\u7684\u9009\u62e9\u3002\u5b83\u7279\u522b\u9002\u5408\u79fb\u52a8\u7aef\u7528\u6237\u3001\u4f4e\u914d\u7f6e\u8bbe\u5907\u7528\u6237\u4ee5\u53ca\u5bf9\u5ef6\u8fdf\u654f\u611f\u7684\u7528\u6237\u3002<\/p>\n<p>\u7136\u800c\uff0c\u5982\u679c\u4f60\u7684\u4f7f\u7528\u573a\u666f\u6d89\u53ca\u9ad8\u5ea6\u9690\u853d\u9700\u6c42\uff08\u5982\u5728\u4e25\u683c\u5ba1\u67e5\u73af\u5883\u4e2d\uff09\uff0c\u6216\u9700\u8981\u590d\u6742\u7684\u7528\u6237\u8ba4\u8bc1\u7ba1\u7406\uff0c\u5355\u7eaf\u4f9d\u8d56 WireGuard \u53ef\u80fd\u4e0d\u591f\u3002\u6b64\u65f6\uff0c\u5e94\u8003\u8651\u4f7f\u7528\u652f\u6301 WireGuard \u4f5c\u4e3a\u5e95\u5c42\u4f20\u8f93\u3001\u4e0a\u5c42\u5c01\u88c5\u6df7\u6dc6\u534f\u8bae\u7684\u7ec4\u5408\u65b9\u6848\u3002<\/p>\n<p>\u914d\u7f6e WireGuard \u65f6\uff0c\u52a1\u5fc5\u4fdd\u62a4\u597d\u4f60\u7684\u79c1\u94a5\uff0c\u5b9a\u671f\u68c0\u67e5 DNS \u6cc4\u6f0f\uff0c\u5e76\u6839\u636e\u7f51\u7edc\u73af\u5883\u8c03\u6574 `PersistentKeepalive` \u53c2\u6570\u3002\u901a\u8fc7\u8fd9\u4e9b\u7b80\u5355\u7684\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u5145\u5206\u53d1\u6325 WireGuard \u5728\u65e5\u5e38\u4f7f\u7528\u4e2d\u7684\u4f18\u52bf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WireGuard \u662f\u5426\u9002\u5408\u4e2a\u4eba\u65e5\u5e38\u4f7f\u7528\uff0c\u6838\u5fc3\u53d6\u51b3\u4e8e\u4f60\u5bf9\u201c\u8f7b\u91cf\u7ea7\u201d\u3001\u201c\u4f4e\u5ef6\u8fdf\u201d\u4ee5\u53ca\u201c\u914d\u7f6e\u81ea\u4e3b\u6743\u201d\u7684\u9700\u6c42\u3002\u4e0e\u4f20\u7edf [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1362","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts\/1362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/comments?post=1362"}],"version-history":[{"count":0,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/posts\/1362\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/media?parent=1362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/categories?post=1362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suannai.link\/blog\/wp-json\/wp\/v2\/tags?post=1362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}