{"id":6027,"date":"2022-01-19T16:40:44","date_gmt":"2022-01-19T08:40:44","guid":{"rendered":"https:\/\/www.sunnyblog.net\/blog\/?p=6027"},"modified":"2022-01-19T16:40:44","modified_gmt":"2022-01-19T08:40:44","slug":"aws-lightsail-centos7%e9%9c%80%e8%a6%81%e6%89%8b%e5%b7%a5%e5%bc%80%e5%90%afipv6%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.sunnyblog.net\/blog\/archives\/6027","title":{"rendered":"AWS Lightsail CentOS7\u9700\u8981\u624b\u5de5\u5f00\u542fIPv6\u7684\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u6211\u8fd9\u4e2ablog\u662f\u653e\u5728AWS Lightsail\u5b9e\u4f8b\u4e0a\u9762\u8dd1\u7740\u7684\uff0c\u56e0\u4e3a\u5bb6\u91cc\u5bbd\u5e26\u5347\u7ea7\u5149\u7ea4\uff0c\u81ea\u5df1\u5728\u5149\u732b\u4e0a\u6253\u5f00\u4e86\u6865\u63a5\u548c\u83b7\u53d6ipv6\uff0c\u987a\u4fbf\u5728\u5bb6\u91cc\u7684\u534e\u7855\u8def\u7531\u5668\u4e0a\u4e5f\u6253\u5f00\u4e86ipv6\u4e4b\u540e\uff0c\u5c31\u7422\u78e8\u7740\u4ec0\u4e48\u90fd\u7528ipv6\u7684\u65b9\u5f0f\u8bbf\u95ee\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u9274\u4e8e\u8fd9\u4e2a\u7f51\u7ad9\u4e4b\u524d\u53ea\u662f\u9002\u914d\u4e86ipv4\uff0c\u4e8e\u662f\u5c31\u52a8\u624b\u6298\u817e\u4e00\u4e0b\u5427\u3002\u767b\u5f55AWS Lightsail\u7684\u63a7\u5236\u53f0\uff0c\u8bf4\u662fLightsail\u5b9e\u4f8b\u5df2\u7ecf\u652f\u6301ipv6\u4e86\uff0c\u4e5f\u5df2\u7ecf\u63d0\u4f9b\u4e86\u4e00\u4e2aipv6\u7684\u516c\u6709\u5730\u5740\uff0c\u5728\u63a7\u5236\u53f0\u4e0a\u628a\u9632\u706b\u5899\u8bbe\u7f6e\u4e00\u4e0b\uff0c\u653e\u884c\u9700\u8981\u8bbf\u95ee\u7684\u7aef\u53e3\u3002\u5230\u57df\u540d\u6258\u7ba1\u670d\u52a1\u5546\u90a3\u91cc\u5c06\u57df\u540dDNS\u8bb0\u5f55\u589e\u6dfbAAAA\u8bb0\u5f55\uff0c\u7ed1\u5b9a\u5230\u5b9e\u4f8b\u7684ipv6\u5730\u5740\u4e0a\u9762\u3002\u5728\u7b49\u751f\u6548\u671f\u95f4\u7684\u65f6\u5019\uff0cssh\u5230\u5b9e\u4f8b\u4e0a\u9762\uff0c\u4fee\u6539nginx\u4e0a\u9762\u7684nginx.conf\u548cvhost\u4e0b\u9762\u7684\u914d\u7f6e\uff0c\u628aipv6\u7684\u8bbf\u95ee\u7aef\u53e3\u90fd\u6253\u5f00\u4fa6\u542c\u4e86\uff0c\u5e76\u4e14\u91cd\u542f\u670d\u52a1\u3002\u7b49\u5230DNS\u4f20\u64ad\u751f\u6548\u4e4b\u540e\uff0c\u5c1d\u8bd5\u76f4\u63a5\u7528ipv6\u7684\u5730\u5740\u8bbf\u95ee\u4e00\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -g -6 -k 'https:\/\/sunnyblog.net\/'<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u5c45\u7136\u53cd\u9988\u8d85\u65f6\uff0c\u7528ipv4\u7684\u65b9\u5f0f\u6ca1\u6709\u95ee\u9898\u3002\u8ba4\u771f\u68c0\u67e5\u4e86nginx\u7684\u914d\u7f6e\uff0c\u6ca1\u6709\u95ee\u9898\uff0c\u7528netstat\u68c0\u67e5tcp6\u7684\u7aef\u53e3\u90fd\u662f\u4fa6\u542c\u7740\u7684\u3002\u4e00\u6c14\u4e4b\u4e0b\uff0c\u5728\u63a7\u5236\u53f0\u4e0a\u628a\u9632\u706b\u5899\u5168\u90e8\u534f\u8bae\u7aef\u53e3\u90fd\u6253\u5f00\uff0c\u4f46\u662f\u65e0\u8bba\u662f\u7528HTTP\u8fd8\u662fSSH\u90fd\u8bbf\u95ee\u4e0d\u80fd\u3002<\/p>\n\n\n\n<p>\u7528ip addr\u67e5\u770bIPv6\u662f\u5728\u7684\uff0c\u670d\u52a1\u5728ipv4\u4e0a\u9762\u662f\u6b63\u5e38\u8bbf\u95ee\u7684\uff0c\u914d\u7f6e\u662f\u6b63\u786e\u7684\uff0c\u7aef\u53e3\u662f\u6253\u5f00\u4e86\u7684\uff0c\u4e5f\u786e\u8ba4\u6211\u5f53\u524d\u7f51\u7edc\u662f\u80fd\u7528ipv6\u8bbf\u95ee\u5176\u4ed6\u652f\u6301\u7684\u7f51\u7ad9\u7684\u3002\u4f30\u8ba1\u8fd8\u662fCentOS\u4e0a\u9762\u662f\u4e0d\u662f\u6709\u4ec0\u4e48\u914d\u7f6e\u6ca1\u6709\u4fee\u6539\u597d\uff0c\u9700\u8981\u624b\u5de5\u5f04\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u5728\u7f51\u4e0a\u641c\u7d22\u4e00\u901a\uff0c\u5404\u79cd\u5c1d\u8bd5\uff08\u5f53\u7136\u4fee\u6539\u4e4b\u524d\u90fd\u662f\u505a\u4e2a\u5b9e\u4f8b\u5feb\u7167\uff0c\u5907\u4efd\u597d\u624d\u5b89\u5168\uff0c\u4ee5\u524d\u8840\u7684\u6559\u8bad\uff09\uff0c\u7136\u540e\u7ec8\u4e8e\u627e\u5230\u4ee5\u4e0b\u8fd9\u7bc7\u6587\u7ae0\u300a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.blueskyxn.com\/202103\/4430.html\" target=\"_blank\">AWS Amazon Lightsail CentOS 7 \u624b\u52a8\u542f\u52a8IPV6\u7684\u89e3\u51b3\u65b9\u6cd5<\/a>\u300b\u89e3\u51b3\u4e86\uff0c\u611f\u8c22\u539f\u535a\u4e3b\uff01\u5927\u81f4\u64cd\u4f5c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\u6253\u5f00\u8def\u5f84\/etc\/sysconfig\/network-scripts\uff0c\u4fee\u6539\u6587\u4ef6 ifcfg-eth0\uff0c\uff08\u7528centos\u7528\u6237\u767b\u5f55\u4e4b\u540e\uff0csudo su -\u5207\u6362\u5230root\u7528\u6237\u64cd\u4f5c\uff09\uff0c\u5728\u6700\u5e95\u4e0b\u6dfb\u52a0\u4ee5\u4e0b\u4e24\u884c\u5e76\u4fdd\u5b58\u9000\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>IPV6INIT=yes\nIPV6_AUTOCONF=yes<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u91cd\u542f\u5373\u53ef\u751f\u6548\uff01<\/p>\n\n\n\n<p>\u7528curl -6\u68c0\u67e5\u53ef\u4ee5\u6b63\u5e38\u901a\u8fc7IPv6\u8bbf\u95ee\u7f51\u7ad9\u4e86\uff01\u7528ipw.cn\u7f51\u7ad9\u68c0\u67e5\u4e5f\u662f\u8bc1\u660e\u652f\u6301IPv6\u4e86\u3002\u6298\u817e\u7ec8\u4e8e\u6709\u4e2a\u597d\u7ed3\u679c\uff0c\u867d\u7136\u5176\u5b9e\u7136\u5e76\u5375\uff0c\u4e0d\u8fc7\u5076\u5c14\u52a8\u52a8\u624b\u8fd8\u662f\u4e0d\u9519\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u8fd9\u4e2ablog\u662f\u653e\u5728AWS Lightsail\u5b9e\u4f8b\u4e0a\u9762\u8dd1\u7740\u7684\uff0c\u56e0\u4e3a\u5bb6\u91cc\u5bbd\u5e26\u5347\u7ea7\u5149\u7ea4\uff0c\u81ea\u5df1\u5728\u5149\u732b\u4e0a\u6253\u5f00\u4e86\u6865\u63a5\u548c\u83b7 &hellip; <a href=\"https:\/\/www.sunnyblog.net\/blog\/archives\/6027\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">AWS Lightsail CentOS7\u9700\u8981\u624b\u5de5\u5f00\u542fIPv6\u7684\u65b9\u6cd5<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[5],"tags":[25,295,294,67],"class_list":["post-6027","post","type-post","status-publish","format-standard","hentry","category-develop","tag-aws","tag-centos7","tag-ipv6","tag-lightsail"],"_links":{"self":[{"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/posts\/6027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/comments?post=6027"}],"version-history":[{"count":1,"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/posts\/6027\/revisions"}],"predecessor-version":[{"id":6028,"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/posts\/6027\/revisions\/6028"}],"wp:attachment":[{"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/media?parent=6027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/categories?post=6027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sunnyblog.net\/blog\/wp-json\/wp\/v2\/tags?post=6027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}