{"id":1398,"date":"2025-11-24T19:19:14","date_gmt":"2025-11-24T11:19:14","guid":{"rendered":"https:\/\/b.yesiyu.top\/?p=1398"},"modified":"2025-11-24T19:19:14","modified_gmt":"2025-11-24T11:19:14","slug":"debian12%e4%b8%8bwireguard%e4%b8%80%e9%94%ae%e5%ae%89%e8%a3%85%e8%84%9a%e6%9c%ac%e5%88%86%e4%ba%ab%e8%af%a6%e8%a7%a32025","status":"publish","type":"post","link":"https:\/\/b.yesiyu.top\/?p=1398","title":{"rendered":"debian12\u4e0bwireguard\u4e00\u952e\u5b89\u88c5\u811a\u672c\u5206\u4eab\u8be6\u89e32025"},"content":{"rendered":"<p>\u811a\u672c\u5b89\u88c5\u5730\u5740\uff1a<\/p>\n<p>https:\/\/github.com\/angristan\/wireguard-install<\/p>\n<div class=\"cnblogs_code\">\n<pre>curl -O https:<span data-darkreader-inline-color=\"\">\/\/raw.githubusercontent.com\/angristan\/wireguard-install\/master\/wireguard-install.sh\r\nchmod +x wireguard-install.sh\r\n.\/wireguard-install.sh\r\n<\/span><\/pre>\n<\/div>\n<p>\u8fd0\u884c\u4e4b\u540e\uff1a<\/p>\n<p>IPv4 or IPv6 public address:\uff08\u8fd9\u91cc\u586b\u5199\u670d\u52a1\u5668\u7684\u5916\u7f51ip\u5730\u5740\uff09<br \/>\nPublic interface: \uff08eth0\uff09\u7ed1\u5b9a\u7684\u7f51\u5361<br \/>\nWireGuard interface name: wg0\uff08wg\u865a\u62df\u7f51\u5361\uff0c\u4e0d\u7528\u6539\uff09<br \/>\nServer WireGuard IPv4: 10.66.66.1\uff08wg\u7ec4\u7f51\u7684ip4\uff0c\u4e0d\u7528\u6539\uff09<br \/>\nServer WireGuard IPv6: fd42:42:42::1\uff08wg\u7ec4\u7f51\u7684ip6\uff0c\u4e0d\u7528\u6539\uff09<br \/>\nServer WireGuard port [1-65535]: 62313\uff08wg\u4f7f\u7528\u7aef\u53e3\uff0c\u53ef\u6539\u4e86\uff0c\u7136\u540e\u5728\u670d\u52a1\u5668\u9632\u706b\u5899\u6dfb\u52a0\u8fdb\u53bb\u653e\u884c\u8fd9\u4e2a\u7aef\u53e3\uff0c\u6ce8\u610f\u6dfb\u52a0UDP\u534f\u8bae\uff09<br \/>\nFirst DNS resolver to use for the clients: 1.1.1.1\uff08DNS\uff0c\u6216\u6539\u62108.8.8.8\uff09<br \/>\nSecond DNS resolver to use for the clients (optional): 1.0.0.1\uff08\u5907\u7528DNS\uff09<\/p>\n<p>WireGuard uses a parameter called AllowedIPs to determine what is routed over the VPN.<br \/>\nAllowed IPs list for generated clients (leave default to route everything): 0.0.0.0\/0,::\/0 \uff08\u5141\u8bb8\u5ba2\u6237\u7aefip\uff0c\u4e0d\u7528\u6539\uff09<\/p>\n<p>Okay, that was all I needed. We are ready to setup your WireGuard server now.<br \/>\nYou will be able to generate a client at the end of the installation.<br \/>\nPress any key to continue&#8230;<br \/>\n\u5f00\u59cb\uff0c\u968f\u4fbf\u53d6\u4e2a\u540d\u79f0\uff1a<\/p>\n<p>The client name must consist of alphanumeric character(s). It may also include underscores or dashes and can&#8217;t exceed 15 chars.<br \/>\nClient name: jb<br \/>\nClient WireGuard IPv4: 10.66.66.2<br \/>\nClient WireGuard IPv6: fd42:42:42::2<br \/>\n\u7136\u540e\u4f1a\u751f\u6210\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u548c\u4e8c\u7ef4\u7801\uff1a<\/p>\n<p>Here is your client config file as a QR Code:<br \/>\n\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002<br \/>\n\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002<br \/>\n\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002\u3002<br \/>\nYour client config file is in \/root\/wg0-client-jb.conf<br \/>\nIf you want to add more clients, you simply need to run this script another time!<\/p>\n<p>WireGuard is running.<br \/>\nYou can check the status of WireGuard with: systemctl status wg-quick@wg0<\/p>\n<p>If you don&#8217;t have internet connectivity from your client, try to reboot the server.<br \/>\n\u5728\u5ba2\u6237\u7aef\u4e0b\u8f7d\u4e2a\u5de5\u5177\u8f6f\u4ef6\u5bfc\u5165\u521a\u624d\u7684conf\u6587\u4ef6\uff0c\u6216\u8005\u626b\u7801\u5c31\u884c\uff1a<\/p>\n<p>https:\/\/www.wireguard.com\/install\/<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u811a\u672c\u5b89\u88c5\u5730\u5740\uff1a https:\/\/github.com\/angristan\/wireguard-install  &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/b.yesiyu.top\/?p=1398\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cdebian12\u4e0bwireguard\u4e00\u952e\u5b89\u88c5\u811a\u672c\u5206\u4eab\u8be6\u89e32025\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1398","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/1398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1398"}],"version-history":[{"count":1,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/1398\/revisions"}],"predecessor-version":[{"id":1399,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/1398\/revisions\/1399"}],"wp:attachment":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}