{"id":13272,"date":"2024-08-26T10:58:19","date_gmt":"2024-08-26T02:58:19","guid":{"rendered":"https:\/\/blog.pfchina.org\/?p=13272"},"modified":"2024-09-06T16:41:32","modified_gmt":"2024-09-06T08:41:32","slug":"openwrt%e6%90%ad%e5%bb%ba%e8%bf%9c%e7%a8%8b%e8%ae%bf%e9%97%aewireguard%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/blog.pfchina.org\/?p=13272","title":{"rendered":"OpenWrt\u642d\u5efa\u8fdc\u7a0b\u8bbf\u95eeWireGuard\u670d\u52a1\u5668"},"content":{"rendered":"<p>WireGuard\u662f\u4e00\u79cd\u73b0\u4ee3\u3001\u5feb\u901f\u4e14\u5b89\u5168\u7684\u865a\u62df\u4e13\u7528\u7f51\u7edc (VPN) \u901a\u4fe1\u534f\u8bae\u548c\u514d\u8d39\u5f00\u6e90\u8f6f\u4ef6\u3002WireGuard\u6613\u4e8e\u4f7f\u7528\u3001\u6027\u80fd\u9ad8\u6548\u3002\u5b83\u5229\u7528\u4e86\u6700\u65b0\u7684\u52a0\u5bc6\u6280\u672f\uff0c\u63d0\u4f9b\u4e86\u6bd4IPsec\u548cOpenVPN \u7b49\u4f20\u7edf VPN \u534f\u8bae\u66f4\u597d\u7684\u6027\u80fd\u548c\u66f4\u5f3a\u5927\u7684\u529f\u80fd\u3002WireGuard\u534f\u8bae\u901a\u8fc7UDP\u4f20\u9012\u6d41\u91cf\uff0c\u901f\u5ea6\u548c\u5b89\u5168\u6027\u6709\u663e\u8457\u4f18\u52bf\u3002\u5b83\u8bbe\u8ba1\u7b80\u5355\u3001\u9ad8\u6548\uff0c\u9002\u7528\u4e8e\u8303\u56f4\u5e7f\u3002\u672c\u6587\u4ecb\u7ecd\u5728OpenWrt\u4e2d\u642d\u5efaWireGuarde\u670d\u52a1\u5668\uff0c\u5e76\u901a\u8fc7\u624b\u673a\u8fdc\u7a0b\u8fde\u63a5\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u672c\u6587\u4f7f\u7528\u7684\u56fa\u4ef6\uff1a<a href=\"https:\/\/downloads.immortalwrt.org\/\"><span style=\"color: #0000ff;\">ImmortalWrt 23.05.3<\/span><\/a>\u3002\u5176\u4ed6\u56fa\u4ef6\u7684\u914d\u7f6e\u65b9\u6cd5\u53ef\u80fd\u4e0e\u672c\u6587\u4e0d\u5c3d\u76f8\u540c\u3002<\/p>\n<h1 id=\"\u5b89\u88c5\u8f6f\u4ef6\u5305\">\u5b89\u88c5\u8f6f\u4ef6<\/h1>\n<p>\u5bfc\u822a\u5230<em>\u7cfb\u7edf&gt;\u8f6f\u4ef6\u5305<\/em>\uff0c\u641c\u7d22\u5e76\u5b89\u88c5luci-proto-wireguard\u548cqrencode\u4e24\u4e2a\u8f6f\u4ef6\u5305\uff0c\u5176\u4e2dluci-proto-wireguard \u662fWireGuard\u7684\u6838\u5fc3\u5305\uff0cqrencode\u7528\u6765\u751f\u6210\u5ba2\u6237\u7aef\u4e8c\u7ef4\u7801\u3002<\/p>\n<p>\u5b89\u88c5\u540e\u91cd\u542f\u4e00\u6b21\u7f51\u7edc\u670d\u52a1\uff0c\u4e5f\u4fbf\u8ba9\u63a5\u53e3\u751f\u6210WireGuard VPN\u534f\u8bae\uff0c\u4e5f\u53ef\u4ee5\u91cd\u542fOpenWrt\uff0c\u5426\u5219\u65e0\u6cd5\u8fdb\u884c\u4e0b\u4e00\u6b65\uff01<\/p>\n<p>\u8f6c\u5230\u7cfb\u7edf&gt;\u542f\u52a8\u9879\uff0c\u627e\u5230network\uff0c\u70b9\u51fb\u53f3\u4fa7\u7684\u91cd\u542f\u6309\u94ae\u5373\u53ef\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-20-07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13274\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-20-07.png\" alt=\"\" width=\"2150\" height=\"122\" \/><\/a><\/p>\n<h1>\u914d\u7f6e\u670d\u52a1<\/h1>\n<h3 id=\"\u521b\u5efa\u63a5\u53e3\">1\u3001\u521b\u5efa\u63a5\u53e3<\/h3>\n<p>WireGuard\u5728OpenWrt\u4e2d\u662f\u4ee5\u63a5\u53e3\u7684\u5f62\u5f0f\u6765\u914d\u7f6e\u548c\u4f7f\u7528\uff0c\u8f6c\u5230<em>\u7f51\u7edc&gt;\u63a5\u53e3<\/em>\uff0c\u6dfb\u52a0\u4e00\u4e2a\u63a5\u53e3\uff0c\u534f\u8bae\u9009WireGuard VPN\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-29-13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13281\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-29-13.png\" alt=\"\" width=\"2361\" height=\"446\" \/><\/a><\/p>\n<p>\u63a5\u53e3\u914d\u7f6e\u9009\u9879\u5982\u4e0b\uff1a<\/p>\n<p>\u5728\u5e38\u89c4\u5219\u8bbe\u7f6e\u680f\uff0c\u70b9\u51fb\u751f\u6210\u65b0\u7684\u5bc6\u94a5\u5bf9\uff0c\u8f93\u5165\u76d1\u542c\u5730\u5740\u548cIP\u5730\u5740\uff0c\u8be5IP\u5730\u5740\u662fWireGrard VPN\u96a7\u9053\u4f7f\u7528\u7684\u5730\u5740\uff0c\u4e0d\u80fd\u4e0eLAN\u63a5\u53e3\u5730\u5740\u5728\u540c\u4e00\u7f51\u6bb5\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-30-24.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13280 size-full\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-30-24.png\" alt=\"\" width=\"1423\" height=\"1764\" \/><\/a><\/p>\n<p>\u9ad8\u7ea7\u8bbe\u7f6e\u90e8\u5206\uff0c\u9009\u4e2d\u4f7f\u7528\u9ed8\u8ba4\u7f51\u5173\u9009\u9879\uff0c\u901a\u8fc7openwrt\u6765\u8def\u7531\u6d41\u91cf\uff0c\u5176\u4ed6\u9009\u9879\u4fdd\u6301\u9ed8\u8ba4\u5373\u53ef\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-25-25.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13276\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-25-25.png\" alt=\"\" width=\"1890\" height=\"1960\" \/><\/a><\/p>\n<p>\u9632\u706b\u5899\u533a\u57df\uff0c\u8bbe\u7f6e\u4e3a\u4e0eLAN\u5728\u540c\u4e00\u533a\u57df\uff0c\u65b9\u4fbf\u8bbf\u95ee\u5185\u7f51\u8d44\u6e90\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-25-37.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13277\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-25-37.png\" alt=\"\" width=\"1329\" height=\"313\" \/><\/a><\/p>\n<p>\u6dfb\u52a0\u4e00\u4e2a\u8fdc\u7a0b\u7aef\u70b9\uff0c\u70b9\u51fb\u751f\u6210\u65b0\u7684\u5bc6\u94a5\u5bf9\uff0c\u8f93\u5165\u8fdc\u7a0b\u7aef\u70b9\u7684IP\u5730\u5740\uff0c\u8be5IP\u5730\u5740\u5fc5\u987b\u4e0eWireGuard\u670d\u52a1\u5668\u7684IP\u5730\u5740\u5728\u540c\u4e00\u7f51\u6bb5\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_11-03-49.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-13292 size-full\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_11-03-49.png\" alt=\"\" width=\"2232\" height=\"1980\" \/><\/a>\u914d\u7f6e\u5b8c\u6210\u4ee5\u540e\uff0c\u70b9\u51fb\u5e95\u90e8\u7684\u4fdd\u5b58\u6309\u94ae\u4fdd\u5b58\u914d\u7f6e\u3002<\/p>\n<h1 id=\"\u9632\u706b\u5899\u914d\u7f6e\">\u9632\u706b\u5899\u914d\u7f6e<\/h1>\n<p id=\"\u914d\u7f6e\u5de5\u4f5c\u7aef\u53e3\u5165\u7ad9\u653e\u884c\">\u653e\u884cWireGrard\u5165\u7ad9\u7aef\u53e3\u3002\u8f6c\u5230<em>\u7f51\u7edc&gt;\u9632\u706b\u5899<\/em>\uff0c\u901a\u4fe1\u89c4\u5219\u9009\u9879\u5361\uff0c\u6dfb\u52a0\u4e00\u6761\u653e\u884c\u89c4\u5219\uff0c\u6e90\u533a\u57df\u4e3aWAN\uff0c\u76ee\u6807\u533a\u57df\u4e3a\u8bbe\u5907\uff0c\u76ee\u6807IP\u7aef\u53e3\u4e3aWireGuard\u670d\u52a1\u5668\u8bbe\u7f6e\u7684\u76d1\u542c\u7aef\u53e3\uff0c\u64cd\u4f5c\u9009\u63a5\u53d7\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-41-06.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13282\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-41-06.png\" alt=\"\" width=\"2379\" height=\"1278\" \/><\/a><\/p>\n<p>\u6dfb\u52a0\u5b8c\u6210\u4ee5\u540e\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-42-56.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13283\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-42-56.png\" alt=\"\" width=\"2095\" height=\"130\" \/><\/a><\/p>\n<p>\u81f3\u6b21\uff0cOpenWrt\u7684WireGuard\u670d\u52a1\u5668\u5c31\u914d\u7f6e\u5b8c\u6210\u4e86\u3002<\/p>\n<h1>\u5ba2\u6237\u7aef\u914d\u7f6e<\/h1>\n<p>\u5728WireGuard\u63a5\u53e3\u7684\u5bf9\u7aef\u4e2d\u6253\u5f00\u76ee\u6807\u5bf9\u7aef\u7684\u8be6\u60c5\u9875\uff0c\u70b9\u51fb\u751f\u6210\u914d\u7f6e\u6309\u94ae\uff0c\u6b64\u9875\u9762\u4e0a\u534a\u90e8\u5206\u8bbe\u7f6e\u5bfc\u51fa\u7ed9\u5ba2\u6237\u7aef\u914d\u7f6e\u7684\u8fde\u63a5\u7aef\u70b9\u3001\u8def\u7531\u3001DNS\u548cIP \u7b49\u4fe1\u606f\uff0c\u4e0b\u534a\u90e8\u5206\u5219\u662f\u5bf9\u5e94\u7684\u914d\u7f6e\u4e8c\u7ef4\u7801\u3002<\/p>\n<p>\u5982\u679c\u662f\u52a8\u6001\u516c\u7f51\uff0c\u53ef\u4ee5\u5728\u8fde\u63a5\u7aef\u70b9\u5904\u8f93\u5165\u52a8\u6001\u57df\u540d\uff0c\u56de\u8f66\u786e\u8ba4\u540e\u4f1a\u751f\u6210\u65b0\u7684\u8fde\u63a5\u4e8c\u7ef4\u7801\u3002<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-49-01.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13286\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-49-01.png\" alt=\"\" width=\"1682\" height=\"591\" \/><\/a><\/p>\n<p>\u7528\u624b\u673aWireGuard\u5ba2\u6237\u7aef\u626b\u63cf\uff0c\u5373\u53ef\u6dfb\u52a0\u5ba2\u6237\u7aef\u7684\u914d\u7f6e\u3002<a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-45-52.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13285\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_10-45-52.png\" alt=\"\" width=\"1449\" height=\"883\" \/><\/a><\/p>\n<p>Windows\u7cfb\u7edf\u53ea\u9700\u8981\u5728WireGuard\u65b0\u5efa\u4e00\u4e2a\u7a7a\u96a7\u9053\uff0c\u7136\u540e\u590d\u5236\u4e0a\u9762\u7684\u914d\u7f6e\u6587\u672c\u5373\u53ef\u5efa\u7acb\u96a7\u9053\u3002<\/p>\n<h1>\u68c0\u67e5\u6d4b\u8bd5<\/h1>\n<p>\u624b\u673a\u5ba2\u6237\u7aef\u5173\u95edWIFI\uff0c\u4f7f\u75285G\u8fde\u63a5\uff0c\u6253\u5f00WireGuard\u8f6f\u4ef6\u7684VPN\u8fde\u63a5\uff0c\u6d4b\u8bd5\u662f\u5426\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95eeOpenWrt \u3002\u5982\u679cOpenWrt\u8bbe\u7f6e\u4e86\u4ee3\u7406\uff0c\u90a3\u4e48\u624b\u673a\u5ba2\u6237\u7aef\u4e5f\u80fd\u6b63\u5e38\u8bbf\u95eegoogle\u3001Youtube\u7b49\u7f51\u7ad9\u3002WireGuard\u8fde\u63a5\u72b6\u6001\u53ef\u4ee5\u5728<em>\u72b6\u6001&gt;WireGuard<\/em>\u5904\u67e5\u770b\u3002<\/p>\n<p>\u6b65\u9aa4\u548c\u914d\u7f6e\u90fd\u6ca1\u6709\u95ee\u9898\uff0c\u4f46\u662f\u6b7b\u6d3b\u8fde\u4e0d\u4e0a\uff0c\u5b9e\u4f8b\u4e5f\u6ca1\u6709\u5bf9\u7aef\u51fa\u73b0\uff0c\u8bd5\u8bd5\u91cd\u542f\u4e00\u4e0bOpenWrt\uff0c\u53ef\u80fd\u4f1a\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_11-10-02.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13295\" src=\"https:\/\/blog.pfchina.org\/wp-content\/uploads\/2024\/08\/Snipaste_2024-08-26_11-10-02.png\" alt=\"\" width=\"2621\" height=\"692\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WireGuard\u662f\u4e00\u79cd\u73b0\u4ee3\u3001\u5feb\u901f\u4e14\u5b89\u5168\u7684\u865a\u62df\u4e13\u7528\u7f51\u7edc (VPN) \u901a\u4fe1\u534f\u8bae\u548c\u514d &hellip; <a href=\"https:\/\/blog.pfchina.org\/?p=13272\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[414],"tags":[101],"class_list":["post-13272","post","type-post","status-publish","format-standard","hentry","category-openwrt","tag-wireguard"],"_links":{"self":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/13272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13272"}],"version-history":[{"count":15,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/13272\/revisions"}],"predecessor-version":[{"id":13514,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=\/wp\/v2\/posts\/13272\/revisions\/13514"}],"wp:attachment":[{"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pfchina.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}