{"id":30,"date":"2026-01-22T04:12:14","date_gmt":"2026-01-22T04:12:14","guid":{"rendered":"https:\/\/blog.gpst.net.cn:4008\/?p=30"},"modified":"2026-01-28T06:24:16","modified_gmt":"2026-01-28T06:24:16","slug":"wireguard%e4%b8%a4%e7%ab%af%e9%85%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/opshub.com.cn\/?p=30","title":{"rendered":"wireguard\u4e24\u7aef\u914d\u7f6e"},"content":{"rendered":"\n<p>A\u7aef\uff08\u6d41\u91cf\u8282\u70b9\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;Interface]\nPrivateKey = uDpppS+O0XUGUZWM4rhiGAx6yiEriT7MBc5ImmL0Wn0=\nListenPort = 4784 \uff08A\u7aef\u76d1\u542c\u7aef\u53e3\uff09\nPostUp = ip addr add 192.168.11.2\/24\uff08B\u7aefipip0\u7684ip\uff09 dev wg0;iptables -t nat -A POSTROUTING -o wg0 -j MASQUERADE\nPostDown = iptables -t nat -D POSTROUTING -o wg0 -j MASQUERADE\nMTU = 1400\n&#091;Peer]\nPublicKey = xyzSAqC7a5sQZu\/I2qFyLyV9jt2JW\/2IyOU+uG9EVSE=\nEndpoint = 212.95.137.174:2342 \uff08B\u7aef\u7684\u516c\u7f51IP\u548c\u76d1\u542c\u7aef\u53e3\uff09\nAllowedIPs = 0.0.0.0\/0 **\u5141\u8bb8\u6240\u6709\nPersistentKeepalive = 25<\/code><\/pre>\n\n\n\n<p>B\u7aef\uff08\u8de8\u5883\u8282\u70b9\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;Interface]\nPrivateKey = kK5Mdf857Ra6Tjq4Cg4u+miHTgiUXZFGP\/qHfE7uCUI=\nListenPort = 2342 \uff08B\u7aef\u76d1\u542c\u7aef\u53e3\uff09\nPostUp = ip addr add 192.168.11.3\/24\uff08A\u7aef\u7684ipip0\u7684ip\uff09 dev wg0;iptables -t nat -A POSTROUTING -o eth0\uff08B\u7aef\u7684\u51fa\u53e3\u7f51\u5361\uff09 -j MASQUERADE\nPostDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE\nMTU = 1400\n&#091;Peer]\nPublicKey = lOhrqPx52WrdFGpajwO42c\/8zrD7udPVbf7BypBNOlw=\nEndpoint = 221.130.184.91:4784 \uff08A\u7aef\u7684\u516c\u7f51IP\u548c\u76d1\u542c\u7aef\u53e3\uff09\nAllowedIPs = 192.168.11.0\/24 **\u53ea\u5141\u8bb8A-B\u4e4b\u95f4\u7684ipip\u96a7\u9053\u7684\u5730\u5740\nPersistentKeepalive = 25<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A\u7aef\uff08\u6d41\u91cf\u8282\u70b9\uff09\uff1a B\u7aef\uff08\u8de8\u5883\u8282\u70b9\uff09\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-9"],"_links":{"self":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30"}],"version-history":[{"count":2,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions"}],"predecessor-version":[{"id":691,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/30\/revisions\/691"}],"wp:attachment":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}