{"id":30383,"date":"2026-02-25T15:37:58","date_gmt":"2026-02-25T07:37:58","guid":{"rendered":"https:\/\/www.varidata.com\/uncategorized-zh-cn\/how-to-configure-a-different-ip-address-for-your-wireguard\/"},"modified":"2026-02-25T15:49:29","modified_gmt":"2026-02-25T07:49:29","slug":"how-to-configure-a-different-ip-address-for-your-wireguard","status":"publish","type":"post","link":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/","title":{"rendered":"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740"},"content":{"rendered":"<style>\n    table, th, td {\n        border: 1px solid black;\n        border-collapse: collapse;\n    }\n<\/style>\n<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u5728 Interface \u6bb5\u4e2d\u6307\u5b9a\u6240\u9700\u5730\u5740\uff0c\u4e3a WireGuard \u63a5\u53e3\u8bbe\u7f6e\u4e00\u4e2a\u4e0d\u540c\u7684 IP \u5730\u5740\u3002\u5bf9\u4e8e\u4e24\u53f0\u4e3b\u673a\u4e4b\u95f4\u7684\u70b9\u5bf9\u70b9\u8fde\u63a5\uff0c\u5efa\u8bae\u4f7f\u7528 \/31 \u5b50\u7f51\u63a9\u7801\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u907f\u514d\u5728\u90e8\u7f72 VPN \u7aef\u70b9\uff08\u4f8b\u5982\u4f7f\u7528<a target=\"_blank\" href=\"https:\/\/www.varidata.com\/zh-cn\/server\/tokyo\/cn2\/\">\u65e5\u672c\u670d\u52a1\u5668\u79df\u7528<\/a>\uff09\u65f6\u6d6a\u8d39 IP \u5730\u5740\u3002\u53ea\u8981\u914d\u7f6e\u6b63\u786e\uff0c\u5c31\u80fd\u540c\u65f6\u4fdd\u8bc1\u8fde\u901a\u6027\u548c\u8def\u7531\u884c\u4e3a\u7b26\u5408\u9884\u671f\u3002\u4fee\u6539\u540e\u52a1\u5fc5\u68c0\u67e5\uff0c\u786e\u4fdd\u7f51\u7edc\u4fdd\u6301\u5b89\u5168\u4e14\u7a33\u5b9a\u53ef\u9760\u3002<\/p>\n<h2>\u5173\u952e\u8981\u70b9<\/h2>\n<ul>\n<li>\n<p>\u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u5728 <code>[Interface]<\/code> \u6bb5\u4e2d\u8bbe\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\u3002\u4f7f\u7528 CIDR \u8868\u793a\u6cd5\u4ee5\u4fbf\u6e05\u6670\u660e\u4e86\u3002<\/p>\n<\/li>\n<li>\n<p>\u70b9\u5bf9\u70b9\u8fde\u63a5\u4e2d\u4f7f\u7528 \/31 \u5b50\u7f51\u4ee5\u8282\u7701 IP \u5730\u5740\uff0c\u8fd9\u6837\u6070\u597d\u63d0\u4f9b\u4e24\u4e2a\u53ef\u7528\u5730\u5740\u3002<\/p>\n<\/li>\n<li>\n<p>\u901a\u8fc7\u4e3a\u5404\u4e2a Peer \u914d\u7f6e AllowedIPs\uff0c\u53ef\u4ee5\u4e3a\u63a5\u53e3\u5206\u914d\u591a\u4e2a IP \u5730\u5740\uff0c\u4ece\u800c\u8ba9 VPN \u4e3a\u4e0d\u540c\u7f51\u7edc\u8f6c\u53d1\u6d41\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>\u6bcf\u4e2a WireGuard \u63a5\u53e3\u90fd\u5e94\u4f7f\u7528\u72ec\u7acb\u7684\u5bc6\u94a5\u5bf9\u4ee5\u4fdd\u8bc1\u5b89\u5168\u3002\u52a1\u5fc5\u4fdd\u62a4\u597d\u79c1\u94a5\u5e76\u5b9a\u671f\u5ba1\u8ba1\u914d\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u671f\u68c0\u67e5 IP \u8bbe\u7f6e\u548c\u9632\u706b\u5899\u89c4\u5219\u4ee5\u6392\u67e5\u8fde\u63a5\u95ee\u9898\u3002\u53ef\u4f7f\u7528 <code>wg<\/code> \u4e0e <code>ip route<\/code> \u7b49\u547d\u4ee4\u8fdb\u884c\u8bca\u65ad\u3002<\/p>\n<\/li>\n<\/ul>\n<h2>\u5728 WireGuard \u63a5\u53e3\u4e0a\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740<\/h2>\n<h3>\u7f16\u8f91 WireGuard \u914d\u7f6e<\/h3>\n<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u4e3a WireGuard \u63a5\u53e3\u5206\u914d\u4e00\u4e2a\u4e0d\u540c\u7684 IP \u5730\u5740\u3002\u6b64\u8fc7\u7a0b\u5305\u542b\u51e0\u4e2a\u5173\u952e\u6b65\u9aa4\u3002\u6309\u7167\u4e0b\u9762\u7684\u8bf4\u660e\u5373\u53ef\u4e3a\u70b9\u5bf9\u70b9\u8fde\u63a5\u5b8c\u6210\u63a5\u53e3\u8bbe\u7f6e\uff1a<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u540d\u4e3a <code>wg0.conf<\/code> \u6216\u7c7b\u4f3c\u540d\u79f0\u3002<\/p>\n<\/li>\n<li>\n<p>\u5728 <code>[Interface]<\/code> \u6bb5\u4e0b\uff0c\u65b0\u589e\u6216\u4fee\u6539 <code>Address<\/code> \u884c\uff0c\u5c06\u5176\u8bbe\u7f6e\u4e3a\u4f60\u9009\u62e9\u7684\u4e0d\u540c IP \u5730\u5740\uff0c\u5e76\u4f7f\u7528 CIDR \u8868\u793a\u6cd5\u3002\u4f8b\u5982\uff1a<code>Address = 172.21.0.1\/31<\/code>\u3002<\/p>\n<\/li>\n<li>\n<p>\u901a\u8fc7\u6dfb\u52a0 PostUp \u547d\u4ee4\u542f\u7528 IP \u8f6c\u53d1\uff1a<br \/><code>PostUp = sysctl -w net.ipv4.ip_forward=1<\/code><\/p>\n<\/li>\n<li>\n<p>\u8bbe\u7f6e\u6e90\u5730\u5740\u8f6c\u6362\uff08SNAT\uff09\u89c4\u5219\u4ee5\u4fdd\u8bc1\u8def\u7531\u6b63\u5e38\u5de5\u4f5c\uff1a<br \/><code>PostUp = iptables -t nat -I POSTROUTING 1 -o %i -j SNAT --to-source 172.21.0.1<\/code><\/p>\n<\/li>\n<li>\n<p>\u5f53\u63a5\u53e3\u5173\u95ed\u65f6\u79fb\u9664 SNAT \u89c4\u5219\uff1a<br \/><code>PostDown = iptables -t nat -D POSTROUTING 1 -o %i -j SNAT --to-source 172.21.0.1<\/code><\/p>\n<\/li>\n<li>\n<p>\u4fdd\u5b58\u6587\u4ef6\u5e76\u91cd\u542f WireGuard \u670d\u52a1\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p><strong>\u63d0\u793a\uff1a<\/strong>\u52a1\u5fc5\u53cd\u590d\u6838\u5bf9\u4f60\u7684 IP \u5730\u5740\u8bbe\u7f6e\u3002\u786e\u4fdd\u683c\u5f0f\u6b63\u786e\uff0c\u5e76\u5305\u542b\u5b50\u7f51\u63a9\u7801\u3002<\/p>\n<\/blockquote>\n<p>\u5728\u7f16\u8f91 WireGuard \u914d\u7f6e\u65f6\uff0c\u5e38\u89c1\u7684\u4e00\u4e9b\u9519\u8bef\u5305\u62ec\uff1a<\/p>\n<div fullwidth=\"\" class=\"qc-default-table-wrapper \">\n<table style=\"min-width: 50px;\">\n<colgroup>\n<col style=\"min-width: 25px;\">\n<col style=\"min-width: 25px;\"><\/colgroup>\n<tbody>\n<tr>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u9519\u8bef<\/p>\n<\/th>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u8bf4\u660e<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>IP \u5730\u5740\u683c\u5f0f\u4e0d\u6b63\u786e<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>Address \u5b57\u6bb5\u5fc5\u987b\u5305\u542b\u5b50\u7f51\u63a9\u7801\u624d\u80fd\u88ab\u6b63\u786e\u89e3\u6790\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u7f3a\u5c11\u5b50\u7f51\u63a9\u7801<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u4ec5\u63d0\u4f9b IP \u800c\u4e0d\u5e26\u63a9\u7801\uff0c\u53ef\u80fd\u5bfc\u81f4\u914d\u7f6e\u9519\u8bef\u3002<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u4f60\u5e94\u59cb\u7ec8\u4e3a WireGuard \u63a5\u53e3\u89c4\u5212\u72ec\u7acb\u7684\u5730\u5740\u7a7a\u95f4\uff0c\u4ee5\u907f\u514d\u4e0e\u7f51\u7edc\u4e2d\u5176\u4ed6\u8bbe\u5907\u51b2\u7a81\u3002IP \u5730\u5740\u5fc5\u987b\u91c7\u7528 CIDR \u8868\u793a\u6cd5\uff0c\u4f8b\u5982 <code>10.0.0.1\/32<\/code>\u3002<\/p>\n<h3>\u5728\u70b9\u5bf9\u70b9\u573a\u666f\u4e2d\u4f7f\u7528 \/31 \u5b50\u7f51<\/h3>\n<p>\/31 \u5b50\u7f51\u975e\u5e38\u9002\u5408\u70b9\u5bf9\u70b9\u8fde\u63a5\u3002\u8fd9\u79cd\u5b50\u7f51\u7cbe\u786e\u63d0\u4f9b\u4e24\u4e2a\u53ef\u7528 IP \u5730\u5740\uff0c\u6b63\u597d\u6ee1\u8db3\u4e24\u53f0\u4e3b\u673a\u4e4b\u95f4\u7684 WireGuard \u90e8\u7f72\u9700\u6c42\u3002\u4f60\u53ef\u4ee5\u4e3a\u6bcf\u4e2a WireGuard \u63a5\u53e3\u5206\u914d\u4e00\u4e2a\u5730\u5740\u3002\u8fd9\u79cd\u65b9\u5f0f\u6709\u52a9\u4e8e\u907f\u514d\u6d6a\u8d39\u7f51\u7edc\u4e2d\u7684\u53ef\u7528\u5730\u5740\u3002<\/p>\n<ul>\n<li>\n<p>\/31 \u5b50\u7f51\u4e0e MikroTik \u8bbe\u5907\u4e0d\u517c\u5bb9\u3002<\/p>\n<\/li>\n<li>\n<p>\u4ec5\u5f53\u53cc\u65b9\u8bbe\u5907\u90fd\u652f\u6301 \/31 \u65f6\u624d\u5e94\u4f7f\u7528\u3002<\/p>\n<\/li>\n<li>\n<p>\u6bcf\u4e2a\u63a5\u53e3\u5728 \/31 \u8303\u56f4\u5185\u90fd\u5fc5\u987b\u5177\u6709\u552f\u4e00\u7684 IP \u5730\u5740\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u4f7f\u7528 \/31 \u5b50\u7f51\u53ef\u4ee5\u8ba9\u4f60\u7684 WireGuard \u914d\u7f6e\u66f4\u52a0\u9ad8\u6548\uff0c\u540c\u65f6\u4e5f\u80fd\u4f7f\u7f51\u7edc\u7ed3\u6784\u66f4\u52a0\u6e05\u6670\u6613\u4e8e\u7ba1\u7406\u3002<\/p>\n<h3>\u5206\u914d\u591a\u4e2a IP \u5730\u5740<\/h3>\n<blockquote>\n<p>\u8981\u4e3a WireGuard \u63a5\u53e3\u5206\u914d\u591a\u4e2a IP \u5730\u5740\uff0c\u53ef\u4ee5\u5728 Peer \u6bb5\u4e2d\u4f7f\u7528 AllowedIPs \u8bbe\u7f6e\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u9017\u53f7\u5206\u9694\u7684\u65b9\u5f0f\u5199\u5165\u591a\u4e2a IP \u5730\u5740\u6216\u5730\u5740\u6bb5\uff0c\u6216\u8005\u4e3a\u540c\u4e00\u4e2a Peer \u591a\u6b21\u4f7f\u7528 AllowedIPs \u914d\u7f6e\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>[Peer]\r\nPublicKey = fE\/wdxzl0klVp\/IR8UcaoGUMjqaWi3jAd7KzHKFS6Ds=\r\nAllowedIPs = 192.168.200.0\/24, 10.0.0.0\/24\r\n# \u6216\u8005\uff1a\r\nAllowedIPs = 192.168.200.0\/24\r\nAllowedIPs = 10.0.0.0\/24\r\n<\/code><\/pre>\n<\/blockquote>\n<p>\u5982\u679c\u7f51\u7edc\u6709\u9700\u8981\uff0c\u4f60\u4e5f\u53ef\u4ee5\u4e3a WireGuard \u63a5\u53e3\u5173\u8054\u591a\u4e2a\u4e0d\u540c\u7684 IP \u5730\u5740\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u540c\u4e00\u6761 VPN \u96a7\u9053\u5c31\u80fd\u4e3a\u591a\u4e2a\u7f51\u7edc\u8f6c\u53d1\u6d41\u91cf\u3002\u4f60\u5e94\u5728\u6bcf\u4e2a Peer \u7684 AllowedIPs \u5b57\u6bb5\u4e2d\u5217\u51fa\u6240\u6709\u9700\u8981\u7684 IP \u5730\u5740\u6216\u7f51\u6bb5\u3002\u8fd9\u79cd\u65b9\u5f0f\u5728 WireGuard \u90e8\u7f72\u4e2d\u4e3a\u4f60\u63d0\u4f9b\u4e86\u66f4\u5927\u7684\u7075\u6d3b\u6027\u548c\u63a7\u5236\u529b\u3002<\/p>\n<p>\u53ea\u8981\u9075\u5faa\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u4f60\u5c31\u53ef\u4ee5\u6309\u9700\u81ea\u5b9a\u4e49 WireGuard \u63a5\u53e3\u7684\u4e0d\u540c IP \u5730\u5740\u8bbe\u7f6e\uff0c\u4ece\u800c\u63d0\u5347\u7f51\u7edc\u6548\u7387\u4e0e\u5b89\u5168\u6027\u3002<\/p>\n<h2>WireGuard \u70b9\u5bf9\u70b9\u8fde\u63a5\u914d\u7f6e<\/h2>\n<h3>\u914d\u7f6e\u552f\u4e00\u7684\u7aef\u70b9<\/h3>\n<p>\u5728\u70b9\u5bf9\u70b9\u8fde\u63a5\u4e2d\uff0c\u4f60\u9700\u8981\u4e3a\u6bcf\u4e2a WireGuard \u63a5\u53e3\u914d\u7f6e\u552f\u4e00\u7684\u7aef\u70b9\u3002\u6bcf\u4e2a\u63a5\u53e3\u90fd\u5fc5\u987b\u62e5\u6709\u72ec\u7acb\u7684\u4e00\u5bf9\u79c1\u94a5\u548c\u516c\u94a5\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u8fde\u63a5\u5b89\u5168\uff0c\u53ea\u5141\u8bb8\u53ef\u4fe1\u8bbe\u5907\u63a5\u5165\u3002\u4f60\u52a1\u5fc5\u59a5\u5584\u4fdd\u62a4\u79c1\u94a5\uff0c\u8bbe\u7f6e 600 \u6743\u9650\u4fdd\u5b58\uff0c\u5e76\u4e14\u4e0d\u8981\u5206\u4eab\u6216\u63d0\u4ea4\u5230\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u4e2d\u3002<\/p>\n<p>\u5728\u914d\u7f6e WireGuard \u7aef\u70b9\u65f6\uff0c\u6709\u4ee5\u4e0b\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\uff1a<\/p>\n<ol>\n<li>\n<p>\u4f7f\u7528\u9884\u5171\u4eab\u5bc6\u94a5\uff08preshared key\uff09\u589e\u5f3a\u5b89\u5168\u6027\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06 AllowedIPs \u9650\u5236\u5728\u6bcf\u4e2a Peer \u5b9e\u9645\u9700\u8981\u8bbf\u95ee\u7684 IP \u6bb5\u8303\u56f4\u5185\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06 ListenPort \u4ece\u9ed8\u8ba4\u503c\u4fee\u6539\u4e3a\u5176\u4ed6\u7aef\u53e3\uff0c\u4ee5\u51cf\u5c11\u88ab\u626b\u63cf\u7684\u6982\u7387\u3002<\/p>\n<\/li>\n<li>\n<p>\u4fdd\u6301\u7cfb\u7edf\u4e0e\u5185\u6838\u66f4\u65b0\uff0c\u4ee5\u83b7\u53d6\u6700\u65b0\u7684 WireGuard \u529f\u80fd\u548c\u5b89\u5168\u4fee\u590d\u3002<\/p>\n<\/li>\n<li>\n<p>\u76d1\u63a7\u8fde\u63a5\u65e5\u5fd7\uff0c\u7559\u610f\u5f02\u5e38\u6d3b\u52a8\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u671f\u8f6e\u6362\u5bc6\u94a5\u3002<\/p>\n<\/li>\n<li>\n<p>\u901a\u8fc7\u9632\u706b\u5899\u89c4\u5219\u9650\u5236\u53ef\u8bbf\u95ee WireGuard \u7aef\u53e3\u7684 IP \u6bb5\u3002<\/p>\n<\/li>\n<li>\n<p>\u5220\u9664\u914d\u7f6e\u4e2d\u5df2\u4e0d\u518d\u4f7f\u7528\u7684 Peer\u3002<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u671f\u5ba1\u67e5\u6574\u4f53\u914d\u7f6e\uff0c\u786e\u4fdd\u53ea\u6709\u6b63\u786e\u7684\u8bbe\u5907\u80fd\u591f\u63a5\u5165\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u6bcf\u4e2a WireGuard \u63a5\u53e3\u90fd\u9700\u8981\u5355\u72ec\u7684\u5bc6\u94a5\u5bf9\uff0c\u8fd9\u4e00\u8981\u6c42\u80fd\u5e2e\u52a9\u4f60\u7684\u70b9\u5bf9\u70b9\u90e8\u7f72\u66f4\u5b89\u5168\u3001\u66f4\u53ef\u9760\u3002<\/p>\n<blockquote>\n<p><strong>\u63d0\u793a\uff1a<\/strong>\u52a1\u5fc5\u5b9a\u671f\u5ba1\u8ba1\u4f60\u7684 WireGuard \u914d\u7f6e\u3002\u6301\u7eed\u68c0\u67e5\u6709\u52a9\u4e8e\u5728\u95ee\u9898\u5f71\u54cd\u8fde\u63a5\u524d\u63d0\u524d\u53d1\u73b0\u5e76\u89e3\u51b3\u3002<\/p>\n<\/blockquote>\n<h3>\u5355 IP \u4e0e\u591a IP \u7684\u53d6\u820d<\/h3>\n<p>\u4f60\u9700\u8981\u6839\u636e\u5b9e\u9645\u9700\u6c42\u51b3\u5b9a\u662f\u5426\u4e3a WireGuard \u63a5\u53e3\u5206\u914d\u5355\u4e00 IP\uff0c\u8fd8\u662f\u591a\u4e2a IP \u5730\u5740\u3002\u8fd9\u4e2a\u9009\u62e9\u4f1a\u5f71\u54cd\u7f51\u7edc\u7ba1\u7406\u65b9\u5f0f\u4ee5\u53ca\u672a\u6765\u7684\u6269\u5c55\u80fd\u529b\u3002\u5c06\u63a5\u53e3\u914d\u7f6e\u4e3a\u5355\u4e00 IP \u5730\u5740\uff0c\u8def\u7531\u548c\u7ba1\u7406\u4f1a\u66f4\u52a0\u7b80\u5355\uff1b\u800c\u4f7f\u7528\u591a\u4e2a IP \u5730\u5740\uff0c\u5219\u80fd\u8ba9\u540c\u4e00\u63a5\u53e3\u627f\u8f7d\u66f4\u591a\u7f51\u7edc\uff0c\u4f46\u4e5f\u4f1a\u5e26\u6765\u914d\u7f6e\u590d\u6742\u5ea6\u7684\u63d0\u5347\u3002<\/p>\n<p>\u4e0b\u9762\u7684\u5bf9\u6bd4\u53ef\u4ee5\u5e2e\u52a9\u4f60\u505a\u51fa\u9009\u62e9\uff1a<\/p>\n<div fullwidth=\"\" class=\"qc-default-table-wrapper \">\n<table style=\"min-width: 75px;\">\n<colgroup>\n<col style=\"min-width: 25px;\">\n<col style=\"min-width: 25px;\">\n<col style=\"min-width: 25px;\"><\/colgroup>\n<tbody>\n<tr>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u65b9\u9762<\/p>\n<\/th>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u5355\u4e00 IP \u5730\u5740<\/p>\n<\/th>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u591a\u4e2a IP \u5730\u5740<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u8def\u7531\u7b80\u5316<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u7b80\u5316\u8def\u7531\u4e0e\u6574\u4f53\u7ba1\u7406<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u56e0\u9700\u7cbe\u7ec6\u8def\u7531\u800c\u63d0\u5347\u7ba1\u7406\u96be\u5ea6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u53ef\u6269\u5c55\u6027<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5728\u590d\u6742\u67b6\u6784\u4e2d\u53ef\u80fd\u9650\u5236\u6269\u5c55\u80fd\u529b<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u63d0\u9ad8\u6269\u5c55\u80fd\u529b\uff0c\u4f46\u4e5f\u589e\u52a0\u7ba1\u7406\u590d\u6742\u5ea6<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u7ba1\u7406\u590d\u6742\u5ea6<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u4e0e\u5c11\u91cf Peer \u573a\u666f\u4e0b\u66f4\u6613\u7ba1\u7406<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5728\u591a Peer \u573a\u666f\u4e0b\u7ba1\u7406\u8f83\u7e41\u7410<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u6027\u80fd<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5355\u4e00\u5b9e\u4f8b\u4e0b\u901a\u5e38\u6027\u80fd\u8f83\u4f73<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5728\u590d\u6742\u90e8\u7f72\u4e2d\u53ef\u80fd\u9762\u4e34\u6027\u80fd\u6311\u6218<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u5982\u679c\u4f60\u9700\u8981\u7684\u662f\u4e00\u4e2a\u7b80\u5355\u660e\u4e86\u7684 WireGuard \u90e8\u7f72\uff0c\u90a3\u4e48\u4e3a\u6bcf\u4e2a\u63a5\u53e3\u4f7f\u7528\u5355\u4e00 IP \u5730\u5740\u662f\u4e0d\u9519\u7684\u9009\u62e9\u3002\u5982\u679c\u4f60\u7684\u7f51\u7edc\u5fc5\u987b\u652f\u6301\u591a\u4e2a\u5b50\u7f51\u6216\u590d\u6742\u8def\u7531\uff0c\u5219\u53ef\u4ee5\u8003\u8651\u914d\u7f6e\u591a\u4e2a IP \u5730\u5740\u3002\u59cb\u7ec8\u5728\u201c\u7b80\u5316\u8fd0\u7ef4\u201d\u548c\u201c\u7075\u6d3b\u6027\u9700\u6c42\u201d\u4e4b\u95f4\u505a\u5e73\u8861\u3002<\/p>\n<h2>\u8fde\u901a\u6027\u68c0\u67e5\u4e0e\u6545\u969c\u6392\u67e5<\/h2>\n<h3>\u786e\u8ba4 IP \u5206\u914d\u662f\u5426\u6b63\u786e<\/h3>\n<p>\u4f60\u5e94\u5f53\u968f\u65f6\u786e\u8ba4 WireGuard \u63a5\u53e3\u4e0a\u7684 IP \u5730\u5740\u662f\u5426\u914d\u7f6e\u6b63\u786e\u3002\u9996\u5148\u4f7f\u7528\u5408\u9002\u7684\u547d\u4ee4\u6765\u68c0\u67e5\u914d\u7f6e\u3002<code>wg<\/code> \u547d\u4ee4\u53ef\u4ee5\u663e\u793a\u5f53\u524d\u96a7\u9053\u72b6\u6001\uff1b\u4f7f\u7528 <code>ip-link<\/code> \u53ef\u6dfb\u52a0\u6216\u5220\u9664\u63a5\u53e3\uff1b<code>ip-address<\/code> \u7528\u4e8e\u4e3a\u63a5\u53e3\u914d\u7f6e\u5730\u5740\uff1b<code>ip-route<\/code> \u53ef\u4ee5\u7ba1\u7406\u5e76\u67e5\u770b\u8def\u7531\u8868\uff1b<code>show<\/code> \u547d\u4ee4\u5219\u53ef\u5c55\u793a\u5f53\u524d\u914d\u7f6e\u548c\u8fd0\u884c\u65f6\u4fe1\u606f\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u8fd9\u4e9b\u547d\u4ee4\u7684\u5feb\u901f\u53c2\u8003\uff1a<\/p>\n<div fullwidth=\"\" class=\"qc-default-table-wrapper \">\n<table style=\"min-width: 50px;\">\n<colgroup>\n<col style=\"min-width: 25px;\">\n<col style=\"min-width: 25px;\"><\/colgroup>\n<tbody>\n<tr>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u547d\u4ee4<\/p>\n<\/th>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u8bf4\u660e<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>wg<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u7ba1\u7406 WireGuard \u96a7\u9053\u63a5\u53e3\u7684\u914d\u7f6e\u5de5\u5177\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>ip-link<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u7528\u4e8e\u6dfb\u52a0\u6216\u5220\u9664 WireGuard \u63a5\u53e3\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>ip-address<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u4e3a\u63a5\u53e3\u8bbe\u7f6e IP \u5730\u5740\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>ip-route<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u7ba1\u7406\u63a5\u53e3\u76f8\u5173\u7684\u8def\u7531\u8868\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>show<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u663e\u793a\u5f53\u524d\u914d\u7f6e\u4e0e\u8fd0\u884c\u72b6\u6001\u4fe1\u606f\u3002<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u68c0\u67e5\u5404\u4e2a Peer \u7684\u72b6\u6001\uff0c\u5173\u6ce8\u7aef\u70b9\u5730\u5740\u3001AllowedIPs \u4e0e\u6700\u8fd1\u63e1\u624b\u65f6\u95f4\u7b49\u4fe1\u606f\u3002\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>\n<p>Peer #1\uff1a\u7aef\u70b9 192.168.2.1:50074\uff0cAllowed IPs 10.0.0.2\/32\uff0c\u6700\u8fd1\u4e00\u6b21\u63e1\u624b\u4e3a 4 \u5206\u949f\u524d\u3002<\/p>\n<\/li>\n<li>\n<p>Peer #2\uff1a\u7aef\u70b9 99.203.28.43:36770\uff0cAllowed IPs 10.0.0.10\/32\uff0c\u6700\u8fd1\u4e00\u6b21\u63e1\u624b\u4e3a 5 \u5206\u949f\u524d\u3002<\/p>\n<\/li>\n<\/ul>\n<h3>\u6392\u67e5 Ping \u4e0d\u901a\u7684\u95ee\u9898<\/h3>\n<p>Ping \u4e0d\u901a\u5f80\u5f80\u610f\u5473\u7740\u914d\u7f6e\u6216\u7f51\u7edc\u5b58\u5728\u95ee\u9898\u3002\u4f60\u53ef\u80fd\u4f1a\u770b\u5230\u63e1\u624b\u5931\u8d25\uff0c\u6216\u8005\u5b8c\u5168\u6ca1\u6709\u4efb\u4f55\u62a5\u9519\u4fe1\u606f\u3002\u8def\u7531\u9519\u8bef\u4e5f\u4f1a\u5bfc\u81f4\u8fde\u63a5\u4e2d\u65ad\uff0c\u8868\u73b0\u4e3a Ping \u6ca1\u6709\u56de\u5e94\u6216 DNS \u89e3\u6790\u5931\u8d25\u3002\u8981\u6392\u67e5\u95ee\u9898\uff0c\u4f60\u53ef\u4ee5\u6309\u4e0b\u9762\u7684\u6b65\u9aa4\u8fdb\u884c\uff1a<\/p>\n<ol>\n<li>\n<p>\u68c0\u67e5\u516c\u94a5\u548c\u79c1\u94a5\u662f\u5426\u6b63\u786e\u3002<\/p>\n<\/li>\n<li>\n<p>\u4ed4\u7ec6\u6838\u5bf9 AllowedIPs \u5217\u8868\u662f\u5426\u51c6\u786e\u65e0\u8bef\u3002<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528 <code>ip route<\/code> \u548c <code>ip addr show dev &lt;wg-interface&gt;<\/code> \u6765\u786e\u8ba4\u8def\u7531\u4e0e IP \u662f\u5426\u6b63\u786e\u3002<\/p>\n<\/li>\n<li>\n<p>\u786e\u4fdd <code>\/proc\/sys\/net\/ipv4\/ip_forward<\/code> \u7684\u503c\u4e3a 1\u3002<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u5c06 VPN \u7528\u6237\u63a5\u5165\u73b0\u6709\u7f51\u7edc\uff0c\u9700\u5c06 <code>\/proc\/sys\/net\/ipv4\/conf\/all\/proxy_arp<\/code> \u8bbe\u7f6e\u4e3a 1\u3002<\/p>\n<\/li>\n<li>\n<p>\u5c06\u8fd9\u4e9b\u8bbe\u7f6e\u5199\u5165 <code>\/etc\/sysctl.conf<\/code> \u6216 <code>\/etc\/sysctl.d<\/code> \u4ee5\u4fbf\u6301\u4e45\u751f\u6548\u3002<\/p>\n<\/li>\n<\/ol>\n<p>\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528 tcpdump \u6765\u5206\u6790\u6d41\u91cf\uff0c\u5e76\u4e14\u6bcf\u6b21\u53ea\u9488\u5bf9\u4e00\u4e2a\u4e3b\u673a\u548c\u4e00\u4e2a\u63a5\u53e3\u8fdb\u884c\u68c0\u67e5\uff0c\u4ee5\u4fbf\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898\u3002<\/p>\n<h3>\u8def\u7531\u4e0e\u9632\u706b\u5899\u95ee\u9898<\/h3>\n<p>\u8def\u7531\u548c\u9632\u706b\u5899\u914d\u7f6e\u4e0d\u5f53\u4f1a\u963b\u65ad\u6d41\u91cf\u6216\u5f15\u8d77\u4e22\u5305\u3002\u4f60\u53ef\u80fd\u770b\u5230\u6d41\u91cf\u88ab\u963b\u6321\u3001\u8def\u7531\u8def\u5f84\u9519\u8bef\uff0c\u751a\u81f3\u5b8c\u5168\u65ad\u5f00\u8fde\u63a5\u3002\u6709\u65f6 NAT \u6216\u9632\u706b\u5899\u89c4\u5219\u4f1a\u62e6\u622a\u8fd4\u56de\u6d41\u91cf\u3002\u4e0b\u8868\u5217\u51fa\u4e86\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u7c7b\u578b\uff1a<\/p>\n<div fullwidth=\"\" class=\"qc-default-table-wrapper \">\n<table style=\"min-width: 50px;\">\n<colgroup>\n<col style=\"min-width: 25px;\">\n<col style=\"min-width: 25px;\"><\/colgroup>\n<tbody>\n<tr>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u95ee\u9898\u7c7b\u578b<\/p>\n<\/th>\n<th colspan=\"1\" rowspan=\"1\">\n<p>\u8bf4\u660e<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u6d41\u91cf\u88ab\u963b\u65ad<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u9632\u706b\u5899\u89c4\u5219\u62e6\u622a\u4e86\u6d41\u91cf\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u8def\u7531\u8def\u5f84\u9519\u8bef<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u7531\u4e8e\u8def\u7531\u9519\u8bef\uff0c\u6d41\u91cf\u672a\u80fd\u5230\u8fbe\u76ee\u6807\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u96a7\u9053\u5efa\u7acb\u5931\u8d25<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u914d\u7f6e\u9519\u8bef\u963b\u6b62\u4e86\u96a7\u9053\u521b\u5efa\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u65e0\u6cd5\u6536\u53d1\u6570\u636e\u5305<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u6570\u636e\u5305\u672a\u80fd\u6210\u529f\u901a\u8fc7\u7f51\u7edc\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u8fde\u63a5\u65f6\u597d\u65f6\u574f<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u95f4\u6b47\u6027\u8fde\u63a5\u95ee\u9898\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u5b8c\u5168\u65ad\u8fde<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>VPN \u5b8c\u5168\u5931\u53bb\u8fde\u63a5\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u4e22\u5305\u6216\u6570\u636e\u635f\u574f<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u6570\u636e\u5305\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\u4e22\u5931\u6216\u88ab\u7834\u574f\u3002<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"1\" rowspan=\"1\">\n<p>NAT\/\u9632\u706b\u5899\u95ee\u9898<\/p>\n<\/td>\n<td colspan=\"1\" rowspan=\"1\">\n<p>\u914d\u7f6e\u4e0d\u5f53\u7684\u89c4\u5219\u963b\u65ad\u4e86\u8fd4\u56de\u6d41\u91cf\u3002<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u4e3a\u89e3\u51b3\u4e0a\u8ff0\u95ee\u9898\uff0c\u4f60\u9700\u8981\u91cd\u65b0\u5ba1\u67e5\u9632\u706b\u5899\u89c4\u5219\uff1a\u653e\u884c\u5df2\u5efa\u7acb\u8fde\u63a5\u548c\u5fc5\u8981\u7aef\u53e3\u4e0a\u7684\u65b0\u8fde\u63a5\uff0c\u5e76\u62d2\u7edd\u5176\u4ed6\u6240\u6709\u8f6c\u53d1\u6d41\u91cf\u3002\u59cb\u7ec8\u68c0\u67e5\u914d\u7f6e\u4e0e\u8def\u7531\u8bbe\u7f6e\uff0c\u786e\u4fdd VPN \u957f\u671f\u7a33\u5b9a\u8fd0\u884c\u3002<\/p>\n<h2>WireGuard \u7684\u8def\u7531\u4e0e NAT \u65b9\u6848<\/h2>\n<p>\u6b63\u786e\u914d\u7f6e\u8def\u7531\u548c NAT \u5bf9\u4e8e\u7a33\u5b9a\u7684 WireGuard \u8fde\u63a5\u81f3\u5173\u91cd\u8981\u3002\u4f60\u9700\u8981\u786e\u4fdd\u914d\u7f6e\u80fd\u591f\u652f\u6301\u8bbe\u5907\u548c\u7f51\u7edc\u4e4b\u95f4\u7684\u6b63\u5e38\u6d41\u91cf\u8f6c\u53d1\u3002\u672c\u8282\u5c06\u5e2e\u52a9\u4f60\u907f\u514d\u5e38\u89c1\u9519\u8bef\uff0c\u5e76\u6539\u5584\u6574\u4f53 VPN \u4f7f\u7528\u4f53\u9a8c\u3002<\/p>\n<h3>\u9759\u6001\u8def\u7531\u914d\u7f6e<\/h3>\n<p>\u5fc5\u987b\u914d\u7f6e\u9759\u6001\u8def\u7531\uff0c\u4f7f\u8bbe\u5907\u77e5\u9053\u5e94\u5c06\u6d41\u91cf\u53d1\u9001\u5230\u54ea\u91cc\u3002\u5982\u679c\u4f60\u5e0c\u671b\u6240\u6709\u4e92\u8054\u7f51\u6d41\u91cf\u90fd\u8d70 VPN\uff0c\u53ef\u4ee5\u5728\u914d\u7f6e\u4e2d\u8bbe\u7f6e <code>AllowedIPs = 0.0.0.0\/0<\/code>\u3002\u6709\u4e9b\u8def\u7531\u5668\u6216\u56fa\u4ef6\u53ef\u80fd\u4e0d\u652f\u6301\u6b64\u914d\u7f6e\uff0c\u56e0\u6b64\u52a1\u5fc5\u53c2\u8003\u5177\u4f53\u8bbe\u5907\u7684\u5b98\u65b9\u6587\u6863\u3002<\/p>\n<p>\u8bb8\u591a\u7528\u6237\u5e38\u5e38\u5fd8\u8bb0\u5728\u7f51\u5173\u914d\u7f6e\u4e2d\u542f\u7528\u201c\u5141\u8bb8\u4f7f\u7528\u975e\u672c\u5730\u7f51\u5173\u201d\uff08use non-local gateway\uff09\u9009\u9879\uff0c\u8fd9\u4f1a\u5bfc\u81f4\u8def\u7531\u95ee\u9898\u3002\u4f60\u8fd8\u5e94\u786e\u4fdd\u6bcf\u6761\u96a7\u9053\u4f7f\u7528\u4e0d\u540c\u7684\u76d1\u542c\u7aef\u53e3\uff0c\u82e5\u591a\u6761\u96a7\u9053\u5171\u7528\u540c\u4e00\u7aef\u53e3\uff0c\u5f80\u5f80\u4f1a\u9020\u6210\u51b2\u7a81\u3002<\/p>\n<p>\u907f\u514d\u8def\u7531\u95ee\u9898\u7684\u4e00\u4e9b\u5efa\u8bae\uff1a<\/p>\n<ul>\n<li>\n<p>\u68c0\u67e5\u7f51\u5173\u8bbe\u7f6e\uff0c\u786e\u4fdd\u5176\u5141\u8bb8\u5c06\u6d41\u91cf\u53d1\u9001\u5230\u96a7\u9053\u5916\u90e8\u7f51\u7edc\u3002<\/p>\n<\/li>\n<li>\n<p>\u4e3a\u672c\u5730\u7f51\u7edc\u4e0e VPN \u7f51\u7edc\u4f7f\u7528\u4e0d\u540c\u5b50\u7f51\u3002\u4f8b\u5982\uff0c\u5982\u9047 IP \u51b2\u7a81\uff0c\u53ef\u5c06\u5bb6\u5ead\u7f51\u7edc\u6539\u4e3a 192.168.23.x\/24\u3002<\/p>\n<\/li>\n<li>\n<p>\u5982\u9700\u8ba9\u6240\u6709\u6d41\u91cf\u90fd\u901a\u8fc7 VPN\uff0c\u53ef\u4e3a\u6b64\u5355\u72ec\u521b\u5efa\u7b2c\u4e8c\u4e2a\u914d\u7f6e\u6587\u4ef6\uff08\u6216\u914d\u7f6e\u6863\uff09\u3002<\/p>\n<\/li>\n<\/ul>\n<blockquote>\n<p><strong>\u63d0\u793a\uff1a<\/strong>\u6bcf\u6b21\u4fee\u6539\u914d\u7f6e\u540e\u90fd\u8981\u8fdb\u884c\u68c0\u67e5\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u95ee\u9898\u771f\u6b63\u9020\u6210\u5f71\u54cd\u4e4b\u524d\u5c06\u5176\u53d1\u73b0\u5e76\u4fee\u590d\u3002<\/p>\n<\/blockquote>\n<h3>NAT \u914d\u7f6e<\/h3>\n<p>NAT\uff08\u7f51\u7edc\u5730\u5740\u8f6c\u6362\uff09\u5e2e\u52a9\u4f4d\u4e8e\u8def\u7531\u5668\u6216\u9632\u706b\u5899\u540e\u7684\u8bbe\u5907\u4e0e\u5176\u4ed6\u7f51\u7edc\u901a\u4fe1\u3002WireGuard \u5185\u7f6e\u4e86\u4e00\u4e9b\u7279\u6027\u6765\u914d\u5408 NAT\uff0c\u4f7f\u4f60\u7684\u8fde\u63a5\u5728\u8bbe\u5907\u53d8\u66f4\u7f51\u7edc\u73af\u5883\u65f6\u4ecd\u80fd\u4fdd\u6301\u53ef\u7528\u3002<\/p>\n<p>\u8981\u5728\u670d\u52a1\u5668\u4e0a\u542f\u7528 NAT\uff0c\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u7684 <code>[Interface]<\/code> \u6bb5\u4e2d\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><code>PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\r\nPostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE\r\n<\/code><\/pre>\n<p>\u5c06 <code>eth0<\/code> \u66ff\u6362\u4e3a\u4f60\u5b9e\u9645\u7684 LAN \u63a5\u53e3\u540d\u79f0\u3002<\/p>\n<p>\u4f60\u5fc5\u987b\u5728\u670d\u52a1\u5668\u4e0a\u542f\u7528 IP \u8f6c\u53d1\uff0c\u4ee5\u4fbf\u6d41\u91cf\u5728\u4e0d\u540c\u63a5\u53e3\u4e4b\u95f4\u8f6c\u53d1\u3002\u5728\u5ba2\u6237\u7aef\u4fa7\uff0c\u9700\u8981\u5728 <code>AllowedIPs<\/code> \u8bbe\u7f6e\u4e2d\u5305\u542b\u4f60\u7684 LAN \u5b50\u7f51\uff0c\u4f8b\u5982 <code>AllowedIPs = 192.168.2.0\/24, 192.168.1.0\/24<\/code>\u3002<\/p>\n<p>\u542f\u7528 NAT \u65f6\uff0c\u8981\u7279\u522b\u7559\u610f\u9632\u706b\u5899\u89c4\u5219\u3002\u53ea\u653e\u884c\u4f60\u771f\u6b63\u9700\u8981\u7684\u6d41\u91cf\uff0c\u5e76\u5c3d\u53ef\u80fd\u62e6\u622a\u5176\u4ed6\u4e00\u5207\u8bf7\u6c42\u3002\u914d\u7f6e\u4e0d\u5f53\u7684 NAT \u6216\u9632\u706b\u5899\u5f88\u53ef\u80fd\u66b4\u9732\u4f60\u7684\u7f51\u7edc\u5b89\u5168\u98ce\u9669\u3002\u56e0\u6b64\u5728\u5b8c\u6210\u914d\u7f6e\u540e\u52a1\u5fc5\u8fdb\u884c\u5b89\u5168\u6027\u5ba1\u67e5\u3002<\/p>\n<blockquote>\n<p><strong>\u6ce8\u610f\uff1a<\/strong>\u5728 WireGuard \u63a5\u53e3\u521b\u5efa\u5e76\u5206\u914d\u597d\u4e4b\u540e\uff0cNAT \u89c4\u5219\u624d\u80fd\u751f\u6548\u3002\u5982\u679c\u914d\u7f6e\u6b63\u786e\uff0c\u51fa\u7ad9 NAT\u30011:1 NAT \u4ee5\u53ca\u7aef\u53e3\u8f6c\u53d1\u90fd\u4f1a\u6309\u9884\u671f\u8fd0\u884c\u3002<\/p>\n<\/blockquote>\n<p>\u53ea\u8981\u4f9d\u636e\u4e0a\u8ff0\u6b65\u9aa4\u64cd\u4f5c\uff0c\u4f60\u5c31\u80fd\u6709\u6548\u907f\u514d\u5927\u90e8\u5206\u8fde\u901a\u6027\u95ee\u9898\uff0c\u540c\u65f6\u4fdd\u6301 VPN \u7684\u5b89\u5168\u6027\u3002<\/p>\n<div dividerstyle=\"solid\" size=\"large\" color=\"#D1D1D1\" class=\"qc-divider-wrapper\">\n<div class=\"qc-divider\" style=\"border-top-style: solid; width: 100%; border-top-color: rgb(209, 209, 209);\"><\/div>\n<\/div>\n<p>\u603b\u4e4b\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u51e0\u4e2a\u6e05\u6670\u7684\u6b65\u9aa4\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\u3002\u53ea\u8981\u6b63\u786e\u8bbe\u7f6e\u552f\u4e00\u5bc6\u94a5\u3001\u5206\u914d\u5730\u5740\uff0c\u5e76\u5408\u7406\u4f7f\u7528 <code>AllowedIPs<\/code> \u5b57\u6bb5\u8fdb\u884c\u8def\u7531\u63a7\u5236\uff0c\u5c31\u80fd\u642d\u5efa\u51fa\u5b89\u5168\u9ad8\u6548\u7684 VPN\u3002\u5982\u679c\u9047\u5230\u95ee\u9898\uff0c\u4f18\u5148\u68c0\u67e5\u9632\u706b\u5899\u8bbe\u7f6e\u3001\u5bc6\u94a5\u914d\u5bf9\u4ee5\u53ca\u5b50\u7f51\u51b2\u7a81\u7b49\u56e0\u7d20\u3002\u901a\u8fc7\u5185\u6838\u53c2\u6570\u8c03\u4f18\u548c\u76d1\u63a7\u7b49\u8fdb\u9636\u65b9\u6848\uff0c\u8fd8\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u5347\u8fde\u63a5\u7a33\u5b9a\u6027\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u8fd8\u662f\u9ad8\u7ea7\u7528\u6237\uff0c\u5728\u90e8\u7f72 WireGuard \u65f6\u90fd\u4f1a\u9047\u5230\u5404\u7c7b\u6311\u6218\uff0c\u5176\u4e2d\u5f88\u5927\u4e00\u90e8\u5206\u6e90\u4e8e\u76f8\u5173\u6587\u6863\u7684\u7b80\u7565\u3002\u9700\u8981\u66f4\u591a\u5e2e\u52a9\u65f6\uff0c\u53ef\u4ee5\u53c2\u8003\u8bf8\u5982\u201cWireGuard VPN \u5ba2\u6237\u7aef\u914d\u7f6e\u793a\u4f8b\u201d\u6216\u201cWireGuard \u670d\u52a1\u5668\u914d\u7f6e\u201d\u7b49\u6307\u5357\u3002<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898\uff08FAQ\uff09<\/h2>\n<h3>\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u8bbe\u7f6e\u4e00\u4e2a\u4e0d\u540c\u7684 IP \u5730\u5740\uff1f<\/h3>\n<p>\u53ea\u9700\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff0c\u5728 <code>[Interface]<\/code> \u6bb5\u4e2d\u6dfb\u52a0\u4f60\u9009\u62e9\u7684 IP \u5730\u5740\u5373\u53ef\u3002\u540c\u65f6\u4e3a\u6bcf\u4e2a Peer \u4f7f\u7528 AllowedIPs \u8bbe\u7f6e\uff0c\u786e\u4fdd\u7f51\u7edc\u80fd\u591f\u4e0e\u6b63\u786e\u7684\u7aef\u70b9\u914d\u5408\u5de5\u4f5c\u3002<\/p>\n<h3>\/31 \u5b50\u7f51\u63a9\u7801\u5728\u70b9\u5bf9\u70b9\u8fde\u63a5\u4e2d\u6709\u4ec0\u4e48\u4f5c\u7528\uff1f<\/h3>\n<p>\/31 \u5b50\u7f51\u63a9\u7801\u63d0\u4f9b\u4e24\u4e2a\u53ef\u7528 IP \u5730\u5740\uff0c\u4f60\u53ef\u4ee5\u4e3a\u4e24\u7aef\u5404\u5206\u914d\u4e00\u4e2a\u3002\u8fd9\u79cd\u8bbe\u7f6e\u53ef\u4ee5\u8282\u7701\u7f51\u7edc\u4e2d\u7684 IP \u8d44\u6e90\u3002\u4f60\u4ecd\u7136\u9700\u8981\u901a\u8fc7 AllowedIPs \u8bbe\u7f6e\u6765\u5b9a\u4e49\u5404\u7aef\u70b9\u53ef\u4ee5\u4f7f\u7528\u54ea\u4e9b\u5730\u5740\u3002<\/p>\n<h3>\u80fd\u5426\u4e3a\u4e00\u4e2a WireGuard \u63a5\u53e3\u5206\u914d\u591a\u4e2a IP \u5730\u5740\uff1f<\/h3>\n<p>\u53ef\u4ee5\u3002\u4f60\u53ef\u4ee5\u5728\u6bcf\u4e2a Peer \u7684 AllowedIPs \u4e2d\u52a0\u5165\u591a\u4e2a\u5730\u5740\u6216\u7f51\u6bb5\uff0c\u8fd9\u6837\u4fbf\u53ef\u4ee5\u901a\u8fc7\u540c\u4e00\u4e2a\u7aef\u70b9\u4e3a\u4e0d\u540c\u5b50\u7f51\u8f6c\u53d1\u6d41\u91cf\u3002<\/p>\n<h3>\u4e3a\u4ec0\u4e48\u7aef\u70b9\uff08Endpoint\uff09\u5728 WireGuard \u4e2d\u5f88\u91cd\u8981\uff1f<\/h3>\n<p>Endpoint \u544a\u8bc9\u7f51\u7edc\u5e94\u5c06\u52a0\u5bc6\u6570\u636e\u5305\u53d1\u9001\u5230\u54ea\u91cc\u3002\u4f60\u5fc5\u987b\u4e3a\u6bcf\u4e2a Peer \u8bbe\u7f6e\u6b63\u786e\u7684 Endpoint\u3002\u5982\u679c\u7aef\u70b9\u914d\u7f6e\u9519\u8bef\uff0c\u7f51\u7edc\u5c31\u65e0\u6cd5\u6b63\u5e38\u5efa\u7acb\u8fde\u63a5\u3002AllowedIPs \u8bbe\u7f6e\u540c\u6837\u4f1a\u5f71\u54cd\u6d41\u91cf\u88ab\u8def\u7531\u5230\u54ea\u4e2a\u7aef\u70b9\u3002<\/p>\n<h3>\u5982\u4f55\u6392\u67e5 WireGuard \u7f51\u7edc\u4e2d\u7684\u8fde\u901a\u6027\u95ee\u9898\uff1f<\/h3>\n<p>\u9996\u5148\u68c0\u67e5\u7aef\u70b9\u5730\u5740\u662f\u5426\u6b63\u786e\uff1b\u5176\u6b21\u786e\u4fdd AllowedIPs \u8bbe\u7f6e\u7b26\u5408\u7f51\u7edc\u5b9e\u9645\u9700\u6c42\u3002\u4f7f\u7528 <code>wg<\/code> \u547d\u4ee4\u67e5\u770b\u7aef\u70b9\u662f\u5426\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u3002\u7136\u540e\u5ba1\u67e5\u8def\u7531\u4e0e\u9632\u706b\u5899\u89c4\u5219\uff0c\u5e76\u4fee\u590d\u5176\u4e2d\u7684\u9519\u8bef\u3002<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u5728 Interface \u6bb5\u4e2d\u6307\u5b9a\u6240\u9700\u5730\u5740\uff0c\u4e3a WireGuard \u63a5\u53e3\u8bbe\u7f6e\u4e00\u4e2a\u4e0d\u540c\u7684 IP \u5730\u5740\u3002\u5bf9\u4e8e\u4e24\u53f0\u4e3b\u673a\u4e4b\u95f4\u7684\u70b9\u5bf9\u70b9\u8fde\u63a5\uff0c\u5efa\u8bae\u4f7f\u7528 \/31 \u5b50\u7f51\u63a9\u7801\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u907f\u514d\u5728\u90e8\u7f72 VPN \u7aef\u70b9\uff08\u4f8b\u5982\u4f7f\u7528\u65e5\u672c\u670d\u52a1\u5668\u79df\u7528\uff09\u65f6\u6d6a\u8d39 IP \u5730\u5740\u3002\u53ea\u8981\u914d\u7f6e\u6b63\u786e\uff0c\u5c31\u80fd\u540c\u65f6\u4fdd\u8bc1\u8fde\u901a\u6027\u548c\u8def\u7531\u884c\u4e3a\u7b26\u5408\u9884\u671f\u3002\u4fee\u6539\u540e\u52a1\u5fc5\u68c0\u67e5\uff0c\u786e\u4fdd\u7f51\u7edc\u4fdd\u6301\u5b89\u5168\u4e14\u7a33\u5b9a\u53ef\u9760\u3002 \u5173\u952e\u8981\u70b9 \u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u5728 [Interface] \u6bb5\u4e2d\u8bbe\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\u3002\u4f7f\u7528 CIDR \u8868\u793a\u6cd5\u4ee5\u4fbf\u6e05\u6670\u660e\u4e86\u3002 \u70b9\u5bf9\u70b9\u8fde\u63a5\u4e2d\u4f7f\u7528 \/31 \u5b50\u7f51\u4ee5\u8282\u7701 IP \u5730\u5740\uff0c\u8fd9\u6837\u6070\u597d\u63d0\u4f9b\u4e24\u4e2a\u53ef\u7528\u5730\u5740\u3002 \u901a\u8fc7\u4e3a\u5404\u4e2a Peer \u914d\u7f6e AllowedIPs\uff0c\u53ef\u4ee5\u4e3a\u63a5\u53e3\u5206\u914d\u591a\u4e2a IP \u5730\u5740\uff0c\u4ece\u800c\u8ba9 VPN \u4e3a\u4e0d\u540c\u7f51\u7edc\u8f6c\u53d1\u6d41\u91cf\u3002 \u6bcf\u4e2a WireGuard \u63a5\u53e3\u90fd\u5e94\u4f7f\u7528\u72ec\u7acb\u7684\u5bc6\u94a5\u5bf9\u4ee5\u4fdd\u8bc1\u5b89\u5168\u3002\u52a1\u5fc5\u4fdd\u62a4\u597d\u79c1\u94a5\u5e76\u5b9a\u671f\u5ba1\u8ba1\u914d\u7f6e\u3002 \u5b9a\u671f\u68c0\u67e5 IP \u8bbe\u7f6e\u548c\u9632\u706b\u5899\u89c4\u5219\u4ee5\u6392\u67e5\u8fde\u63a5\u95ee\u9898\u3002\u53ef\u4f7f\u7528 wg \u4e0e ip route \u7b49\u547d\u4ee4\u8fdb\u884c\u8bca\u65ad\u3002 \u5728 WireGuard \u63a5\u53e3\u4e0a\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740 \u7f16\u8f91 [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":11,"featured_media":30380,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[76],"tags":[],"class_list":["post-30383","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740<\/title>\n<meta name=\"description\" content=\"\u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u63a5\u53e3\u4e0a\u8bbe\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\uff0c\u7528\u4e8e\u70b9\u5bf9\u70b9\u8fde\u63a5\u3002\u6309\u7167\u6e05\u6670\u6b65\u9aa4\u64cd\u4f5c\uff0c\u786e\u4fdd\u8def\u7531\u5b89\u5168\u3001\u8fde\u63a5\u53ef\u9760\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/\" \/>\n<meta property=\"og:site_name\" content=\"Varidata Limited\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-25T07:37:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-25T07:49:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"681\" \/>\n\t<meta property=\"og:image:height\" content=\"371\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/\"},\"author\":\"Varidata\",\"headline\":\"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\",\"datePublished\":\"2026-02-25T07:37:58+00:00\",\"dateModified\":\"2026-02-25T07:49:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/\"},\"wordCount\":179,\"publisher\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg\",\"articleSection\":[\"Varidata \u5b98\u65b9\u535a\u5ba2\"],\"inLanguage\":\"zh-SC\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/\",\"url\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/\",\"name\":\"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\",\"isPartOf\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg\",\"datePublished\":\"2026-02-25T07:37:58+00:00\",\"dateModified\":\"2026-02-25T07:49:29+00:00\",\"description\":\"\u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u63a5\u53e3\u4e0a\u8bbe\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\uff0c\u7528\u4e8e\u70b9\u5bf9\u70b9\u8fde\u63a5\u3002\u6309\u7167\u6e05\u6670\u6b65\u9aa4\u64cd\u4f5c\uff0c\u786e\u4fdd\u8def\u7531\u5b89\u5168\u3001\u8fde\u63a5\u53ef\u9760\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#breadcrumb\"},\"inLanguage\":\"zh-SC\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-SC\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#primaryimage\",\"url\":\"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg\",\"contentUrl\":\"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg\",\"width\":681,\"height\":371,\"caption\":\"WireGuard \u63a5\u53e3 IP \u5730\u5740\u914d\u7f6e\u793a\u610f\u56fe\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.varidata.com\/zh-cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#website\",\"url\":\"https:\/\/www.varidata.com\/zh-cn\/\",\"name\":\"Varidata Limited\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.varidata.com\/zh-cn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-SC\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#organization\",\"name\":\"Varidata\",\"url\":\"https:\/\/www.varidata.com\/zh-cn\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-SC\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.varidata.com\/wp-content\/uploads\/2021\/09\/varidata_logo_white_-748x480_hor_web-1.png\",\"contentUrl\":\"https:\/\/www.varidata.com\/wp-content\/uploads\/2021\/09\/varidata_logo_white_-748x480_hor_web-1.png\",\"width\":248,\"height\":94,\"caption\":\"Varidata\"},\"image\":{\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#\/schema\/person\/afeb2203681f7919a757a02690f38abd\",\"name\":\"Daisy Yu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-SC\",\"@id\":\"https:\/\/www.varidata.com\/zh-cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/38db59364245f7a04c07a2888056fc3db37247c1af72457af92d8001da594989?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/38db59364245f7a04c07a2888056fc3db37247c1af72457af92d8001da594989?s=96&d=mm&r=g\",\"caption\":\"Daisy Yu\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740","description":"\u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u63a5\u53e3\u4e0a\u8bbe\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\uff0c\u7528\u4e8e\u70b9\u5bf9\u70b9\u8fde\u63a5\u3002\u6309\u7167\u6e05\u6670\u6b65\u9aa4\u64cd\u4f5c\uff0c\u786e\u4fdd\u8def\u7531\u5b89\u5168\u3001\u8fde\u63a5\u53ef\u9760\u3002","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:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740","og_url":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/","og_site_name":"Varidata Limited","article_published_time":"2026-02-25T07:37:58+00:00","article_modified_time":"2026-02-25T07:49:29+00:00","og_image":[{"width":681,"height":371,"url":"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg","type":"image\/jpeg"}],"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#article","isPartOf":{"@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/"},"author":"Varidata","headline":"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740","datePublished":"2026-02-25T07:37:58+00:00","dateModified":"2026-02-25T07:49:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/"},"wordCount":179,"publisher":{"@id":"https:\/\/www.varidata.com\/zh-cn\/#organization"},"image":{"@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#primaryimage"},"thumbnailUrl":"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg","articleSection":["Varidata \u5b98\u65b9\u535a\u5ba2"],"inLanguage":"zh-SC"},{"@type":"WebPage","@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/","url":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/","name":"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740","isPartOf":{"@id":"https:\/\/www.varidata.com\/zh-cn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#primaryimage"},"image":{"@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#primaryimage"},"thumbnailUrl":"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg","datePublished":"2026-02-25T07:37:58+00:00","dateModified":"2026-02-25T07:49:29+00:00","description":"\u901a\u8fc7\u7f16\u8f91 WireGuard \u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u63a5\u53e3\u4e0a\u8bbe\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740\uff0c\u7528\u4e8e\u70b9\u5bf9\u70b9\u8fde\u63a5\u3002\u6309\u7167\u6e05\u6670\u6b65\u9aa4\u64cd\u4f5c\uff0c\u786e\u4fdd\u8def\u7531\u5b89\u5168\u3001\u8fde\u63a5\u53ef\u9760\u3002","breadcrumb":{"@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#breadcrumb"},"inLanguage":"zh-SC","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/"]}]},{"@type":"ImageObject","inLanguage":"zh-SC","@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#primaryimage","url":"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg","contentUrl":"https:\/\/www.varidata.com\/wp-content\/uploads\/2026\/02\/2026-02-25-153921.jpg","width":681,"height":371,"caption":"WireGuard \u63a5\u53e3 IP \u5730\u5740\u914d\u7f6e\u793a\u610f\u56fe"},{"@type":"BreadcrumbList","@id":"https:\/\/www.varidata.com\/zh-cn\/blog\/how-to-configure-a-different-ip-address-for-your-wireguard\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.varidata.com\/zh-cn\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u4e3a WireGuard \u63a5\u53e3\u914d\u7f6e\u4e0d\u540c\u7684 IP \u5730\u5740"}]},{"@type":"WebSite","@id":"https:\/\/www.varidata.com\/zh-cn\/#website","url":"https:\/\/www.varidata.com\/zh-cn\/","name":"Varidata Limited","description":"","publisher":{"@id":"https:\/\/www.varidata.com\/zh-cn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.varidata.com\/zh-cn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-SC"},{"@type":"Organization","@id":"https:\/\/www.varidata.com\/zh-cn\/#organization","name":"Varidata","url":"https:\/\/www.varidata.com\/zh-cn\/","logo":{"@type":"ImageObject","inLanguage":"zh-SC","@id":"https:\/\/www.varidata.com\/zh-cn\/#\/schema\/logo\/image\/","url":"https:\/\/www.varidata.com\/wp-content\/uploads\/2021\/09\/varidata_logo_white_-748x480_hor_web-1.png","contentUrl":"https:\/\/www.varidata.com\/wp-content\/uploads\/2021\/09\/varidata_logo_white_-748x480_hor_web-1.png","width":248,"height":94,"caption":"Varidata"},"image":{"@id":"https:\/\/www.varidata.com\/zh-cn\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.varidata.com\/zh-cn\/#\/schema\/person\/afeb2203681f7919a757a02690f38abd","name":"Daisy Yu","image":{"@type":"ImageObject","inLanguage":"zh-SC","@id":"https:\/\/www.varidata.com\/zh-cn\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/38db59364245f7a04c07a2888056fc3db37247c1af72457af92d8001da594989?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/38db59364245f7a04c07a2888056fc3db37247c1af72457af92d8001da594989?s=96&d=mm&r=g","caption":"Daisy Yu"}}]}},"_links":{"self":[{"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/posts\/30383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/comments?post=30383"}],"version-history":[{"count":2,"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/posts\/30383\/revisions"}],"predecessor-version":[{"id":30388,"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/posts\/30383\/revisions\/30388"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/media\/30380"}],"wp:attachment":[{"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/media?parent=30383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/categories?post=30383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.varidata.com\/zh-cn\/wp-json\/wp\/v2\/tags?post=30383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}