{"id":24,"date":"2024-10-29T22:37:00","date_gmt":"2024-10-29T14:37:00","guid":{"rendered":"https:\/\/zty.ink\/?p=24"},"modified":"2025-09-01T00:41:15","modified_gmt":"2025-08-31T16:41:15","slug":"%e5%9f%ba%e4%ba%8e-wireguard-%e7%9a%84%e5%86%85%e7%bd%91%e7%bb%84%e7%bd%91%e6%95%99%e7%a8%8b%ef%bc%9a%e5%ae%9e%e7%8e%b0%e5%a4%9a%e8%ae%be%e5%a4%87%e9%97%b4%e7%9a%84%e5%ae%89%e5%85%a8%e4%ba%92%e8%81%94","status":"publish","type":"post","link":"https:\/\/zty.ink\/?p=24","title":{"rendered":"\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u524d\u8a00<\/h1>\n\n\n\n<p>\u5f88\u4e45\u4ee5\u524d\u5199\u4e86<a href=\"https:\/\/zty.ink\/posts\/Technical\/fpr_over_wireguard\">frp over wirguard<\/a>\u8fd9\u7bc7\u6587\u7ae0\uff0c\u91cc\u9762\u4e3b\u8981\u8bb2\u8ff0\u4e86\u5982\u4f55\u901a\u8fc7wireguard\u6253\u901a\u901a\u9053\uff0c\u5e76\u901a\u8fc7frp\u5c06\u5185\u90e8\u7aef\u53e3\u6620\u5c04\u51fa\u53bb\uff0c\u4e3b\u8981\u4f5c\u7528\u4e3a\u5c06\u65e0\u516c\u7f51IP\u7684\u670d\u52a1\u5668\u7684\u670d\u52a1\u901a\u8fc7\u6709\u516c\u7f51IP\u7684\u670d\u52a1\u5668\u6620\u5c04\u51fa\u53bb\uff0c\u8fbe\u5230\u7f51\u7edc\u53ef\u8bbf\u95ee\u5185\u7f51\u670d\u52a1\u5668\u670d\u52a1\u7684\u6548\u679c\u3002\u672c\u6587\u4e3b\u8981\u8bb2\u89e3\u901a\u8fc7wireguard\u8fdb\u884c\u7ec4\u7f51\uff0c\u8fbe\u5230\u6240\u6709\u8bbe\u5907\u5185\u90e8\u8bbf\u95ee\u7684\u6548\u679c\uff0c\u4e0e\u524d\u6587\u4e0d\u540c\u7684\u662f\uff0c\u524d\u6587\u5c06\u5ba2\u6237\u7aef\u7f6e\u4e8e\u8be5\u5185\u7f51\u5916\u90e8\uff0c\u672c\u6587\u5c06\u5ba2\u6237\u7aef\u7f6e\u4e8e\u5185\u7f51\u5185\u90e8\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u5e94\u7528<\/h1>\n\n\n\n<p>\u6b64\u65b9\u6cd5\u642d\u5efa\u51fa\u6765\u5185\u7f51\u5e94\u5f53\u662f\u9762\u5411\u4e2a\u4eba\u4f7f\u7528\uff0c\u4f8b\u5982\u5c06\u81ea\u5df1\u7684\u786c\u76d8\u6620\u5c04\u51fa\u6765\uff0c\u81ea\u5df1\u5728\u4efb\u4f55\u5730\u65b9\u90fd\u53ef\u4ee5\u8bbf\u95ee\uff1b\u66f4\u65b9\u4fbf\u5730\u8fdc\u7a0b\u63a7\u5236\u7535\u8111\u7b49\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u8be6\u7ec6\u5de5\u4f5c<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u51c6\u5907<\/h2>\n\n\n\n<p>\u7531\u4e8ewireguard\u91c7\u7528\u4e86interface\uff08\u672c\u7aef\uff09\u548cpeer\uff08\u5bf9\u7aef\uff09\u7684\u65b9\u5f0f\uff0c\u672c\u6587\u4e0d\u533a\u5206\u5404\u4e2a\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u7aef\uff0c\u4f46\u662f\u4e3a\u4e86\u65b9\u4fbf\u533a\u5206\uff0c\u5c06\u6709\u516c\u7f51IP\u7684\u670d\u52a1\u5668\u6210\u4e3a\u670d\u52a1\u7aef\u3002<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u5e94\u5f53\u5728\u5404\u8bbe\u5907\u4e0a\u5b89\u88c5wireguard\uff0c\u5404\u8bbe\u5907\u5e94\u5f53\u53c2\u7167<a href=\"https:\/\/www.wireguard.com\/install\/\">wireguard\u5b98\u7f51<\/a>\u5b89\u88c5\uff0c\u6b64\u5904\u4ec5\u5217\u4e3e\u51fa\u4e00\u822c\u8bbe\u5907\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ubuntu\uff1a<code>sudo apt install wireguard<\/code><\/li>\n\n\n\n<li>Windows\uff1a<a href=\"https:\/\/download.wireguard.com\/windows-client\/wireguard-installer.exe\">\u4e0b\u8f7d\u5b89\u88c5\u8f6f\u4ef6<\/a>\u5e76\u5b89\u88c5<\/li>\n\n\n\n<li>IOS\uff1a\u4f7f\u7528\u7f8e\u533aicloud id\u767b\u5f55app store\uff0c\u76f4\u63a5\u4e0b\u8f7d\u5b89\u88c5<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e2d\u5fc3\u670d\u52a1\u5668\u57fa\u672c\u914d\u7f6e\u642d\u5efa<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u751f\u6210\u516c\u79c1\u94a5\u5bf9<\/h3>\n\n\n\n<p>\u5728\u6b64\u5904\u6211\u4f7f\u7528\u4e86Ubuntu\u4f5c\u4e3a\u6211\u7684\u670d\u52a1\u5668\u7cfb\u7edf\uff0c\u5176\u4ed6\u8bbe\u5907\u81ea\u884c\u67e5\u627e\u914d\u7f6e\u6587\u4ef6\u4f4d\u7f6e\u3002<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u751f\u6210\u670d\u52a1\u5668\u7aef\u9700\u8981\u7684\u516c\u79c1\u94a5<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>sudo mkdir -p \/etc\/wireguard &amp;&amp; sudo chmod 0777 \/etc\/wireguard &amp;&amp; cd \/etc\/wireguard\numask 077 \nwg genkey | tee private.key | wg pubkey > public.key<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #62E884\">sudo<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">mkdir<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">-p<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">\/etc\/wireguard<\/span><span style=\"color: #F6F6F4\"> &amp;&amp; <\/span><span style=\"color: #62E884\">sudo<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">chmod<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">0777<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">\/etc\/wireguard<\/span><span style=\"color: #F6F6F4\"> &amp;&amp; <\/span><span style=\"color: #97E1F1\">cd<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">\/etc\/wireguard<\/span><\/span>\n<span class=\"line\"><span style=\"color: #97E1F1\">umask<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">077<\/span><span style=\"color: #F6F6F4\"> <\/span><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">wg<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">genkey<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">|<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #62E884\">tee<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">private.key<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">|<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #62E884\">wg<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">pubkey<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">&gt;<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">public.key<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u521b\u5efa\u516c\u79c1\u94a5\u540e\u53ef\u4ee5\u67e5\u770b\u79c1\u94a5\u5185\u5bb9\uff0c\u540e\u9762\u914d\u7f6e\u9700\u8981<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>cat public.key\ncat private.ley<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #62E884\">cat<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">public.key<\/span><\/span>\n<span class=\"line\"><span style=\"color: #62E884\">cat<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">private.ley<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u914d\u7f6e\u6587\u4ef6\u8bb2\u89e3<\/h3>\n\n\n\n<p>wireguard\u9ed8\u8ba4\u5c06\u914d\u7f6e\u6587\u4ef6\u653e\u7f6e\u4e8e<code>\/etc\/wireguard\/<\/code>\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>wg0.conf\/wg1.conf<\/code>\u8fd9\u6837\u7684\u65b9\u5f0f\u8fdb\u884c\u547d\u540d\uff0c<strong>\u4e00\u4e2a\u7ec4\u7f51\u4f7f\u7528\u4e00\u4e2a\u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>\u4ee5\u4e0b\u4e3a\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n\n\n\n<p>\u7f16\u8f91\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6<code>\/etc\/wireguard\/wg0.conf<\/code><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>nano \/etc\/wireguard\/wg0.conf<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #62E884\">nano<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #E7EE98\">\/etc\/wireguard\/wg0.conf<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u7531\u4e8e\u670d\u52a1\u5668\u6211\u4eec\u4f5c\u4e3a\u63d0\u4f9b\u516c\u5171ip\u7684\u670d\u52a1\u5668\uff0c\u540c\u65f6\u8fd8\u8d1f\u8d23\u8f6c\u53d1\u6d41\u91cf\u7684\u670d\u52a1\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u6709PostUp\u548cPostDown\u7684\u8bbe\u7f6e\uff0c\u4ee5\u53ca\u5bf9\u4e8e\u6bcf\u4e2a\u5bf9\u7aefPeer\uff08\u7ec4\u7f51\u4e2d\u5176\u4ed6\u8bbe\u5907\uff09\uff0c\u5728\u6bcf\u6b21\u6dfb\u52a0\u8bbe\u5907\u7684\u65f6\u5019\u6211\u4eec\u8fd8\u9700\u8981\u989d\u5916\u6dfb\u52a0\uff0c\u5728\u540e\u6587\u4e5f\u4f1a\u6709\u8bb2\u8ff0\u3002<\/p>\n\n\n\n<p>wireguard\u7684\u914d\u7f6e\u6587\u4ef6\u683c\u5f0f\u5927\u6982\u4e3a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&#91;Interface&#93;\n\u672c\u673a\u914d\u7f6e\n\n&#91;Peer&#93;\n\u5bf9\u7aef\u914d\u7f6e\n\n&#91;Peer&#93;\n\u5bf9\u7aef\u914d\u7f6e\n\n......<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">&#91;Interface&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">\u672c\u673a\u914d\u7f6e<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">&#91;Peer&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">\u5bf9\u7aef\u914d\u7f6e<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">&#91;Peer&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">\u5bf9\u7aef\u914d\u7f6e<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #F6F6F4\">......<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u56e0\u6b64\u6211\u4eec\u5206\u5f00\u914d\u7f6e\u4e24\u4e2a\u90e8\u5206\u8fdb\u884c\u8bb2\u89e3\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u914d\u7f6e\u6587\u4ef6Interface\u90e8\u5206\u914d\u7f6e<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&#91;Interface&#93;\nPrivateKey = \u6b64\u5904\u586b\u5199\u5bc6\u94a5\u5185\u5bb9\nAddress = 10.0.8.1\/24\nPostUp   = iptables -A FORWARD -i wg0 -o wg0 -j ACCEPT; iptables -A FORWARD -i wg0 -o eth0 -j ACCEPT; iptables -A FORWARD -i eth0 -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nPostDown = iptables -D FORWARD -i wg0 -o wg0 -j ACCEPT; iptables -D FORWARD -i wg0 -o eth0 -j ACCEPT; iptables -D FORWARD -i eth0 -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE\nListenPort = \u6b64\u5904\u586b\u5199\u7aef\u53e3\nMTU = 1420<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">&#91;Interface&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">PrivateKey<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> \u6b64\u5904\u586b\u5199\u5bc6\u94a5\u5185\u5bb9<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">Address<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> 10.0.8.1\/24<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">PostUp<\/span><span style=\"color: #F6F6F4\">   <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> iptables -A FORWARD -i wg0 -o wg0 -j ACCEPT<\/span><span style=\"color: #7B7F8B\">; iptables -A FORWARD -i wg0 -o eth0 -j ACCEPT; iptables -A FORWARD -i eth0 -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">PostDown<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> iptables -D FORWARD -i wg0 -o wg0 -j ACCEPT<\/span><span style=\"color: #7B7F8B\">; iptables -D FORWARD -i wg0 -o eth0 -j ACCEPT; iptables -D FORWARD -i eth0 -o wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">ListenPort<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> \u6b64\u5904\u586b\u5199\u7aef\u53e3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">MTU<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> 1420<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u5176\u4e2d\u5bc6\u94a5\u3001\u7aef\u53e3\u4ee5\u53ca\u5185\u7f51\u5730\u5740\u53ef\u4ee5\u66f4\u6362\u4e3a\u4f60\u6240\u5e0c\u671b\u7684\u914d\u7f6e\uff0c\u4f46\u662f\u4f5c\u4e3a\u8def\u7531\u548c\u7f51\u5173\u7684\u4e2d\u5fc3\u670d\u52a1\u5668\uff0c\u66f4\u7b80\u6613\u4f7f\u7528<code>\/24<\/code>\u5730\u5740\uff0c\u8ba9\u4e2d\u5fc3\u670d\u52a1\u5668\u53ef\u4ee5\u7ba1\u7406\u6574\u4e2a\u5b50\u7f51\u7684\u6d41\u91cf\u548c\u8def\u7531\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u914d\u7f6e\u6587\u4ef6Peer\u90e8\u5206\u914d\u7f6e<\/h3>\n\n\n\n<p>\u7eb5\u7136\u5728\u7406\u8bba\u4e0a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u516c\u94a5\u6587\u4ef6\u548c\u79c1\u94a5\u6587\u4ef6\u6dfb\u52a0\u591a\u4e2a\u5bf9\u7aef\uff0c\u4f46\u662f<strong>\u4e0d\u63a8\u8350<\/strong>\u3002\u56e0\u4e3a WireGuard \u7684\u8bbe\u8ba1\u8981\u6c42\u6bcf\u4e2apeer\u90fd\u6709\u5176\u72ec\u7acb\u7684\u516c\u94a5-\u79c1\u94a5\u5bf9\uff0c\u4fdd\u6301\u5b89\u5168\u6027\u548c\u4fdd\u8bc1\u53ef\u7528\uff0c\u4e2d\u5fc3\u670d\u52a1\u5668\u7684\u914d\u7f6e\u6587\u4ef6\u9700\u8981\u6839\u636e\u6bcf\u4e2aPeer\u7aef\u6765\u5355\u72ec\u8bbe\u7f6e\u3002<\/p>\n\n\n\n<p>\u56e0\u6b64\u5728\u6dfb\u52a0\u4efb\u4f55\u4e00\u4e2a\u65b0\u8bbe\u5907\u7684\u65f6\u5019\uff0c\u90fd\u5e94\u8be5\u5728\u4e2d\u5fc3\u670d\u52a1\u5668\u5bf9\u5e94\u7ec4\u7f51\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u4e2aPeer\u90e8\u5206\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2aPeer\u90e8\u5206\u7684\u914d\u7f6e\u6587\u4ef6\u793a\u4f8b\uff1a<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&#91;Peer&#93;\nPublicKey = Peer\u7aef\u7684\u516c\u94a5\u5185\u5bb9\nAllowedIPs = 10.0.8.11\/32<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">&#91;Peer&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">PublicKey<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> Peer\u7aef\u7684\u516c\u94a5\u5185\u5bb9<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">AllowedIPs<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> 10.0.8.11\/32<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u8bf7\u4fee\u6539\u5bf9\u5e94\u516c\u94a5\u548c\u5141\u8bb8\u7684IP\u7aef\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7ec4\u7f51\u5404\u8bbe\u5907\u7684\u914d\u7f6e<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u751f\u6210\u5404\u8bbe\u5907\u7684\u516c\u79c1\u94a5\u5bf9<\/h3>\n\n\n\n<p>\u901a\u8fc7\u5404\u8bbe\u5907\u81ea\u5df1\u7684\u65b9\u5f0f\u751f\u6210\u516c\u79c1\u94a5\u5bf9\uff0c\u6b64\u5904\u4e0d\u518d\u8be6\u7ec6\u8bb2\u89e3\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5404\u8bbe\u5907Interface\u914d\u7f6e<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&#91;Interface&#93;\nPrivateKey = \u5404\u8bbe\u5907\u751f\u6210\u7684\u79c1\u94a5\u5185\u5bb9\nAddress = 10.0.8.11\/32\nMTU = 1420<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">&#91;Interface&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">PrivateKey<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> \u5404\u8bbe\u5907\u751f\u6210\u7684\u79c1\u94a5\u5185\u5bb9<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">Address<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> 10.0.8.11\/32<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">MTU<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> 1420<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u5176\u4e2d\u4fee\u6539\u4f60\u5e0c\u671b\u8be5\u8bbe\u5907\u7684\u5185\u7f51\u5730\u5740<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5404\u8bbe\u5907Peer\u90e8\u5206\u914d\u7f6e<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&#91;Peer&#93;\nPublicKey = \u4e2d\u5fc3\u670d\u52a1\u5668\u516c\u94a5\u5185\u5bb9\nAllowedIPs = 10.0.8.0\/24\nEndpoint = \u4e2d\u5fc3\u670d\u52a1\u5668ip:\u7aef\u53e3\nPersistentKeepalive = 30<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #F6F6F4\">&#91;Peer&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">PublicKey<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> \u4e2d\u5fc3\u670d\u52a1\u5668\u516c\u94a5\u5185\u5bb9<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">AllowedIPs<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> 10.0.8.0\/24<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">Endpoint<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> \u4e2d\u5fc3\u670d\u52a1\u5668ip:\u7aef\u53e3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #F286C4\">PersistentKeepalive<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #F286C4\">=<\/span><span style=\"color: #F6F6F4\"> 30<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u6ce8\u610f\u6b64\u5904AllowedIP\u7aef\u4fee\u6539\u4e3a\u4e86\/24\u7aef\uff0c\u8fd9\u6837\u505a\u53ef\u4ee5\u5f62\u6210\u4e00\u4e2a<code>10.0.8.0-10.0.8.255<\/code>\u4e4b\u95f4\u7ec4\u7f51\u7684\u8bbe\u5907\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u8981\u4fee\u6539\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6d4b\u8bd5<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u5404\u8bbe\u5907\u4e0e\u4e2d\u5fc3\u670d\u52a1\u5668\u7684\u8fde\u63a5\u6d4b\u8bd5<\/h3>\n\n\n\n<p>\u5728\u9996\u6b21\u642d\u5efa\u597d\u4e2d\u5fc3\u670d\u52a1\u5668\u548c\u7ec4\u7f51\u4e2d\u5176\u4ed6\u8bbe\u5907\u7684wireguard\u540e\uff0c\u5e94\u5f53\u5148\u8fde\u63a5wireguard\u5e76\u8fdb\u884c\u6d4b\u8bd5<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#282A36\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#f6f6f4;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>ping 10.0.8.1<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki dracula-soft\" style=\"background-color: #282A36\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #62E884\">ping<\/span><span style=\"color: #F6F6F4\"> <\/span><span style=\"color: #BF9EEE\">10.0<\/span><span style=\"color: #E7EE98\">.8.1<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u66ff\u6362\u4e3a\u4f60\u7684\u4e2d\u5fc3\u670d\u52a1\u5668\u5730\u5740\uff0c\u5982\u679cping\u901a\uff0c\u8bf4\u660e\u7ec4\u7f51\u6210\u529f\u3002<\/p>\n\n\n\n<p>\u5982\u679cping\u4e0d\u901a\uff0c\u8bf7\u4f7f\u7528\u7aef\u53e3\u626b\u63cf\u5de5\u5177\u68c0\u67e5\u4e2d\u5fc3\u670d\u52a1\u5668\u7aef\u53e3\u662f\u5426\u5f00\u653e\uff0c\u5982\u679c\u5f00\u653e\u8bf7\u68c0\u67e5\u5bf9\u5e94\u914d\u7f6e\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec4\u7f51\u4e2d\u5404\u8bbe\u5907\u7684\u8fde\u63a5\u6d4b\u8bd5<\/h3>\n\n\n\n<p>\u5982\u679c\u6709\u6b64\u9700\u6c42\uff0c\u642d\u5efa\u597d\u7ec4\u7f51\u4e2d\u4e24\u4e2a\u8bbe\u5907\u540e\u5e94\u5f53\u8fdb\u884cPing\u6d4b\u8bd5\uff0c\u5982\u679c\u53d1\u73b0\u4e0d\u901a\uff0c\u4f46\u662f\u5404\u8bbe\u5907\u548c\u4e2d\u5fc3\u670d\u52a1\u5668\u76f8\u901a\uff0c\u8bf7\u68c0\u67e5\u4e2d\u5fc3\u670d\u52a1\u5668\u8f6c\u53d1\u670d\u52a1\u662f\u5426\u6b63\u5e38\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u901a\u8fc7 WireGuard \u5efa\u7acb\u5185\u7f51\u7ec4\u7f51\uff0c\u4ee5\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5185\u7f51\u4e92\u901a\u3002\u76f8\u8f83\u4e8e\u4e4b\u524d\u7684\u5c06\u5185\u7f51\u670d\u52a1\u6620\u5c04\u81f3\u516c\u7f51\u7684\u6559\u7a0b\uff0c\u672c\u6b21\u4e3b\u8981\u8ba8\u8bba\u5982\u4f55\u5229\u7528 WireGuard \u5c06\u8bbe\u5907\u5168\u90e8\u7f6e\u4e8e\u5185\u7f51\u73af\u5883\u4e0b\uff0c\u65b9\u4fbf\u8fdc\u7a0b\u8bbf\u95ee\u548c\u4e2a\u4eba\u6570\u636e\u5171\u4eab\u3002\u672c\u6587\u5305\u62ec WireGuard \u7684\u5b89\u88c5\u3001\u670d\u52a1\u5668\u548c\u8bbe\u5907\u7aef\u7684\u914d\u7f6e\u7ec6\u8282\uff0c\u53ca\u5404\u8bbe\u5907\u4e92\u8054\u4e92\u901a\u7684\u6d4b\u8bd5\u6b65\u9aa4\uff0c\u65e8\u5728\u4e3a\u4e2a\u4eba\u7528\u6237\u63d0\u4f9b\u5b89\u5168\u3001\u4fbf\u6377\u7684\u5185\u7f51\u8bbf\u95ee\u65b9\u6848\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,3],"tags":[5],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-10","category-3","tag-5"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054 - Zero To You<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zty.ink\/?p=24\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054 - Zero To You\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u901a\u8fc7 WireGuard \u5efa\u7acb\u5185\u7f51\u7ec4\u7f51\uff0c\u4ee5\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5185\u7f51\u4e92\u901a\u3002\u76f8\u8f83\u4e8e\u4e4b\u524d\u7684\u5c06\u5185\u7f51\u670d\u52a1\u6620\u5c04\u81f3\u516c\u7f51\u7684\u6559\u7a0b\uff0c\u672c\u6b21\u4e3b\u8981\u8ba8\u8bba\u5982\u4f55\u5229\u7528 WireGuard \u5c06\u8bbe\u5907\u5168\u90e8\u7f6e\u4e8e\u5185\u7f51\u73af\u5883\u4e0b\uff0c\u65b9\u4fbf\u8fdc\u7a0b\u8bbf\u95ee\u548c\u4e2a\u4eba\u6570\u636e\u5171\u4eab\u3002\u672c\u6587\u5305\u62ec WireGuard \u7684\u5b89\u88c5\u3001\u670d\u52a1\u5668\u548c\u8bbe\u5907\u7aef\u7684\u914d\u7f6e\u7ec6\u8282\uff0c\u53ca\u5404\u8bbe\u5907\u4e92\u8054\u4e92\u901a\u7684\u6d4b\u8bd5\u6b65\u9aa4\uff0c\u65e8\u5728\u4e3a\u4e2a\u4eba\u7528\u6237\u63d0\u4f9b\u5b89\u5168\u3001\u4fbf\u6377\u7684\u5185\u7f51\u8bbf\u95ee\u65b9\u6848\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zty.ink\/?p=24\" \/>\n<meta property=\"og:site_name\" content=\"Zero To You\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-29T14:37:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-31T16:41:15+00:00\" \/>\n<meta name=\"author\" content=\"zhangtianyi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zhangtianyi\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zty.ink\/?p=24\",\"url\":\"https:\/\/zty.ink\/?p=24\",\"name\":\"\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054 - Zero To You\",\"isPartOf\":{\"@id\":\"https:\/\/zty.ink\/#website\"},\"datePublished\":\"2024-10-29T14:37:00+00:00\",\"dateModified\":\"2025-08-31T16:41:15+00:00\",\"author\":{\"@id\":\"https:\/\/zty.ink\/#\/schema\/person\/c80c32751937fc5a8b1a4da22b441f60\"},\"breadcrumb\":{\"@id\":\"https:\/\/zty.ink\/?p=24#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zty.ink\/?p=24\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zty.ink\/?p=24#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/zty.ink\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zty.ink\/#website\",\"url\":\"https:\/\/zty.ink\/\",\"name\":\"Zero To You\",\"description\":\"\u6765\u81eazty\u7684\u7b14\u8bb0\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zty.ink\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zty.ink\/#\/schema\/person\/c80c32751937fc5a8b1a4da22b441f60\",\"name\":\"zhangtianyi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/zty.ink\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e60fc42ece674655853a6f943c65768079d157b86e45ccdd2ed928e1d62bc47e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e60fc42ece674655853a6f943c65768079d157b86e45ccdd2ed928e1d62bc47e?s=96&d=mm&r=g\",\"caption\":\"zhangtianyi\"},\"sameAs\":[\"http:\/\/172.22.0.14:8080\"],\"url\":\"https:\/\/zty.ink\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054 - Zero To You","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zty.ink\/?p=24","og_locale":"zh_CN","og_type":"article","og_title":"\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054 - Zero To You","og_description":"\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u901a\u8fc7 WireGuard \u5efa\u7acb\u5185\u7f51\u7ec4\u7f51\uff0c\u4ee5\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5185\u7f51\u4e92\u901a\u3002\u76f8\u8f83\u4e8e\u4e4b\u524d\u7684\u5c06\u5185\u7f51\u670d\u52a1\u6620\u5c04\u81f3\u516c\u7f51\u7684\u6559\u7a0b\uff0c\u672c\u6b21\u4e3b\u8981\u8ba8\u8bba\u5982\u4f55\u5229\u7528 WireGuard \u5c06\u8bbe\u5907\u5168\u90e8\u7f6e\u4e8e\u5185\u7f51\u73af\u5883\u4e0b\uff0c\u65b9\u4fbf\u8fdc\u7a0b\u8bbf\u95ee\u548c\u4e2a\u4eba\u6570\u636e\u5171\u4eab\u3002\u672c\u6587\u5305\u62ec WireGuard \u7684\u5b89\u88c5\u3001\u670d\u52a1\u5668\u548c\u8bbe\u5907\u7aef\u7684\u914d\u7f6e\u7ec6\u8282\uff0c\u53ca\u5404\u8bbe\u5907\u4e92\u8054\u4e92\u901a\u7684\u6d4b\u8bd5\u6b65\u9aa4\uff0c\u65e8\u5728\u4e3a\u4e2a\u4eba\u7528\u6237\u63d0\u4f9b\u5b89\u5168\u3001\u4fbf\u6377\u7684\u5185\u7f51\u8bbf\u95ee\u65b9\u6848\u3002","og_url":"https:\/\/zty.ink\/?p=24","og_site_name":"Zero To You","article_published_time":"2024-10-29T14:37:00+00:00","article_modified_time":"2025-08-31T16:41:15+00:00","author":"zhangtianyi","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zhangtianyi","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zty.ink\/?p=24","url":"https:\/\/zty.ink\/?p=24","name":"\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054 - Zero To You","isPartOf":{"@id":"https:\/\/zty.ink\/#website"},"datePublished":"2024-10-29T14:37:00+00:00","dateModified":"2025-08-31T16:41:15+00:00","author":{"@id":"https:\/\/zty.ink\/#\/schema\/person\/c80c32751937fc5a8b1a4da22b441f60"},"breadcrumb":{"@id":"https:\/\/zty.ink\/?p=24#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zty.ink\/?p=24"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zty.ink\/?p=24#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/zty.ink\/"},{"@type":"ListItem","position":2,"name":"\u57fa\u4e8e WireGuard \u7684\u5185\u7f51\u7ec4\u7f51\u6559\u7a0b\uff1a\u5b9e\u73b0\u591a\u8bbe\u5907\u95f4\u7684\u5b89\u5168\u4e92\u8054"}]},{"@type":"WebSite","@id":"https:\/\/zty.ink\/#website","url":"https:\/\/zty.ink\/","name":"Zero To You","description":"\u6765\u81eazty\u7684\u7b14\u8bb0","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zty.ink\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/zty.ink\/#\/schema\/person\/c80c32751937fc5a8b1a4da22b441f60","name":"zhangtianyi","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/zty.ink\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e60fc42ece674655853a6f943c65768079d157b86e45ccdd2ed928e1d62bc47e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e60fc42ece674655853a6f943c65768079d157b86e45ccdd2ed928e1d62bc47e?s=96&d=mm&r=g","caption":"zhangtianyi"},"sameAs":["http:\/\/172.22.0.14:8080"],"url":"https:\/\/zty.ink\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/zty.ink\/index.php?rest_route=\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zty.ink\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zty.ink\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zty.ink\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zty.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24"}],"version-history":[{"count":1,"href":"https:\/\/zty.ink\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":25,"href":"https:\/\/zty.ink\/index.php?rest_route=\/wp\/v2\/posts\/24\/revisions\/25"}],"wp:attachment":[{"href":"https:\/\/zty.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zty.ink\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zty.ink\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}