{"id":208,"date":"2026-04-27T10:30:30","date_gmt":"2026-04-27T02:30:30","guid":{"rendered":"https:\/\/jsbmw.cn\/?p=208"},"modified":"2026-04-27T10:30:30","modified_gmt":"2026-04-27T02:30:30","slug":"2026%e6%9c%80%e6%96%b0%e9%9b%b6%e5%9f%ba%e7%a1%80%ef%bc%9awireguard-vpn%e6%97%81%e8%b7%af%e7%94%b1%e5%bc%82%e5%9c%b0%e7%bb%84%e7%bd%91%e8%b6%85%e8%af%a6%e7%bb%86%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/jsbmw.cn\/index.php\/2026\/04\/27\/2026%e6%9c%80%e6%96%b0%e9%9b%b6%e5%9f%ba%e7%a1%80%ef%bc%9awireguard-vpn%e6%97%81%e8%b7%af%e7%94%b1%e5%bc%82%e5%9c%b0%e7%bb%84%e7%bd%91%e8%b6%85%e8%af%a6%e7%bb%86%e6%95%99%e7%a8%8b\/","title":{"rendered":"2026\u6700\u65b0\u96f6\u57fa\u7840\uff1aWireGuard VPN\u65c1\u8def\u7531\u5f02\u5730\u7ec4\u7f51\u8d85\u8be6\u7ec6\u6559\u7a0b"},"content":{"rendered":"<p>## \u524d\u8a00<\/p>\n<p>WireGuard \u662f\u76ee\u524d\u6700\u5feb\u7684 VPN \u534f\u8bae\uff0c\u4ee3\u7801\u91cf\u53ea\u6709 OpenVPN \u7684 1%\uff0c\u6027\u80fd\u5374\u66f4\u5f3a\u3002\u672c\u6559\u7a0b\u6559\u4f60\u7528 WireGuard \u5728 OpenWrt \u65c1\u8def\u7531\u4e0a\u642d\u5efa VPN\uff0c\u5b9e\u73b0\u5f02\u5730\u7ec4\u7f51\u2014\u2014\u8ba9\u4f60\u5728\u5916\u5730\u4e5f\u80fd\u8bbf\u95ee\u5bb6\u91cc\u7684 NAS\u3001\u6444\u50cf\u5934\u3001\u667a\u80fd\u5bb6\u5c45\u7b49\u8bbe\u5907\uff0c\u901f\u5ea6\u5feb\u5230\u50cf\u5728\u5c40\u57df\u7f51\u4e00\u6837\u3002<\/p>\n<p>\u672c\u6559\u7a0b\u5305\u542b\u4e24\u4e2a\u573a\u666f\uff1a\u2460 \u5bb6\u91cc\u8f6f\u8def\u7531\u505a VPN \u670d\u52a1\u7aef + \u624b\u673a\/\u7535\u8111\u505a\u5ba2\u6237\u7aef\uff1b\u2461 \u4e24\u53f0\u8f6f\u8def\u7531\u5f02\u5730\u4e92\u8054\u3002<\/p>\n<p>## \u4e00\u3001\u524d\u671f\u51c6\u5907<\/p>\n<p>### \u4f60\u9700\u8981\u4ec0\u4e48<\/p>\n<p>| \u9879\u76ee | \u8981\u6c42 | \u8bf4\u660e |<br \/>\n|&#8212;&#8212;|&#8212;&#8212;|&#8212;&#8212;|<br \/>\n| \u8f6f\u8def\u7531 | OpenWrt 21.02+ | \u9700\u652f\u6301 WireGuard \u5185\u6838\u6a21\u5757 |<br \/>\n| \u516c\u7f51 IP \u6216 DDNS | \u6709\u516c\u7f51 IP \u6700\u4f73 | \u6ca1\u6709\u516c\u7f51 IP \u53ef\u7528 frp \u5185\u7f51\u7a7f\u900f |<br \/>\n| \u5ba2\u6237\u7aef\u8bbe\u5907 | \u624b\u673a\/\u7535\u8111\/NAS | \u5b89\u88c5 WireGuard \u5ba2\u6237\u7aef |<br \/>\n| SSH \u5de5\u5177 | PuTTY \/ Xshell | \u547d\u4ee4\u884c\u64cd\u4f5c |<\/p>\n<p>### \u8f6f\u4ef6\u4e0b\u8f7d<\/p>\n<p>| \u8f6f\u4ef6 | \u4e0b\u8f7d\u5730\u5740 | \u5e73\u53f0 |<br \/>\n|&#8212;&#8212;|&#8212;&#8212;&#8212;|&#8212;&#8212;|<br \/>\n| WireGuard Windows \u5ba2\u6237\u7aef | https:\/\/download.wireguard.com\/windows-client\/wireguard-installer.exe | Windows |<br \/>\n| WireGuard Mac \u5ba2\u6237\u7aef | App Store \u641c\u7d22 &#8220;WireGuard&#8221; | macOS |<br \/>\n| WireGuard iOS \u5ba2\u6237\u7aef | App Store \u641c\u7d22 &#8220;WireGuard&#8221; | iPhone\/iPad |<br \/>\n| WireGuard Android \u5ba2\u6237\u7aef | Google Play \/ F-Droid \u641c\u7d22 &#8220;WireGuard&#8221; | Android |<br \/>\n| WinSCP | https:\/\/winscp.net\/eng\/download.php | \u6587\u4ef6\u4f20\u8f93 |<\/p>\n<p>### \u68c0\u67e5\u662f\u5426\u6709\u516c\u7f51 IP<\/p>\n<p>&#8220;`bash<br \/>\n# \u5728\u8f6f\u8def\u7531\u4e0a\u6267\u884c<br \/>\ncurl -s https:\/\/ipinfo.io\/ip<br \/>\n&#8220;`<\/p>\n<p>\u7136\u540e\u767b\u5f55\u4f60\u7684\u8def\u7531\u5668\uff0c\u67e5\u770b WAN \u53e3 IP \u662f\u5426\u548c\u4e0a\u9762\u8fd4\u56de\u7684\u4e00\u81f4\u3002\u4e00\u81f4\u5219\u6709\u516c\u7f51 IP\uff0c\u4e0d\u4e00\u81f4\u5219\u6ca1\u6709\uff08\u8fd0\u8425\u5546\u673a\u9876\u76d2 NAT \u4e86\uff09\u3002<\/p>\n<p>## \u4e8c\u3001\u5b89\u88c5 WireGuard<\/p>\n<p>### \u5728 OpenWrt \u4e0a\u5b89\u88c5<\/p>\n<p>&#8220;`bash<br \/>\n# \u66f4\u65b0\u8f6f\u4ef6\u6e90<br \/>\nopkg update<\/p>\n<p># \u5b89\u88c5 WireGuard \u5185\u6838\u6a21\u5757\u548c\u5de5\u5177<br \/>\nopkg install wireguard-tools<br \/>\nopkg install kmod-wireguard<br \/>\nopkg install luci-proto-wireguard<\/p>\n<p># \u5982\u679c\u4e0a\u9762\u7684\u5185\u6838\u6a21\u5757\u5b89\u88c5\u5931\u8d25\uff0c\u5c1d\u8bd5<br \/>\nopkg install kmod-wireguard-core<\/p>\n<p># \u91cd\u542f\u4f7f\u6a21\u5757\u751f\u6548<br \/>\nreboot<br \/>\n&#8220;`<\/p>\n<p>### \u9a8c\u8bc1\u5b89\u88c5<\/p>\n<p>&#8220;`bash<br \/>\n# \u68c0\u67e5\u5185\u6838\u6a21\u5757\u662f\u5426\u52a0\u8f7d<br \/>\nlsmod | grep wireguard<\/p>\n<p># \u5e94\u8be5\u8f93\u51fa\u7c7b\u4f3c\uff1a<br \/>\n# wireguard             110592  0<br \/>\n# ip6_udp_tunnel         16384  1 wireguard<br \/>\n# udp_tunnel              20480  1 wireguard<br \/>\n&#8220;`<\/p>\n<p>## \u4e09\u3001\u751f\u6210\u5bc6\u94a5\u5bf9<\/p>\n<p>WireGuard \u4f7f\u7528\u975e\u5bf9\u79f0\u52a0\u5bc6\uff0c\u6bcf\u4e2a\u8282\u70b9\u90fd\u9700\u8981\u4e00\u5bf9\u5bc6\u94a5\u3002<\/p>\n<p>### \u670d\u52a1\u7aef\u5bc6\u94a5<\/p>\n<p>&#8220;`bash<br \/>\n# \u521b\u5efa\u914d\u7f6e\u76ee\u5f55<br \/>\nmkdir -p \/etc\/wireguard<\/p>\n<p># \u751f\u6210\u670d\u52a1\u7aef\u79c1\u94a5\u548c\u516c\u94a5<br \/>\ncd \/etc\/wireguard<br \/>\nwg genkey | tee server_private.key | wg pubkey > server_public.key<\/p>\n<p># \u67e5\u770b\u5bc6\u94a5\uff08\u540e\u9762\u8981\u7528\uff09<br \/>\necho &#8220;\u670d\u52a1\u7aef\u79c1\u94a5\uff1a&#8221;<br \/>\ncat server_private.key<br \/>\necho &#8220;\u670d\u52a1\u7aef\u516c\u94a5\uff1a&#8221;<br \/>\ncat server_public.key<br \/>\n&#8220;`<\/p>\n<p>> **\u91cd\u8981**\uff1a\u79c1\u94a5\u7edd\u5bf9\u4e0d\u8981\u6cc4\u9732\uff01\u516c\u94a5\u53ef\u4ee5\u968f\u4fbf\u5206\u4eab\u3002<\/p>\n<p>### \u5ba2\u6237\u7aef\u5bc6\u94a5\uff08\u6bcf\u4e2a\u5ba2\u6237\u7aef\u90fd\u9700\u8981\u4e00\u5bf9\uff09<\/p>\n<p>&#8220;`bash<br \/>\n# \u751f\u6210\u5ba2\u6237\u7aef1\u7684\u5bc6\u94a5<br \/>\nwg genkey | tee client1_private.key | wg pubkey > client1_public.key<\/p>\n<p># \u751f\u6210\u5ba2\u6237\u7aef2\u7684\u5bc6\u94a5\uff08\u624b\u673a\u7528\uff09<br \/>\nwg genkey | tee client2_private.key | wg pubkey > client2_public.key<\/p>\n<p># \u67e5\u770b\u5ba2\u6237\u7aef\u5bc6\u94a5<br \/>\necho &#8220;\u5ba2\u6237\u7aef1 \u516c\u94a5\uff1a&#8221;<br \/>\ncat client1_public.key<br \/>\necho &#8220;\u5ba2\u6237\u7aef2 \u516c\u94a5\uff1a&#8221;<br \/>\ncat client2_public.key<br \/>\n&#8220;`<\/p>\n<p>## \u56db\u3001\u914d\u7f6e OpenWrt \u670d\u52a1\u7aef<\/p>\n<p>### \u7b2c1\u6b65\uff1a\u521b\u5efa WireGuard \u63a5\u53e3<\/p>\n<p>1. \u8fdb\u5165 OpenWrt \u7ba1\u7406\u9875\u9762<br \/>\n2. **\u7f51\u7edc \u2192 \u63a5\u53e3 \u2192 \u6dfb\u52a0\u65b0\u63a5\u53e3**<br \/>\n3. \u586b\u5199\uff1a<\/p>\n<p>&#8220;`<br \/>\n\u540d\u79f0\uff1awg0<br \/>\n\u534f\u8bae\uff1aWireGuard VPN<br \/>\n&#8220;`<\/p>\n<p>4. \u70b9\u51fb **\u521b\u5efa\u63a5\u53e3**<\/p>\n<p>### \u7b2c2\u6b65\uff1a\u914d\u7f6e\u63a5\u53e3\u53c2\u6570<\/p>\n<p>\u5728\u521a\u521b\u5efa\u7684 wg0 \u63a5\u53e3\u4e2d\u8bbe\u7f6e\uff1a<\/p>\n<p>&#8220;`<br \/>\n\u79c1\u94a5\uff1a[\u7c98\u8d34\u670d\u52a1\u7aef\u79c1\u94a5]<br \/>\n\u76d1\u542c\u7aef\u53e3\uff1a51820<br \/>\nIP \u5730\u5740\uff1a10.0.0.1\/24        # VPN \u5185\u7f51\u5730\u5740\u6bb5\uff0c\u53ef\u81ea\u5b9a\u4e49<br \/>\n&#8220;`<\/p>\n<p>### \u7b2c3\u6b65\uff1a\u6dfb\u52a0 Peer\uff08\u5ba2\u6237\u7aef\uff09<\/p>\n<p>\u5728 wg0 \u63a5\u53e3\u8bbe\u7f6e\u9875\u9762\u7684 **Peers** \u90e8\u5206\uff0c\u9010\u4e2a\u6dfb\u52a0\u5ba2\u6237\u7aef\uff1a<\/p>\n<p>**Peer 1\uff08\u7535\u8111\uff09\uff1a**<\/p>\n<p>&#8220;`<br \/>\n\u516c\u94a5\uff1a[\u7c98\u8d34\u5ba2\u6237\u7aef1\u7684\u516c\u94a5]<br \/>\n\u5141\u8bb8\u7684 IP\uff1a10.0.0.2\/32      # \u5206\u914d\u7ed9\u6b64\u5ba2\u6237\u7aef\u7684 VPN IP<br \/>\n&#8220;`<\/p>\n<p>**Peer 2\uff08\u624b\u673a\uff09\uff1a**<\/p>\n<p>&#8220;`<br \/>\n\u516c\u94a5\uff1a[\u7c98\u8d34\u5ba2\u6237\u7aef2\u7684\u516c\u94a5]<br \/>\n\u5141\u8bb8\u7684 IP\uff1a10.0.0.3\/32      # \u5206\u914d\u7ed9\u6b64\u5ba2\u6237\u7aef\u7684 VPN IP<br \/>\n&#8220;`<\/p>\n<p>### \u7b2c4\u6b65\uff1a\u914d\u7f6e\u9632\u706b\u5899<\/p>\n<p>1. \u8fdb\u5165 **\u7f51\u7edc \u2192 \u9632\u706b\u5899**<br \/>\n2. \u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u533a\u57df\uff1a<\/p>\n<p>&#8220;`<br \/>\n\u540d\u79f0\uff1awg<br \/>\n\u5165\u7ad9\uff1a\u63a5\u53d7<br \/>\n\u51fa\u7ad9\uff1a\u63a5\u53d7<br \/>\n\u8f6c\u53d1\uff1a\u63a5\u53d7<br \/>\nIP \u52a8\u6001\u4f2a\u88c5\uff1a\u52fe\u9009<br \/>\n\u6db5\u76d6\u7684\u7f51\u7edc\uff1a\u9009\u62e9 wg0<br \/>\n\u5141\u8bb8\u8f6c\u53d1\u5230\u76ee\u6807\uff1a\u9009\u62e9 lan<br \/>\n&#8220;`<\/p>\n<p>3. \u4fdd\u5b58\u5e76\u5e94\u7528<\/p>\n<p>### \u7b2c5\u6b65\uff1a\u5f00\u653e\u9632\u706b\u5899\u7aef\u53e3<\/p>\n<p>&#8220;`bash<br \/>\n# \u5141\u8bb8 UDP 51820 \u7aef\u53e3\u5165\u7ad9<br \/>\nuci add firewall rule<br \/>\nuci set firewall.@rule[-1].name=&#8217;Allow-WireGuard&#8217;<br \/>\nuci set firewall.@rule[-1].src=&#8217;wan&#8217;<br \/>\nuci set firewall.@rule[-1].dest_port=&#8217;51820&#8242;<br \/>\nuci set firewall.@rule[-1].proto=&#8217;udp&#8217;<br \/>\nuci set firewall.@rule[-1].target=&#8217;ACCEPT&#8217;<br \/>\nuci commit firewall<br \/>\n&#8220;`<\/p>\n<p>### \u7b2c6\u6b65\uff1a\u542f\u52a8 WireGuard<\/p>\n<p>&#8220;`bash<br \/>\n# \u91cd\u542f\u7f51\u7edc\u4f7f\u63a5\u53e3\u751f\u6548<br \/>\n\/etc\/init.d\/network restart<\/p>\n<p># \u68c0\u67e5 WireGuard \u72b6\u6001<br \/>\nwg show<br \/>\n&#8220;`<\/p>\n<p>\u5e94\u8be5\u770b\u5230 wg0 \u63a5\u53e3\u4fe1\u606f\uff0c\u5305\u62ec listening port \u548c peer \u5217\u8868\u3002<\/p>\n<p>## \u4e94\u3001\u914d\u7f6e\u5ba2\u6237\u7aef<\/p>\n<p>### Windows \u5ba2\u6237\u7aef\u914d\u7f6e<\/p>\n<p>1. \u5b89\u88c5 WireGuard Windows \u5ba2\u6237\u7aef<br \/>\n2. \u70b9\u51fb **\u6dfb\u52a0\u96a7\u9053 \u2192 \u6dfb\u52a0\u7a7a\u96a7\u9053**<br \/>\n3. \u586b\u5199\u914d\u7f6e\uff1a<\/p>\n<p>&#8220;`ini<br \/>\n[Interface]<br \/>\nPrivateKey = [\u5ba2\u6237\u7aef1\u7684\u79c1\u94a5]<br \/>\nAddress = 10.0.0.2\/24<br \/>\nDNS = 223.5.5.5<\/p>\n<p>[Peer]<br \/>\nPublicKey = [\u670d\u52a1\u7aef\u7684\u516c\u94a5]<br \/>\nEndpoint = \u4f60\u7684\u516c\u7f51IP\u6216\u57df\u540d:51820<br \/>\nAllowedIPs = 0.0.0.0\/0    # \u6240\u6709\u6d41\u91cf\u8d70 VPN\uff08\u8fdc\u7a0b\u7f51\u5173\u6a21\u5f0f\uff09<br \/>\n# \u6216\u8005\u53ea\u8bbf\u95ee\u5bb6\u91cc\u8bbe\u5907\uff1a<br \/>\n# AllowedIPs = 10.0.0.0\/24, 192.168.1.0\/24<br \/>\nPersistentKeepalive = 25<br \/>\n&#8220;`<\/p>\n<p>4. \u70b9\u51fb **\u8fde\u63a5**<\/p>\n<p>### \u624b\u673a\u5ba2\u6237\u7aef\u914d\u7f6e<\/p>\n<p>1. \u5b89\u88c5 WireGuard App<br \/>\n2. \u70b9\u51fb **+ \u2192 \u4ece\u526a\u8d34\u677f\u7c98\u8d34** \u6216\u624b\u52a8\u6dfb\u52a0<br \/>\n3. \u914d\u7f6e\u5185\u5bb9\uff1a<\/p>\n<p>&#8220;`ini<br \/>\n[Interface]<br \/>\nPrivateKey = [\u5ba2\u6237\u7aef2\u7684\u79c1\u94a5]<br \/>\nAddress = 10.0.0.3\/24<br \/>\nDNS = 223.5.5.5<\/p>\n<p>[Peer]<br \/>\nPublicKey = [\u670d\u52a1\u7aef\u7684\u516c\u94a5]<br \/>\nEndpoint = \u4f60\u7684\u516c\u7f51IP:51820<br \/>\nAllowedIPs = 10.0.0.0\/24, 192.168.1.0\/24<br \/>\nPersistentKeepalive = 25<br \/>\n&#8220;`<\/p>\n<p>> **PersistentKeepalive = 25** \u975e\u5e38\u91cd\u8981\uff01\u5b83\u4fdd\u8bc1 NAT \u6620\u5c04\u4e0d\u4f1a\u8fc7\u671f\uff0c\u624b\u673a\u4ece\u4f11\u7720\u6062\u590d\u540e\u80fd\u7acb\u5373\u91cd\u8fde\u3002<\/p>\n<p>## \u516d\u3001\u9a8c\u8bc1\u8fde\u63a5<\/p>\n<p>### \u68c0\u67e5\u63e1\u624b\u72b6\u6001<\/p>\n<p>&#8220;`bash<br \/>\n# \u5728\u8f6f\u8def\u7531\u4e0a\u6267\u884c<br \/>\nwg show<br \/>\n# \u67e5\u770b latest handshake \u65f6\u95f4\uff0c\u5e94\u8be5\u5728\u8fc7\u53bb\u51e0\u5341\u79d2\u5185<br \/>\n&#8220;`<\/p>\n<p>### Ping \u6d4b\u8bd5<\/p>\n<p>&#8220;`bash<br \/>\n# \u4ece\u5ba2\u6237\u7aef ping \u8f6f\u8def\u7531 VPN IP<br \/>\nping 10.0.0.1<\/p>\n<p># \u4ece\u5ba2\u6237\u7aef ping \u8f6f\u8def\u7531\u5c40\u57df\u7f51 IP<br \/>\nping 192.168.1.2<\/p>\n<p># \u4ece\u5ba2\u6237\u7aef ping \u5c40\u57df\u7f51\u5176\u4ed6\u8bbe\u5907\uff08\u5982 NAS\uff09<br \/>\nping 192.168.1.100<br \/>\n&#8220;`<\/p>\n<p>### \u8bbf\u95ee NAS \u6d4b\u8bd5<\/p>\n<p>\u6d4f\u89c8\u5668\u8f93\u5165 `http:\/\/192.168.1.100:5000`\uff08\u4f60\u7684 NAS \u5730\u5740\uff09\uff0c\u80fd\u6253\u5f00\u5373\u7ec4\u7f51\u6210\u529f\u3002<\/p>\n<p>## \u4e03\u3001\u6ca1\u6709\u516c\u7f51 IP \u7684\u89e3\u51b3\u65b9\u6848<\/p>\n<p>### \u65b9\u6848\u4e00\uff1aDDNS + \u7aef\u53e3\u6620\u5c04<\/p>\n<p>1. \u767b\u5f55\u8def\u7531\u5668\uff0c\u8bbe\u7f6e\u7aef\u53e3\u6620\u5c04\uff1a\u5916\u7f51 51820 \u2192 \u8f6f\u8def\u7531 51820\/UDP<br \/>\n2. \u914d\u7f6e DDNS \u7ed1\u5b9a\u57df\u540d<br \/>\n3. \u5ba2\u6237\u7aef Endpoint \u586b DDNS \u57df\u540d<\/p>\n<p>### \u65b9\u6848\u4e8c\uff1afrp \u5185\u7f51\u7a7f\u900f<\/p>\n<p>&#8220;`bash<br \/>\n# \u5728\u6709\u516c\u7f51 IP \u7684 VPS \u4e0a\u90e8\u7f72 frps<br \/>\n# \u5728\u8f6f\u8def\u7531\u4e0a\u90e8\u7f72 frpc\uff0c\u8f6c\u53d1 UDP 51820<\/p>\n<p># frpc.ini \u914d\u7f6e<br \/>\n[wireguard]<br \/>\ntype = udp<br \/>\nlocal_ip = 127.0.0.1<br \/>\nlocal_port = 51820<br \/>\nremote_port = 51820<br \/>\n&#8220;`<\/p>\n<p>frp \u670d\u52a1\u7aef\u4e0b\u8f7d\uff1ahttps:\/\/github.com\/fatedier\/frp\/releases<\/p>\n<p>### \u65b9\u6848\u4e09\uff1aTailscale \u96f6\u914d\u7f6e\u7ec4\u7f51<\/p>\n<p>\u5982\u679c\u5acc WireGuard \u914d\u7f6e\u9ebb\u70e6\uff0c\u53ef\u4ee5\u7528 Tailscale\uff08\u57fa\u4e8e WireGuard\uff09\uff1a<\/p>\n<p>&#8220;`bash<br \/>\nopkg install tailscale<br \/>\ntailscale up<br \/>\n&#8220;`<\/p>\n<p>\u6ce8\u518c\u5730\u5740\uff1ahttps:\/\/login.tailscale.com\/start<\/p>\n<p>## \u516b\u3001\u6027\u80fd\u4f18\u5316<\/p>\n<p>### 1. \u8c03\u6574 MTU<\/p>\n<p>&#8220;`bash<br \/>\n# WireGuard \u9ed8\u8ba4 MTU 1420\uff0c\u7f51\u7edc\u4e0d\u4f73\u65f6\u53ef\u964d\u4f4e<br \/>\n# \u5728\u63a5\u53e3\u8bbe\u7f6e\u4e2d\u4fee\u6539\uff1a<br \/>\nMTU\uff1a1280<br \/>\n&#8220;`<\/p>\n<p>### 2. \u591a\u7ebf\u7a0b\u4f18\u5316<\/p>\n<p>&#8220;`bash<br \/>\n# \u589e\u52a0 WireGuard \u7684\u5e76\u53d1\u8fde\u63a5\u6570<br \/>\necho 32768 > \/proc\/sys\/net\/core\/somaxconn<br \/>\n&#8220;`<\/p>\n<p>### 3. \u5f00\u542f BBR \u62e5\u585e\u63a7\u5236<\/p>\n<p>&#8220;`bash<br \/>\necho &#8220;net.core.default_qdisc=fq&#8221; >> \/etc\/sysctl.conf<br \/>\necho &#8220;net.ipv4.tcp_congestion_control=bbr&#8221; >> \/etc\/sysctl.conf<br \/>\nsysctl -p<br \/>\n&#8220;`<\/p>\n<p>## \u4e5d\u3001\u5e38\u89c1\u62a5\u9519\u89e3\u51b3<\/p>\n<p>| \u62a5\u9519 | \u539f\u56e0 | \u89e3\u51b3\u65b9\u6848 |<br \/>\n|&#8212;&#8212;|&#8212;&#8212;|&#8212;&#8212;&#8212;|<br \/>\n| `Cannot find device &#8220;wg0&#8243;` | \u5185\u6838\u6a21\u5757\u672a\u52a0\u8f7d | \u6267\u884c `modprobe wireguard` \u6216\u91cd\u542f |<br \/>\n| `Handshake did not complete` | \u7aef\u53e3\u4e0d\u901a\u6216\u5bc6\u94a5\u9519\u8bef | \u68c0\u67e5\u9632\u706b\u5899\u7aef\u53e3\u3001\u91cd\u65b0\u6838\u5bf9\u5bc6\u94a5 |<br \/>\n| `\u80fd\u8fde\u4e0a\u4f46\u8bbf\u95ee\u4e0d\u4e86\u5c40\u57df\u7f51` | \u9632\u706b\u5899\u672a\u653e\u884c\u8f6c\u53d1 | wg \u533a\u57df\u5141\u8bb8\u8f6c\u53d1\u5230 lan |<br \/>\n| `\u624b\u673a\u9501\u5c4f\u540e\u65ad\u5f00` | \u7f3a\u5c11 Keepalive | \u6dfb\u52a0 `PersistentKeepalive = 25` |<br \/>\n| `\u8fde\u63a5\u540e\u65e0\u6cd5\u4e0a\u7f51` | AllowedIPs = 0.0.0.0\/0 \u4f46\u6ca1\u914d NAT | \u5f00\u542f IP \u52a8\u6001\u4f2a\u88c5 |<br \/>\n| `\u901f\u5ea6\u5f88\u6162` | MTU \u592a\u5927 | \u964d\u4f4e MTU \u5230 1280 |<br \/>\n| `\u7aef\u53e3\u6620\u5c04\u4e0d\u751f\u6548` | \u8fd0\u8425\u5546\u5c01\u9501 UDP | \u6362\u7aef\u53e3\u6216\u7528 frp \u7a7f\u900f |<br \/>\n| `wg genkey \u547d\u4ee4\u4e0d\u5b58\u5728` | wireguard-tools \u672a\u88c5 | `opkg install wireguard-tools` |<\/p>\n<p>## \u5341\u3001\u907f\u5751\u603b\u7ed3<\/p>\n<p>1. \u79c1\u94a5\u7edd\u5bf9\u4e0d\u8981\u53d1\u7ed9\u522b\u4eba\uff0c\u4e5f\u4e0d\u8981\u586b\u9519\u4f4d\u7f6e<br \/>\n2. \u670d\u52a1\u7aef\u914d\u5ba2\u6237\u7aef\u7684\u516c\u94a5\uff0c\u5ba2\u6237\u7aef\u914d\u670d\u52a1\u7aef\u7684\u516c\u94a5\u2014\u2014\u522b\u641e\u53cd\u4e86<br \/>\n3. PersistentKeepalive \u662f\u624b\u673a\u5ba2\u6237\u7aef\u7684\u5fc5\u586b\u9879<br \/>\n4. \u6ca1\u6709\u516c\u7f51 IP \u5fc5\u987b\u505a\u5185\u7f51\u7a7f\u900f\uff0c\u5426\u5219\u5916\u7f51\u8fde\u4e0d\u56de\u6765<br \/>\n5. \u9632\u706b\u5899\u533a\u57df\u5fc5\u987b\u5141\u8bb8 wg \u2192 lan \u8f6c\u53d1<br \/>\n6. MTU \u8bbe 1280 \u6700\u7a33\u59a5\uff0c\u907f\u514d\u5305\u5206\u7247<br \/>\n7. WireGuard \u662f UDP \u534f\u8bae\uff0c\u7aef\u53e3\u6620\u5c04\u8981\u9009 UDP \u4e0d\u662f TCP<\/p>\n<p>\u672c\u6587\u7531\u6280\u672f\u4fdd\u59c6\u7f51 JSBMW.CN \u539f\u521b\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>## \u524d\u8a00 WireGuard \u662f\u76ee\u524d\u6700\u5feb\u7684 VPN \u534f\u8bae\uff0c\u4ee3\u7801\u91cf\u53ea\u6709 OpenVPN \u7684 1%\uff0c\u6027\u80fd\u5374\u66f4\u5f3a\u3002 &hellip; <a href=\"http:\/\/jsbmw.cn\/index.php\/2026\/04\/27\/2026%e6%9c%80%e6%96%b0%e9%9b%b6%e5%9f%ba%e7%a1%80%ef%bc%9awireguard-vpn%e6%97%81%e8%b7%af%e7%94%b1%e5%bc%82%e5%9c%b0%e7%bb%84%e7%bd%91%e8%b6%85%e8%af%a6%e7%bb%86%e6%95%99%e7%a8%8b\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">2026\u6700\u65b0\u96f6\u57fa\u7840\uff1aWireGuard VPN\u65c1\u8def\u7531\u5f02\u5730\u7ec4\u7f51\u8d85\u8be6\u7ec6\u6559\u7a0b<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-208","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/posts\/208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/comments?post=208"}],"version-history":[{"count":1,"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/posts\/208\/revisions"}],"predecessor-version":[{"id":209,"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/posts\/208\/revisions\/209"}],"wp:attachment":[{"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/media?parent=208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/categories?post=208"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/jsbmw.cn\/index.php\/wp-json\/wp\/v2\/tags?post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}