{"id":5262,"date":"2021-12-18T18:06:51","date_gmt":"2021-12-19T02:06:51","guid":{"rendered":"https:\/\/www.xh86.me\/?p=5262"},"modified":"2021-12-18T18:06:51","modified_gmt":"2021-12-19T02:06:51","slug":"%e8%87%aa%e5%bb%bagre%e9%9a%a7%e9%81%93%e4%bf%ae%e6%94%b9%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%9b%9e%e7%a8%8b%e7%ba%bf%e8%b7%af","status":"publish","type":"post","link":"https:\/\/www.xh86.me\/?p=5262","title":{"rendered":"\u81ea\u5efaGRE\u96a7\u9053\u4fee\u6539\u670d\u52a1\u5668\u56de\u7a0b\u7ebf\u8def"},"content":{"rendered":"<p><a class=\"link\" href=\"https:\/\/www.olink.cloud\/clients\/aff.php?aff=167\" target=\"_blank\" rel=\"noopener\">Olink cloud<\/a>\u4e4b\u524d\u5f00\u59cb\u9500\u552e\u4e86\u4e00\u79cd\u5f88\u6709\u610f\u601d\u7684\u4ea7\u54c1\u00a0<a class=\"link\" href=\"https:\/\/www.olink.cloud\/clients\/store\/transit-over-gre\" target=\"_blank\" rel=\"noopener\">Transit Over GRE<\/a>\uff0c\u53ef\u4ee5\u5728\u4f60\u7684\u670d\u52a1\u5668\u548c\u5546\u5bb6\u7684\u670d\u52a1\u5668\u95f4\u5efa\u7acb\u4e00\u4e2aGRE\u96a7\u9053\uff0c\u7136\u540e\u8ba9\u76ee\u7684\u5730\u5740\u4e3a\u5927\u9646\u7684\u6570\u636e\u5305\u5168\u90e8\u7ecf\u8fc7\u96a7\u9053\u4f20\u8f93\uff0c\u5b9e\u73b0\u53bb\u7a0b\u8d70\u670d\u52a1\u5668\u81ea\u5df1\u7684\u7ebf\u8def\uff0c\u800c\u56de\u7a0b\u4fee\u6539\u6210\u8054\u901a\u7684as10099~as9929\u4ee5\u8fbe\u5230\u4f18\u5316\u56de\u7a0b\u7ebf\u8def\u7684\u6548\u679c\u3002\u611f\u89c9\u8fd9\u4e2a\u633a\u6709\u610f\u601d\u7684\uff0c\u7b2c\u4e00\u6b21\u770b\u89c1\u6709\u5546\u5bb6\u5356\u8fd9\u6837\u7684\u4ea7\u54c1\uff0c\u6240\u4ee5\u81ea\u5df1\u4e5f\u60f3\u7740\u5c1d\u8bd5\u4e00\u4e0b\u8fd9\u4e2a\u6280\u672f\u3002\u8981\u60f3\u5728\u4fee\u6539\u4e86\u56de\u7a0b\u540e\u4f9d\u65e7\u53ef\u4ee5\u6b63\u5e38\u7684\u5efa\u7acb\u8fde\u63a5\uff0c\u5176\u4e2d\u6709\u4e00\u70b9\u975e\u5e38\u91cd\u8981\u2014\u2014<strong>\u96a7\u9053\u53e6\u4e00\u7aef\u7684\u673a\u5668\u5fc5\u987b\u652f\u6301\u4f2a\u9020\u6e90ip\uff08ip spoofing\uff09<\/strong>\uff0c\u53ea\u6709\u8fd9\u6837\u624d\u80fd\u8ba9\u5230\u8fbe\u5ba2\u6237\u7aef\u7684\u6570\u636e\u5305\u7684\u6e90ip\u662f\u4e4b\u524d\u8bf7\u6c42\u7684\u76ee\u7684ip\u3002<\/p>\n<p>\u6b63\u5de7\uff0c\u6211\u53d1\u73b0justhost\u7684vps\u662f\u53ef\u4ee5\u4f2a\u9020ip\u7684\uff08\u53ea\u8981\u4e0d\u8981\u7528\u4e8e\u653b\u51fb\uff0c\u5e94\u8be5\u95ee\u9898\u4e0d\u5927\uff1f\uff09\uff0c\u6240\u4ee5\u5f00\u59cb\u5c1d\u8bd5\u81ea\u5df1\u6574\u4e00\u4e2aTransit Over GRE\u3002<\/p>\n<blockquote><p>\u540e\u6765\u8f6c\u4e86\u4e00\u5708\u53d1\u73b0\u57fa\u672c\u6240\u6709\u7684VPS\u7684\u673a\u623f\u90fd\u505a\u4e86\u4e25\u683c\u7684urpf\uff08\u65e0\u6cd5\u4f2a\u9020\u6e90ip\u4e86\uff09\uff0c\u66f4\u52a0\u627e\u4e0d\u5230\u7ebf\u8def\u4f18\u79c0\u540c\u65f6\u8fd8\u652f\u6301ip spoofing\u7684\u673a\u5668\u4e86\uff0c\u6bd5\u7adf\u4f2a\u9020ip\u6781\u6613\u88ab\u6ee5\u7528\uff0c\u6240\u4ee5\u8fd9\u79cd\u64cd\u4f5c\u5bf9\u4e8e\u4e2a\u4eba\u6765\u8bf4\u8fd8\u662f\u633a\u96be\u771f\u6b63\u7528\u6765\u4f18\u5316\u56de\u7a0b\u7684\uff0c\u53ea\u80fd\u5f53\u4f5c\u662f\u6298\u817e\u5e76\u5b66\u4e60\u4e00\u4e0b\u4e86\u3002\uff08\u8c01\u8981\u662f\u53d1\u73b0\u6709\u7ebf\u8def\u4f18\u8d28\u8fd8\u652f\u6301\u4f2a\u9020\u7684vps\uff0c\u8bf7\u544a\u8bc9\u6211\uff09<br \/>\n\u5982\u679c\u60f3\u8981\u4f18\u5316\u81ea\u5df1\u7684\u670d\u52a1\u5668\u7684\u56de\u7a0b\u8fd8\u662f\u8001\u5b9e\u4e70\u5546\u5bb6\u63d0\u4f9b\u7684\u4ea7\u54c1\u5427\u3002<br \/>\n<a class=\"link\" href=\"https:\/\/www.olink.cloud\/clients\/cart.php?a=add&amp;pid=17&amp;aff.php?aff=167\" target=\"_blank\" rel=\"noopener\">Olink\u7684\u5fb7\u56fd9929 GRE<\/a><br \/>\n<a class=\"link\" href=\"https:\/\/www.olink.cloud\/clients\/cart.php?a=add&amp;pid=18&amp;aff.php?aff=167\" target=\"_blank\" rel=\"noopener\">Olink\u7684\u7f8e\u56fd9929 GRE<\/a><\/p><\/blockquote>\n<p><em>\u53e6\u5916\uff0c\u60f3\u8bd5\u8bd5\u96a7\u9053\u7684\u53ef\u4ee5\u7559\u8a00\u544a\u8bc9\u6211\uff0c\u6211\u4e70\u7684\u96a7\u9053\u5403\u7070\u4e2d haha<\/em><\/p>\n<h2 id=\"\u5efa\u7acbgre\u96a7\u9053\">\u5efa\u7acbGRE\u96a7\u9053<\/h2>\n<p>\u5173\u4e8eGRE\u96a7\u9053\u7684\u4ecb\u7ecd\u53ef\u4ee5\u67e5\u770b<a class=\"link\" href=\"https:\/\/www.cloudflare.com\/zh-cn\/learning\/network-layer\/what-is-gre-tunneling\/\" target=\"_blank\" rel=\"noopener\">\u6b64\u6587<\/a><\/p>\n<blockquote><p><strong>\u4ec0\u4e48\u662fGRE<\/strong><\/p>\n<p>\u901a\u7528\u8def\u7531\u5c01\u88c5\u6216 GRE \u662f\u4e00\u79cd\u534f\u8bae\uff0c\u7528\u4e8e\u5c06\u4f7f\u7528\u4e00\u4e2a<a class=\"link\" href=\"https:\/\/www.cloudflare.com\/zh-cn\/learning\/network-layer\/what-is-routing\" target=\"_blank\" rel=\"noopener\">\u8def\u7531<\/a>\u534f\u8bae\u7684\u6570\u636e\u5305\u5c01\u88c5\u5728\u53e6\u4e00\u534f\u8bae\u7684\u6570\u636e\u5305\u4e2d\u3002\u201c\u5c01\u88c5\u201d\u662f\u6307\u5c06\u4e00\u4e2a\u6570\u636e\u5305\u5305\u88c5\u5728\u53e6\u4e00\u4e2a\u6570\u636e\u5305\u4e2d\uff0c\u5c31\u50cf\u5c06\u4e00\u4e2a\u76d2\u5b50\u653e\u5728\u53e6\u4e00\u4e2a\u76d2\u5b50\u4e2d\u4e00\u6837\u3002GRE \u662f\u5728\u7f51\u7edc\u4e0a\u5efa\u7acb\u76f4\u63a5\u70b9\u5bf9\u70b9\u8fde\u63a5\u7684\u4e00\u79cd\u65b9\u6cd5\uff0c\u76ee\u7684\u662f\u7b80\u5316\u5355\u72ec\u7f51\u7edc\u4e4b\u95f4\u7684\u8fde\u63a5\u3002\u5b83\u9002\u7528\u4e8e\u5404\u79cd<a class=\"link\" href=\"https:\/\/www.cloudflare.com\/zh-cn\/learning\/network-layer\/what-is-the-network-layer\" target=\"_blank\" rel=\"noopener\">\u7f51\u7edc\u5c42<\/a>\u534f\u8bae\u3002<\/p>\n<p>GRE \u5141\u8bb8\u4f7f\u7528\u7f51\u7edc\u901a\u5e38\u4e0d\u652f\u6301\u7684\u534f\u8bae\uff0c\u56e0\u4e3a\u6570\u636e\u5305\u88ab\u5305\u88c5\u5728\u5176\u4ed6\u786e\u5b9e\u4f7f\u7528\u53d7\u652f\u6301\u534f\u8bae\u7684\u6570\u636e\u5305\u4e2d\u3002\u8981\u4e86\u89e3\u5176\u5de5\u4f5c\u539f\u7406\uff0c\u8bf7\u60f3\u50cf\u4e00\u4e0b\u6c7d\u8f66\u548c\u6e21\u8f6e\u4e4b\u95f4\u7684\u533a\u522b\u3002\u6c7d\u8f66\u5728\u9646\u5730\u4e0a\u884c\u9a76\uff0c\u800c\u6e21\u8f6e\u5728\u6c34\u4e0a\u884c\u9a76\u3002\u6c7d\u8f66\u901a\u5e38\u4e0d\u80fd\u5728\u6c34\u4e0a\u884c\u9a76\uff0c\u4f46\u662f\u53ef\u4ee5\u5c06\u6c7d\u8f66\u88c5\u8f7d\u5230\u6e21\u8f6e\u4e0a\u3002<\/p><\/blockquote>\n<p>\u6211\u53c2\u8003hetzner\u7684\u6559\u5b66\u6587\u6863<a class=\"link\" href=\"https:\/\/community.hetzner.com\/tutorials\/linux-setup-gre-tunnel\" target=\"_blank\" rel=\"noopener\">Linux setup GRE tunnel<\/a>\u6765\u521b\u5efagre\u96a7\u9053\uff0c\u5176\u4e2d\u4f7f\u7528\u4e86\u4e24\u53f0\u670d\u52a1\u5668\uff0c\u4f5c\u4e3aGRE\u96a7\u9053\u670d\u52a1\u7aef\u7684Justhost\u7684\u670d\u52a1\u5668\u4ee5\u53ca\u4f5c\u4e3a\u5ba2\u6237\u7aef\u7684Contabo\u3002<\/p>\n<p>\u4e3a\u4e86\u4fbf\u4e8e\u63cf\u8ff0\uff0c\u4e0b\u6587\u5c06 Justhost\u7684\u670d\u52a1\u5668\u79f0\u4e3a_GRE\u670d\u52a1\u7aef\u670d\u52a1\u5668_\uff0cContabo\u7684\u670d\u52a1\u5668\u79f0\u4e3a_GRE\u5ba2\u6237\u7aef\u670d\u52a1\u5668_\u3002<\/p>\n<h3 id=\"\u52a0\u8f7d\u5185\u6838\u6a21\u5757\">\u52a0\u8f7d\u5185\u6838\u6a21\u5757<\/h3>\n<p>\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u7aef\u90fd\u8981\u52a0\u8f7d\u6a21\u5757\u3002<\/p>\n<pre tabindex=\"0\"><code>sudo modprobe ip_gre\r\nlsmod | grep gre\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327134726.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327134726.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327134726.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20210327134724858\" \/><\/div><\/a><figcaption>image-20210327134724858<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u5982\u679c\u663e\u793a\u548c\u4e0a\u9762\u4e00\u6837\u5c31\u8868\u793a\u4fee\u6539\u6210\u529f\u4e86\uff0c\u4e4b\u540e\u4e3a\u4e86\u5c06\u6570\u636e\u5305\u8f6c\u53d1\u5230\u96a7\u9053\u91cc\u9762\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5iproute2\u548ciptables\uff0c\u73b0\u5728\u7684\u7cfb\u7edf\u4e00\u822c\u90fd\u81ea\u5e26\u4e86\u8fd9\u4e24\u4e2a\u5de5\u5177\u3002<\/p>\n<h3 id=\"\u914d\u7f6e\u96a7\u9053\">\u914d\u7f6e\u96a7\u9053<\/h3>\n<p>\u5728\u96a7\u9053\u670d\u52a1\u7aef\u5f00\u542fip\u5305\u8f6c\u53d1\u3002<\/p>\n<pre tabindex=\"0\"><code>sudo echo 'net.ipv4.ip_forward=1' &amp;gt;&amp;gt; \/etc\/sysctl.conf\r\nsudo sysctl -p\r\n<\/code><\/pre>\n<p>\u7136\u540e\u5148\u5728\u96a7\u9053\u670d\u52a1\u7aef\u670d\u52a1\u5668\u521b\u5efa\u4e00\u4e2a\u96a7\u9053\u3002\uff08\u53bb\u6389\u65b9\u62ec\u53f7\uff09<\/p>\n<pre tabindex=\"0\"><code>#\u521b\u5efa\u4e00\u4e2a\u96a7\u9053\r\nsudo ip tunnel add gre1 mode gre local [\u670d\u52a1\u7aef\u7684ip] remote [\u5ba2\u6237\u7aef\u7684ip] ttl 255\r\n#\u6dfb\u52a0\u4e00\u4e2aip \u4e0e\u865a\u62df\u7f51\u5361 \uff08gre\u670d\u52a1\u7aefip\u8bbe\u7f6e\u4e3a 10.0.0.1\uff09\r\nsudo ip addr add 10.0.0.1\/30 dev gre1 #\u63a9\u7801\u4e5f\u53ef\u4ee5\u9002\u5f53\u5927\u4e00\u4e9b\uff0c\u5982\u679c\u8981\u8fde\u5230\u96a7\u9053\u7684\u8bbe\u5907\u6bd4\u8f83\u591a\u7684\u8bdd\r\n#\u542f\u52a8\u865a\u62df\u7f51\u5361\r\nsudo ip link set gre1 up\r\n<\/code><\/pre>\n<p>\u4e4b\u540e\u4fbf\u53ef\u4ee5\u770b\u89c1\u8fd9\u4e2a\u865a\u62df\u7f51\u5361\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327135955.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327135955.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327135955.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\u96a7\u9053\" \/><\/div><\/a><figcaption>\u96a7\u9053<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u63a5\u7740\u5728\u96a7\u9053\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u4e0a\u4e5f\u521b\u5efa\u4e00\u4e2a\u96a7\u9053\uff0c\u64cd\u4f5c\u57fa\u672c\u76f8\u540c\uff0c\u5c31\u662f\u6e90ip\u548c\u76ee\u7684ip\u5bf9\u6362\u4e00\u4e0b\uff0c\u7136\u540e\u672c\u5730\u5206\u914d\u53e6\u4e00\u4e2aip\u3002<\/p>\n<pre tabindex=\"0\"><code>sudo ip tunnel add gre1 mode gre local 203.0.113.1 remote 198.51.100.1 ttl 255\r\nsudo ip addr add 10.0.0.2\/30 dev gre1\r\nsudo ip link set gre1 up\r\n<\/code><\/pre>\n<p>\u73b0\u5728\u5ba2\u6237\u7aef\u4e5f\u6210\u529f\u542f\u52a8\u4e86gre\u96a7\u9053\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327140414.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327140414.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327140414.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\u5ba2\u6237\u7aefgre\" \/><\/div><\/a><figcaption>\u5ba2\u6237\u7aefgre<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u6b64\u65f6\u4e24\u53f0\u670d\u52a1\u5668\u5df2\u7ecf\u53ef\u4ee5\u901a\u8fc7\u96a7\u9053\u76f4\u63a5\u8fde\u63a5\u4e86\uff0c\u5728\u5ba2\u6237\u7aef\u4e0a\u5c1d\u8bd5\u4f7f\u7528\u00a0<code>ping 10.0.0.1<\/code><\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327140525.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327140525.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327140525.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" \/><\/div><\/a><\/figure>\n<p>&nbsp;<\/p>\n<p><em>GRE\u5c5e\u4e8e\u4e09\u5c42(\u7f51\u7edc\u5c42)\u96a7\u9053\u5c01\u88c5\uff0c\u6570\u636e\u90fd\u4f1a\u88ab\u5c01\u88c5\u5728\u91cc\u9762\u4f20\u8f93\uff0c\u96a7\u9053\u5e76\u4e0d\u4f1a\u5f71\u54cd\u6570\u636e\u7684\u52a0\u5bc6\u7b49\u5c5e\u6027\u3002<\/em><\/p>\n<h3 id=\"\u4fee\u6539\u8def\u7531\u8868\">\u4fee\u6539\u8def\u7531\u8868<\/h3>\n<p>\u5efa\u7acb\u96a7\u9053\u4e4b\u540e\u6211\u4eec\u53ef\u4ee5\u4fee\u6539\u8def\u7531\u8868\uff0c\u5728\u5ba2\u6237\u7aef\u4e0a\u6267\u884c\u4e0b\u5217\u547d\u4ee4\uff0c\u76f8\u5f53\u4e8e\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3aGRE\u7684\u8def\u7531\u8868\uff0c\u4e4b\u540e\u6e90\u5730\u5740\u4e3a 10.0.0.0\/30 \u7684\u6570\u636e\u5305\u90fd\u4f1a\u4ea4\u7531 GRE \u8868\u5904\u7406\uff08\u7b2c\u4e8c\u884c\u5176\u5b9e\u5e76\u975e\u5fc5\u987b\uff0c\u5982\u679c\u662f\u60f3\u4fee\u7a3f\u670d\u52a1\u5668\u5230\u5927\u9646\u7684\u56de\u7a0b\uff0c10.0.0.0\/30 \u5e94\u8be5\u66ff\u6362\u4e3a\u5927\u9646\u7684 CIDR\u5730\u5740\u5757\uff09\u3002<\/p>\n<pre tabindex=\"0\"><code>#\u7b2c\u4e00\u884c\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u521b\u5efa\u4e00\u4e2a\u6301\u4e45\u5316\u7684\u8def\u7531\u8868\r\nsudo echo '100 GRE' &amp;gt;&amp;gt; \/etc\/iproute2\/rt_tables\r\n#\u8bbe\u7f6eGRE\u8868\u7684\u9ed8\u8ba4\u7f51\u5173\u4e3a 10.0.0.1 \u5373justhost\u7684\u90a3\u53f0\u670d\u52a1\u5668\r\n#\u5982\u679c\u76ee\u7684\u662f GRE \u96a7\u9053\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u8bbe\u7f6e\u6b64\u8868\u9ed8\u8ba4\u7f51\u5173\u662f 10.0.0.1,\u4f46\u662f\u6211\u4eec\u60f3\u8981\u4fee\u6539\u56de\u7a0b\uff0c\u6240\u4ee5\u64cd\u4f5c\u6709\u4e00\u4e9b\u4e0d\u540c\uff0c\u4e0d\u8fdb\u884c\u4e0b\u9762\u7684\u64cd\u4f5c\u3002\r\n#sudo ip rule add from 10.0.0.0\/24 table GRE\r\n#sudo ip route add default via 10.0.0.1 table GRE\r\n\r\n#\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u7684\u76ee\u7684\u662f\u4fee\u6539\u56de\u7a0b\uff0c\u6240\u4ee5\u8ba9\u6240\u6709\u7684\u6570\u636e\u90fd\u8fdb\u5165 GRE \u8868\u4e2d\u8fdb\u884c\u5339\u914d\r\nsudo ip rule add from all table GRE\r\n<\/code><\/pre>\n<h3 id=\"\u8def\u7531\u6d4b\u8bd5\">\u8def\u7531\u6d4b\u8bd5<\/h3>\n<p>iproute2\u7684\u5b66\u4e60\u53ef\u4ee5\u53c2\u8003<a class=\"link\" href=\"https:\/\/www.cnblogs.com\/wanstack\/p\/7728785.html\" target=\"_blank\" rel=\"noopener\">\u6b64\u6587<\/a><\/p>\n<p>\u4e4b\u540e\u6211\u4eec\u53ef\u4ee5\u6d4b\u8bd5\u4e00\u4e0b\uff0cGRE\u96a7\u9053\u670d\u52a1\u7aef\u662f\u5426\u53ef\u4ee5\u5e2e\u6211\u4eec\u8f6c\u53d1\u6570\u636e\u5305\uff0c\u6211\u5728\u7b2c\u4e09\u53f0\u670d\u52a1\u5668\u4e0a\u4f7f\u7528<code>tcpdump icmp<\/code>\u00a0\u76d1\u542cicmp\u7684\u6570\u636e\u5305\uff0c\u7136\u540e\u5c06\u7b2c\u4e09\u53f0\u670d\u52a1\u5668\u7684\u5730\u5740\u52a0\u5165GRE\u8868\u4e2d\uff0c\u5047\u8bbe\u7b2c\u4e09\u53f0\u670d\u52a1\u5668\u5730\u5740\u4e3a 90.1.225.1\uff0c\u90a3\u4e48\u5728GRE\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u4e0a\u6dfb\u52a0\u4e00\u6761\u8def\u7531\u89c4\u5219<\/p>\n<pre tabindex=\"0\"><code>#\u5411GRE\u4e2d\u6dfb\u52a0\u8def\u7531\u89c4\u5219\r\n#\u76ee\u7684ip\u4e3a 90.1.225.1 \u7684\u6570\u636e\u5305\u4ea4\u7531\u8def\u7531\u8868 GRE\u5904\u7406\r\nsudo ip route add 96.9.225.181 via 10.0.0.1 table GRE  \r\n#\u4e4b\u540e\u6570\u636e\u5305\u4f1a\u4f9d\u636e GRE \u8868\u7684\u89c4\u5219\uff0c\u4ea4\u7531\u7f51\u5173 10.0.0.1 (\u96a7\u9053\u670d\u52a1\u7aef)\u5904\u7406\r\n#\u67e5\u770b\u8def\u7531\u8868\u5185\u5bb9\r\nip route show table GRE\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327143523.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327143523.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327143523.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" \/><\/div><\/a><\/figure>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327205853.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327205853.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327205853.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"table\" \/><\/div><\/a><figcaption>table<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u4e4b\u540e\u518d\u5728GRE\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u4e0aping\u8fd9\u4e2aip\uff0c\u5e76\u5728\u670d\u52a1\u7aef\u6293\u5305\uff0c\u53ef\u4ee5\u770b\u5230\u6570\u636e\u5305\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327144914.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327144914.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327144914.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" \/><\/div><\/a><\/figure>\n<p>&nbsp;<\/p>\n<p>\u4e0d\u8fc7\uff0c\u5728\u88abping\u7684\u673a\u5668\u4e0a\u6293\u5305\u8fd8\u770b\u4e0d\u89c1\u6570\u636e\u5305\uff0c\u800cGRE\u670d\u52a1\u7aef\u4e0a\u770b\u5230\u7684\u6570\u636e\u5305\u6e90ip\u662f10.0.0.2\uff0c\u56e0\u4e3a\u6211\u4eec\u8fd8\u6ca1\u6709\u5bf9 10.0.0.2 \u505anat\u8f6c\u6362\uff0c\u8fd9\u4e2a\u6570\u636e\u5305\u662f\u53d1\u4e0d\u51fa\u53bb\u7684\uff0c\u6211\u4eec\u9700\u8981\u5728GRE\u670d\u52a1\u7aef\u670d\u52a1\u5668\u4e0a\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4,\u6765\u5141\u8bb8GRE\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u53ef\u4ee5<strong>\u4e3b\u52a8\u901a\u8fc7<\/strong>GRE\u96a7\u9053\u8fdb\u884c\u8fde\u63a5\u3002<\/p>\n<p><code>iptables -t nat -A POSTROUTING -s 10.0.0.0\/24 ! -o gre+ -j SNAT --to-source [gre\u670d\u52a1\u7aefip]<\/code><\/p>\n<p>\u4e4b\u540e\u518d\u6b21\u5c1d\u8bd5 ping \u7b2c\u4e09\u4e2a\u670d\u52a1\u5668\uff0c\u53d1\u73b0\u6b64\u65f6\u6709\u80fd\u5f97\u5230\u56de\u5e94\u4e86\uff0c\u800c\u5728\u7b2c\u4e09\u65b9\u670d\u52a1\u5668\u4e0a\u7684\u6293\u5305\u80fd\u770b\u89c1 echo request\u8bf7\u6c42\u7684ip\u662fjusthost\u7684ip\u3002<\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327153353.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327153353.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327153353.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\u4e0d\u4f2a\u9020ip\uff0c\u53ea\u505anat\" \/><\/div><\/a><figcaption>\u4e0d\u4f2a\u9020ip\uff0c\u53ea\u505anat<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u4e0d\u8fc7\uff0c\u65e2\u7136\u6211\u4eec\u7684\u670d\u52a1\u5668\u5141\u8bb8\u4f2a\u9020\u6e90ip\uff0c\u5176\u5b9e\u6211\u4eec\u53ef\u4ee5SNAT\u4fee\u6539\u6e90ip\u4e3aGRE\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u7684ip\u3002<\/p>\n<p><code>iptables -t nat -A POSTROUTING -s 10.0.0.2 ! -o gre+ -j SNAT --to-source [gre\u5ba2\u6237\u7aef\u670d\u52a1\u5668ip]<\/code><\/p>\n<p><strong>\u6211\u4e00\u5f00\u59cb\u4ee5\u4e3a\u8981\u5efa\u7acb\u8fde\u63a5\u9700\u8981\u5728\u96a7\u9053\u670d\u52a1\u7aef\u4f2a\u9020\u8bf7\u6c42\u7684\u6e90ip\uff0c\u4f46\u662f\u7ecf\u8fc7\u6d4b\u8bd5\u8c8c\u4f3c\u5e76\u4e0d\u9700\u8981\u4fee\u6539ip\uff0c\u53ea\u9700\u8981\u5728\u8f6c\u53d1\u5305\u7684\u65f6\u5019\u505a\u4e00\u6b21SNAT\uff0c\u5c06\u6e90ip\u4fee\u6539\u6210\u96a7\u9053\u670d\u52a1\u7aef\u7684ip\u5c31\u53ef\u4ee5\u4e86\u3002<\/strong><\/p>\n<p>\u4e0d\u8fc7\u4e8c\u8005\u8fd8\u662f\u6709\u4e00\u70b9\u533a\u522b<\/p>\n<p>\u7b2c\u4e00\u5f20\u56fe\uff0c\u662f\u5728\u4e0d\u4f2a\u9020\u6e90ip\uff0c\u53ea\u5728\u96a7\u9053\u670d\u52a1\u7aef\u670d\u52a1\u5668\u505aSNAT\u7684\u60c5\u51b5\u4e0b\uff0c\u5728\u88abgre\u670d\u52a1\u7aef\u670d\u52a1\u5668\u4e0a\u6293\u5305\u5f97\u5230\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u800c\u63a5\u7740\u6211\u4eec\u5c1d\u8bd5\u4f2a\u9020\u4e00\u4e0b\u6e90ip\uff0c\u5373\u5728\u505aSNAT\u7684\u65f6\u5019\uff0c \u2013to-source \u8bbe\u7f6e\u6210gre\u5ba2\u6237\u7aef\u7684\u516c\u7f51ip\u3002\u8fd9\u6837\uff0cGRE\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u4e3b\u52a8\u53d1\u8d77\u8fde\u63a5\u65f6\u4e5f\u4e0d\u4f1a\u66b4\u9732GRE\u670d\u52a1\u7aef\u670d\u52a1\u5668\u7684ip\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327211347.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327211347.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327211347.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"SNAT\u65f6\u4f7f\u7528\u4f2a\u9020\u7684ip\" \/><\/div><\/a><figcaption>SNAT\u65f6\u4f7f\u7528\u4f2a\u9020\u7684ip<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u53ef\u4ee5\u770b\u89c1\uff0c\u6b64\u65f6\u76ee\u7684\u4e3b\u673a\u4e0a\u7684icmp\u6293\u5305\u663e\u793a\uff0c\u6536\u5230\u7684\u5305\u4e0d\u518d\u6765\u81ea\u4e8ejusthost\uff0c\u800c\u662f\u6765\u81ea\u4e8econtabo\u7684\u670d\u52a1\u5668\u3002<strong>\u5c3d\u7ba1\u5b9e\u9645\u4e0a\uff0c\u6570\u636e\u5305\u8fd8\u662f\u6765\u81ea\u4e8ejusthost\uff0c\u53ea\u662f\u6e90\u5730\u5740\u88ab\u6539\u5199\u6210\u4e86contabo\u7684ip<\/strong><\/p>\n<h3 id=\"\u5173\u4e8e\u4e3a\u4ec0\u4e48\u9700\u8981\u5141\u8bb8ip\u4f2a\u9020\">\u5173\u4e8e\u4e3a\u4ec0\u4e48\u9700\u8981\u5141\u8bb8ip\u4f2a\u9020<\/h3>\n<p>\u6211\u4e00\u5f00\u59cb\u5728\u4e0d\u652f\u6301ip\u4f2a\u9020\u7684\u673a\u5668\u4e0a\u8fdb\u884c\u6d4b\u8bd5\uff0c\u5c06\u5176\u4f5c\u4e3a\u96a7\u9053\u7684\u670d\u52a1\u7aef\u670d\u52a1\u5668\uff0c\u5efa\u7acb\u96a7\u9053\u540e\uff0c\u6211\u5728\u96a7\u9053\u5ba2\u6237\u7aef\u4e0a\u4f7f\u7528\u4e86<code>mtr<\/code>\u547d\u4ee4\u67e5\u770b\u56de\u7a0b\u8def\u7531\uff0c\u770b\u4e0a\u53bb\u6548\u679c\u5f88\u4e0d\u9519\uff0c\u8def\u7531\u8d70\u4e86as10099~as9929\u7684\u7ebf\u8def\uff0c\u5ef6\u8fdf\u4e5f\u5927\u5e45\u964d\u4f4e\u4e86\uff0c\u4f46\u662f\u4e0d\u4e45\u4e4b\u540e\u6211\u5c31\u53d1\u73b0\u4e00\u4e2a\u95ee\u9898\uff1a\u00a0<strong>\u4ecegre\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u4e0aping\u56fd\u5185\u7684ip\u53ef\u4ee5ping\u901a\uff0c\u4e3b\u52a8\u5efa\u7acb\u8fde\u63a5\u65f6\u4e5f\u53ef\u4ee5\u6210\u529f\u5efa\u7acb\u8fde\u63a5\uff0c\u4f46\u662f\u5982\u679c\u4ece\u56fd\u5185ping\u8be5\u670d\u52a1\u5668\u5219\u5f97\u4e0d\u5230\u54cd\u5e94\u3002<\/strong><\/p>\n<p>\u5728\u670d\u52a1\u5668\u4e0a\u4f7f\u7528tcpdump\u6293\u5305\uff0c\u53d1\u73b0\u5b9e\u9645\u4e0agre\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u6536\u5230\u4e86icmp\u7684\u5305\uff0cicmp\u7684\u56de\u5e94\u4e5f\u901a\u8fc7gre1\u865a\u62df\u7f51\u5361\u4f20\u9012\u5230\u4e86gre\u670d\u52a1\u7aef\u670d\u52a1\u5668\u4e0a\uff0c\u4f46\u662f\u6709\u4e00\u4e2a\u5f02\u5e38\u7684\u5730\u65b9\u2014\u2014**\u8be5\u7528\u6765\u8f6c\u53d1\u7684\u670d\u52a1\u5668\u4e0a\u6293\u5230\u7684icmp\u5305\u7684\u6e90\u5730\u5740\u4f9d\u65e7\u662f\u5ba2\u6237\u7aef\u670d\u52a1\u5668\u7684ip\uff0c\u5373\u4f7f\u6211\u5728 POSTROUTING \u94fe\u91cc\u4f7f\u7528 SNAT \u60f3\u628a\u8be5\u6e90\u5730\u5740\u6539\u6210\u8f6c\u53d1\u670d\u52a1\u5668\u7684ip\uff0c\u4f46\u662f\u59cb\u7ec8\u6ca1\u6709\u751f\u6548\u3002**\u6298\u817e\u4e86\u4e00\u4e0b\u5348\uff0c\u6211\u5728\u7f51\u4e0a\u53d1\u73b0\u4e86\u4e00\u7bc7\u6587\u7ae0\u00a0<a class=\"link\" href=\"https:\/\/jeremyxu2010.github.io\/2018\/10\/%E8%BF%BD%E6%9F%A5iptables%E8%A7%84%E5%88%99%E5%A4%B1%E6%95%88%E5%8E%9F%E5%9B%A0\/\" target=\"_blank\" rel=\"noopener\">\u8ffd\u67e5iptables\u89c4\u5219\u5931\u6548\u539f\u56e0<\/a>,\u603b\u7b97\u662f\u89e3\u51b3\u4e86\u6211\u7684\u7591\u60d1\u3002<\/p>\n<blockquote>\n<h4 id=\"nat\">NAT<\/h4>\n<p>This is the realm of the `nat\u2019 table, which is fed packets from two netfilter hooks: for non-local packets, the NF_IP_PRE_ROUTING and NF_IP_POST_ROUTING hooks are perfect for destination and source alterations respectively. If CONFIG_IP_NF_NAT_LOCAL is defined, the hooks NF_IP_LOCAL_OUT and NF_IP_LOCAL_IN are used for altering the destination of local packets.<\/p>\n<p><strong><em>This table is slightly different from the `filter\u2019 table, in that only the first packet of a new connection will traverse the table: the result of this traversal is then applied to all future packets in the same connection.<\/em><\/strong><\/p><\/blockquote>\n<p><strong>Netfilter\u7684nat\u89c4\u5219\u53ea\u5e94\u7528\u4e8e\u8fde\u63a5\u7684\u7b2c\u4e00\u4e2a\u5305<\/strong>\uff0c\u6240\u4ee5\u6211\u4eec\u5373\u4f7f\u4f7f\u7528iptables\u5411POSTROUTING\u91cc\u9762\u6dfb\u52a0\u4e86SNAT\u89c4\u5219\uff0c\u4f46\u662f icmp \u7684echo reply\uff0ctcp\u7684 ack\u5305\u7684\u6e90\u5730\u5740\u4f9d\u65e7\u662f\u539f\u6765\u7684ip\uff0c\u65e0\u6cd5\u6539\u6210\u8f6c\u53d1\u670d\u52a1\u5668\u7684ip\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u7684gre\u8f6c\u53d1\u670d\u52a1\u5668\u8f6c\u53d1\u7684\u6570\u636e\u5305\u7684\u6e90ip\u662f\u4e0d\u53ef\u4fee\u6539\u7684(<strong>\u9664\u975e\u662f\u88ab\u8f6c\u53d1\u7684\u670d\u52a1\u5668\u4e3b\u52a8\u53d1\u8d77\u7684\u8fde\u63a5\uff0c\u53ea\u6709\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6570\u636e\u5305\u624d\u80fd\u8fdb\u884cnat<\/strong>)\uff0c\u800c\u5982\u679c\u673a\u623f\u4e0d\u5141\u8bb8\u4f2a\u9020ip\uff0c\u90a3\u6e90\u5730\u5740\u4e0d\u5c5e\u4e8e\u673a\u623f\u7f51\u7edc\u7684\u6570\u636e\u5305\u662f\u6ca1\u529e\u6cd5\u53d1\u51fa\u53bb\u7684\uff0c\u4f1a\u88ab\u76f4\u63a5\u4e22\u5f03\uff0c\u6240\u4ee5\u6211\u4eec\u60f3\u8981\u7528\u4e00\u53f0\u670d\u52a1\u5668\u6765\u4fee\u6539\u53e6\u4e00\u53f0\u670d\u52a1\u5668\u7684\u56de\u7a0b\uff0c\u90a3\u4e48\u8fd9\u53f0\u670d\u52a1\u5668\u6240\u5728\u7684\u673a\u623f\u5fc5\u987b\u8981\u5141\u8bb8ip\u6b3a\u9a97\u3002<\/p>\n<p>\u68c0\u67e5\u670d\u52a1\u5668\u662f\u5426\u53ef\u4ee5\u4f2a\u9020ip\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u65b9\u6cd5\uff1a<\/p>\n<pre tabindex=\"0\"><code>#\u9996\u5148\u5728\u76ee\u7684\u670d\u52a1\u5668\u4e0a\u8fd0\u884c tcpdump icmp \u76d1\u542cicmp\u6570\u636e\u5305\r\niptables -t nat -A POSTROUTING --destination [\u76ee\u7684\u670d\u52a1\u5668ip] -j SNAT --to-source 1.1.1.1\r\n#ping\u76ee\u7684\u670d\u52a1\u5668\uff0c\u770b\u770b\u76ee\u7684\u670d\u52a1\u5668\u4e0a\u662f\u5426\u53ef\u4ee5\u770b\u89c1 \u6765\u81ea1.1.1.1\u7684icmp\u6570\u636e\u5305\r\nping [\u76ee\u7684\u670d\u52a1\u5668ip]\r\n#\u6d4b\u8bd5\u5b8c\u540e\u5220\u9664\u5730\u5740\u8f6c\u6362\u89c4\u5219\r\niptables -t nat -D POSTROUTING 1\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327205441.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327205441.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/27\/20210327205441.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"1.1\u30021.1\" \/><\/div><\/a><figcaption>1.1\u30021.1<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u5982\u56fe\u663e\u793a\uff0c\u8868\u793a\u6211\u4eec\u7684\u670d\u52a1\u5668\u652f\u6301ip\u4f2a\u9020\u3002<\/p>\n<p>\u4e5f\u53ef\u4ee5\u4f7f\u7528<a class=\"link\" href=\"https:\/\/www.caida.org\/projects\/spoofer\/\" target=\"_blank\" rel=\"noopener\">Spoofer<\/a>\u8fd9\u4e2a\u7a0b\u5e8f:<\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/28\/20210328201806.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/28\/20210328201806.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/28\/20210328201806.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" \/><\/div><\/a><\/figure>\n<p>&nbsp;<\/p>\n<h3 id=\"\u4fee\u6539\u5230\u5927\u9646\u7684\u8def\u7531\">\u4fee\u6539\u5230\u5927\u9646\u7684\u8def\u7531<\/h3>\n<p>\u8981\u4fee\u6539\u5230\u5927\u9646\u7684\u8def\u7531\uff0c\u6211\u4eec\u9996\u5148\u8981\u77e5\u9053\u6240\u6709\u7684\u5927\u9646ip\uff0c\u53ef\u4ee5\u67e5\u770b<a class=\"link\" href=\"https:\/\/ftp.apnic.net\/apnic\/stats\/apnic\/delegated-apnic-latest\" target=\"_blank\" rel=\"noopener\">APNIC\u7684delegated-apnic-list<\/a>\uff0c\u8981\u63d0\u53d6\u5176\u4e2d\u7684\u5927\u9646ip\uff0c\u53ef\u4ee5\u4f7f\u7528https:\/\/github.com\/metowolf\/iplist\u00a0<a class=\"link\" href=\"https:\/\/raw.githubusercontent.com\/metowolf\/iplist\/master\/data\/special\/china.txt\" target=\"_blank\" rel=\"noopener\">\u5927\u9646ip cidr<\/a>\u3002<\/p>\n<p>\u6211\u5199\u4e86\u4e00\u4e2a\u811a\u672c\u6765\u5904\u7406\u8fd9\u4e2a\u5217\u8868\u3002<\/p>\n<pre tabindex=\"0\"><code># -*- coding: utf-8 -*-\r\nimport requests\r\nurl = 'https:\/\/raw.githubusercontent.com\/metowolf\/iplist\/master\/data\/special\/china.txt'\r\nr = requests.get(url, allow_redirects=True)\r\nopen('ips.txt', 'wb').write(r.content)\r\n# \u4e4b\u540e\u751f\u6210\u6dfb\u52a0\u8def\u7531\u8868\u547d\u4ee4\u4e0e\u5378\u8f7d\u8def\u7531\u8868\u547d\u4ee4\r\nstart = open('startCMD.sh', 'w')\r\nend = open('endCMD.sh', 'w')\r\nwith open('ips.txt','r') as f:\r\n  ips = f.read().splitlines()\r\n  for ip in ips:\r\n    start.write('ip route add ' + ip + ' via 10.0.0.1 table GRE\\n') \r\n    end.write('ip route del ' + ip + ' via 10.0.0.1 table GRE\\n')     \r\n    # \u751f\u6210\u542f\u52a8\u811a\u672c\u4e0e\u5378\u8f7d\u811a\u672c (\u6682\u65f6\u6ca1\u5206\u8fd0\u8425\u5546)\r\n    # print(ip)\r\nstart.close()\r\nend.close()\r\n<\/code><\/pre>\n<p>\u542f\u52a8\u7684\u65f6\u5019\u7528<code>bash startCMD.sh<\/code>\u5373\u53ef\uff0c\u5982\u679c\u4e0d\u60f3\u7528\u5219\u53ef\u4ee5\u4f7f\u7528<code>bash endCMD.sh<\/code>\u3002<\/p>\n<h3 id=\"gre\u4e00\u5bf9\u591a\u8fde\u63a5\">GRE\u4e00\u5bf9\u591a\u8fde\u63a5<\/h3>\n<p>\u4e0a\u9762\u63d0\u5230\u7684\u65b9\u5f0f\u90fd\u662f\u5728\u4e24\u53f0\u670d\u52a1\u5668\u4e4b\u95f4\u70b9\u5bf9\u70b9\u7684\u5efa\u7acb\u96a7\u9053\uff0c\u5982\u679c\u6211\u4eec\u540c\u65f6\u60f3\u8981\u6539\u53d8\u591a\u53f0\u670d\u52a1\u5668\u7684\u56de\u7a0b\uff0c\u4e00\u6761\u4e00\u6761\u96a7\u9053\u7684\u5efa\u770b\u4e0a\u53bb\u4e5f\u592a\u9ebb\u70e6\u4e86\uff0c\u6240\u4ee5\u6211\u60f3\u7740\u8981\u662f\u80fd\u5728\u4e00\u4e2a\u96a7\u9053\u4e0a\u521b\u5efa\u591a\u4e2aendpoint\u5c31\u597d\u4e86\uff0c\u7f51\u4e0a\u5173\u4e8eGRE\u7684\u8d44\u6599\u771f\u7684\u4e0d\u592a\u591a\uff0c\u627e\u4e86\u633a\u4e45\u7ec8\u4e8e\u627e\u5230\u4e86\u4e00\u7bc7\u6587\u7ae0\u00a0<a class=\"link\" href=\"https:\/\/sudonull.com\/post\/201046-Creating-point-to-multipoint-tunnels-based-on-GRE-encapsulation-in-Linux-26\" target=\"_blank\" rel=\"noopener\">Creating point-to-multipoint tunnels based on GRE encapsulation in Linux 2.6<\/a>\uff0c\u4f5c\u8005\u5728\u4e09\u53f0\u670d\u52a1\u5668\u95f4\u5efa\u7acb\u4e86\u6761GRE\u96a7\u9053\uff0c\u867d\u7136\u662f\u5341\u51e0\u5e74\u524d\u7684\u6587\u7ae0\u4e86\uff0c\u4f46\u662f\u6211\u89c9\u5f97\u53ef\u4ee5\u8bd5\u8bd5\u3002<\/p>\n<p>\u5728\u4e09\u53f0\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u76f8\u540c\u7684\u5bc6\u94a5\u521b\u5efaGRE\u96a7\u9053\uff08\u548c\u4e4b\u524d\u4e0d\u540c\uff0c\u8fd9\u91cc\u6ca1\u6709\u6307\u5b9a\u672c\u5730\u7684\u516c\u7f51ip\u548c\u8fdc\u7a0bip\uff09<\/p>\n<p>\u6ce8\u610fkey\u5b57\u6bb5\uff0c\u6211\u4eec\u9700\u8981\u7ed9\u51fa\u4e00\u4e2a32\u4f4d\u7684\u5bc6\u94a5<\/p>\n<pre tabindex=\"0\"><code>ip tunnel add mgre0 mode gre key 0xfffffffe ttl 255\r\n<\/code><\/pre>\n<p>\u5047\u8bbe\u4e09\u53f0\u670d\u52a1\u5668\u7684ip\u5206\u522b\u662f 1.1.1.1 2.2.2.2 3.3.3.3,\u6211\u4eec\u4f7f\u75281.1.1.1\u6765\u8f6c\u53d1\uff0c\u63a5\u7740\u5728\u4e09\u53f0\u670d\u52a1\u5668\u4e0a\u8bbe\u7f6e\u96a7\u9053\u7684ip\u3002<\/p>\n<pre tabindex=\"0\"><code>#\u673a\u56681\r\nip addr add 10.0.0.1\/24 dev mgre0\r\n#\u673a\u56682\r\nip addr add 10.0.0.2\/24 dev mgre0\r\n#\u673a\u56683\r\nip addr add 10.0.0.3\/24 dev mgre0\r\n<\/code><\/pre>\n<blockquote><p>For Ethernet interfaces, that would be enough. Ethernet has the Adress Resolution Protocol (ARP), which allows systems to independently find the MAC address, knowing the IP address of the destination host. Ethernet is the Broadcast Multiple Access environment, and ARP consists of creating a request to all stations on the network (using the MAC address FF: FF: FF: FF: FF: FF): \u201cHey, which one of you has an IP address\u00a0<em>xxxx<\/em>\u00a0?\u201d. If a station with such an IP address is available, it already privately reports that \u201c\u00a0<em>xxxx<\/em>\u00a0is located at\u00a0<em>yy: yy: yy: yy: yy: yy<\/em>\u00a0\u201d.<\/p><\/blockquote>\n<p>\u5982\u679c\u4e09\u53f0\u673a\u5668\u5728\u540c\u4e00\u4e2a\u4ee5\u592a\u7f51\u4e2d\u7684\u65f6\u5019\uff0c\u56e0\u4e3aARP\u7684\u5e7f\u64ad\uff0c\u4e09\u53f0\u673a\u5668\u4e4b\u95f4\u5df2\u7ecf\u53ef\u4ee5\u8fde\u63a5\u4e86\uff0c\u4f46\u662f\u5728\u56e0\u7279\u7f51\u4e2d\uff0c\u6211\u4eec\u8fd8\u5f97\u8bbe\u7f6eip\u7684\u5173\u8054\u3002<em>NHRP\u534f\u8bae\u53ef\u80fd\u53ef\u4ee5\u4e3a\u6211\u4eec\u81ea\u52a8\u7684\u89e3\u51b3ip\u5730\u5740\u5173\u8054\u7684\u95ee\u9898\uff0c\u5927\u6982\u53ef\u4ee5\u8ba9\u4e00\u53f0\u670d\u52a1\u5668\u8fde\u63a5\u5230\u96a7\u9053\u800c\u4e0d\u9700\u8981\u624b\u52a8\u8fdb\u884c\u914d\u7f6e\uff0c\u4f46\u662f\u6211\u4eec\u6682\u65f6\u4e0d\u6df1\u5165\u7814\u7a76\u3002<\/em><\/p>\n<p>\u6dfb\u52a0\u90bb\u5c45\uff0c<em><code>lladdr<\/code>\u00a0is the link layer address of the neighbour<\/em>\u00a0lladdr\u6307\u7684\u662f\u94fe\u8def\u5c42\u5730\u5740\uff0c\u4f46\u662f\u6587\u7ae0\u4e2d\u4f5c\u8005\u586b\u7684\u662f\u90bb\u5c45\u7684\u516c\u7f51ip\uff0c\u5982\u679c\u662f\u5728\u540c\u4e00\u4e2a\u4ee5\u592a\u7f51\u4e0b\uff0c\u8fd9\u4e2aip\u5927\u6982\u4f1a\u88ab\u89e3\u6790\u6210MAC\u5730\u5740\uff0c\u53e6\u5916\uff0c\u5982\u679c<strong>\u53ea\u662f\u60f3\u4fee\u6539\u56de\u7a0b\uff0c\u4e0d\u9700\u8981\u5404\u4e2a\u7aef\u70b9\u4e4b\u95f4\u4e92\u8054\u7684\u8bdd\uff0c\u90a3\u4e48\u6dfb\u52a0\u53e6\u636e\u7684\u65f6\u5019\uff0c\u5ba2\u6237\u7aef\u53ea\u6dfb\u52a0\u670d\u52a1\u7aef\u7684ip\u4f5c\u4e3a\u90bb\u5c45\u5373\u53ef\uff0c\u5f53\u7136\u7528\u4f5c\u8f6c\u53d1\u76841.1.1.1\u9700\u8981\u6dfb\u52a0\u6240\u6709\u90bb\u5c45\u7684ip\u3002<\/strong><\/p>\n<pre tabindex=\"0\"><code>(on 1.1.1.1)\r\nip neigh add 10.0.0.2 lladdr 2.2.2.2 dev mgre0\r\nip neigh add 10.0.0.3 lladdr 3.3.3.3 dev mgre0\r\n\r\n(on 2.2.2.2)\r\nip neigh add 10.0.0.1 lladdr 1.1.1.1 dev mgre0\r\nip neigh add 10.0.0.3 lladdr 3.3.3.3 dev mgre0\r\n\r\n(at 3.3.3.3)\r\nip neigh add 10.0.0.1 lladdr 1.1.1.1 dev mgre0\r\nip neigh add 10.0.0.2 lladdr 2.2.2.2 dev mgre0\r\n\r\n<\/code><\/pre>\n<p>\u53e6\u5916\u5728\u4e09\u53f0\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u00a0<code>ip link set mgre0 up<\/code>\u00a0\u542f\u7528\u96a7\u9053\u3002<strong>\u6211\u8bd5\u7740\u5728\u542f\u52a8\u96a7\u9053\u540e\u518d\u6dfb\u52a0\u90bb\u5c45\uff0c\u53d1\u73b0\u51fa\u73b0\u4e86\u6dfb\u52a0\u90bb\u5c45\u540e\u96a7\u9053\u4e0d\u901a\u7684\u60c5\u51b5\uff0c\u6682\u65f6\u6ca1\u627e\u5230\u89e3\u51b3\u65b9\u6cd5\uff0c\u6240\u4ee5\u5148\u6dfb\u52a0\u90bb\u5c45\u518d\u542f\u7528\u96a7\u9053\uff0c\u6216\u8005\u6dfb\u52a0\u540e\u5148set down \u518d set up\u3002<\/strong><\/p>\n<p>\u4e4b\u540e\u6211\u4eec\u53ef\u4ee5\u770b\u89c1\u96a7\u9053\u4e4b\u95f4\u53ef\u4ee5\u4e92\u8054\u4e86\u3002<\/p>\n<p>&nbsp;<\/p>\n<figure><a href=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/28\/20210328170045.png\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/img.aoyouer.com\/images\/2021\/03\/28\/20210328170045.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/img.aoyouer.com\/images\/2021\/03\/28\/20210328170045.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\u591a\u70b9GRE\u96a7\u9053\" \/><\/div><\/a><figcaption>\u591a\u70b9GRE\u96a7\u9053<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>\u4e4b\u540e\u5c31\u53ea\u9700\u8981\u7167\u7740\u4e0a\u6587\u7684\u65b9\u6cd5\u4fee\u6539\u8def\u7531\u8868\uff0c\u4ee5\u53ca\u5728POSRTOURING\u4e2d\u505a\u4e00\u6b21SNAT\u4fee\u6539\u5bf9\u5e94\u96a7\u9053ip\u7684\u51fa\u53e3ip\u5373\u53ef\uff08\u9700\u8981\u652f\u6301ip\u6b3a\u9a97\uff09\uff0c\u53e6\u5916\u8bb0\u5f97\u5728\u7528\u4e8e\u8f6c\u53d1\u7684 1.1.1.1\u4e0a\u5f00\u542fipv4\u5305\u8f6c\u53d1\u3002<\/p>\n<pre tabindex=\"0\"><code>10.0.1.2\u4e0a\r\necho '99 mgre' &amp;gt;&amp;gt; \/etc\/iproute2\/rt_tables\r\nip rule add from all table mgre\r\nip route add 96.9.225.181 via 10.0.1.1 table mgre\r\n#\u4e5f\u53ef\u4ee5\u4fee\u6539\u4e00\u4e0b\u4e0a\u9762\u7684python\u811a\u672c\u4e2d\u7684\u7f51\u5173\u548c\u8def\u7531\u8868\u540d\u5b57\u751f\u6210\u6279\u91cf\u6267\u884c\u811a\u672c startCMD.sh\r\n10.0.1.1\u4e0a\r\necho 'net.ipv4.ip_forward=1' &amp;gt;&amp;gt; \/etc\/sysctl.conf\r\nsysctl -p\r\niptables -t nat -A POSTROUTING -s 10.0.1.2 ! -o gre+ -j SNAT --to-source 2.2.2.2\r\n<\/code><\/pre>\n<p>\u73b0\u5728\u5c31\u53ef\u4ee5\u8ba9\u591a\u4e2a\u670d\u52a1\u5668\u7528\u540c\u4e00\u6761\u96a7\u9053\u6765\u6539\u53d8\u56de\u7a0b\u4e86\uff0c\u4f46\u662f\u76ee\u524d\u914d\u7f6e\u8d77\u6765\u8fd8\u6709\u4e00\u70b9\u9ebb\u70e6\uff0c\u4e4b\u540e\u6709\u7a7a\u53ef\u4ee5\u8003\u8651\u6298\u817e\u4e00\u4e0bNHRP\uff0c\u5b9e\u73b0\u81ea\u52a8\u6dfb\u52a0\u3002<\/p>\n<h3 id=\"\u6301\u4e45\u5316\">\u6301\u4e45\u5316<\/h3>\n<p>\u91cd\u542f\u540eGRE\u96a7\u9053\u4f1a\u5931\u6548\uff0c\u6240\u4ee5\u6211\u4eec\u8981\u628a\u4e0a\u9762\u6267\u884c\u7684\u547d\u4ee4\uff08\u5efa\u7acb\u96a7\u9053\uff0c\u6dfb\u52a0\u5730\u5740\uff0c\u542f\u52a8\u865a\u62df\u7f51\u5361\uff0c\u4fee\u6539\u8def\u7531\u8868\uff09\u90fd\u5199\u5230\u00a0<code>\/etc\/rc.local<\/code>\u00a0\u91cc\u9762\u53bb\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Olink cloud\u4e4b\u524d\u5f00\u59cb\u9500\u552e\u4e86\u4e00\u79cd\u5f88\u6709\u610f\u601d\u7684\u4ea7\u54c1\u00a0Transit Over GRE\uff0c\u53ef\u4ee5\u5728\u4f60\u7684\u670d\u52a1\u5668\u548c\u5546 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-5262","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5262"}],"version-history":[{"count":1,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5262\/revisions"}],"predecessor-version":[{"id":5263,"href":"https:\/\/www.xh86.me\/index.php?rest_route=\/wp\/v2\/posts\/5262\/revisions\/5263"}],"wp:attachment":[{"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xh86.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}