{"id":824,"date":"2012-07-01T16:46:32","date_gmt":"2012-07-01T08:46:32","guid":{"rendered":"http:\/\/www.dogeye.net\/?p=824"},"modified":"2012-07-01T16:46:32","modified_gmt":"2012-07-01T08:46:32","slug":"linux%e5%a6%82%e4%bd%95%e8%ae%be%e7%bd%aeipv6%e5%9c%b0%e5%9d%80","status":"publish","type":"post","link":"https:\/\/ykyi.net\/?p=824","title":{"rendered":"Linux\u5982\u4f55\u8bbe\u7f6eIPv6\u5730\u5740"},"content":{"rendered":"<p>IPv6\u6700\u7ec8\u5168\u9762\u53d6\u5f85IPv6\u662f\u4e0d\u53ef\u9006\u7684\u6f6e\u6d41\u3002\u672c\u6587\u5219\u8bb2\u4e00\u4e0b\u5728Linux\u4e0b\u5982\u4f55\u914d\u7f6eIPv6\u5730\u5740\u3002\u5f53\u7136\u672c\u6587\u5047\u8bbe\u4f60\u4f7f\u7528\u9759\u6001IP\uff08\u4e0d\u5fc5\u662f\u516c\u5171IPv6\u5730\u5740\u6216\u516c\u5171IPv4\u5730\u5740\uff0c\u53ef\u4ee5\u662f\u79c1\u6709IPv4\u5730\u5740\uff09\u3002\u672c\u6587\u4e0d\u9002\u7528\u4f7f\u7528DHCP\u83b7\u53d6\u5730\u5740\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u9996\u5148\uff0c\u4f60\u8981\u786e\u4fdd\u4f60\u4f7f\u7528\u7684Linux\u7684\u5185\u6838\u5df2\u7ecf\u652f\u6301IPv6\u3002\u5f53\u524d\u6bd4\u8f83\u65b0\u7684Linux\u90fd\u5df2\u7ecf\u5185\u5efaIPv6\u4e86\u3002<\/p>\n<p>\u7528root\u7528\u6237\u767b\u5f55\uff0c\u8fd0\u884c\uff1a<\/p>\n<p># lsmod | grep ipv6<\/p>\n<p>\u770b\u770b\u7cfb\u7edf\u6709\u6ca1\u6709\u5df2\u7ecf\u52a0\u8f7d\u4e86IPv6\u6a21\u5757\u3002\u5982\u679c\u6ca1\u6709\uff0c\u5c1d\u8bd5\u7528\u4ee5\u4e0b\u547d\u4ee4\u52a0\u8f7d\uff1a&nbsp;<\/p>\n<p># \/sbin\/modprobe ipv6<\/p>\n<p>\u7b2c\u4e8c\uff0c\u4f60\u9700\u8981\u6709\u4f60\u7684\u9759\u6001IP\u5730\u5740\u3002<\/p>\n<p><strong>IPv4\u5730\u5740\u5982\u4f55\u8f6c\u6210IPv6\u5730\u5740\u5462\uff1f<\/strong>\u5982\u679c\u4f60\u7684IP\u662f\u4e00\u4e2aIPv4\u5730\u5740\uff0c\u90a3\u4e48\u53ef\u4ee5\u6362\u7b97\u5f97\u5230IPv6\u7684\u5730\u5740\u5f62\u5f0f\u3002\u6bd4\u8f83\u7b80\u5355\u7684\u4f5c\u6cd5\u53ef\u4ee5\u53bb\u5230 <a href=\"http:\/\/grox.net\/utils\/ipv6.php\" target=\"_blank\" rel=\"noopener\">http:\/\/grox.net\/utils\/ipv6.php<\/a>\u3002\u5728\u5de6\u8fb9\u7684\u4e0b\u62c9\u5217\u8868\u4e2d\u9009\u62e9: IPv4 to 6to4 Address\uff0c\u5728\u53f3\u8fb9\u7684\u7f16\u8f91\u6846\u4e2d\u586b\u4e0a\u4f60\u7684IPv4\u5730\u5740\u3002\u70b9\u51fb: Calculate \u5219\u5f97\u5230\u4e86\u4f60\u7684IPv4\u5730\u5740\u7684IPv6\u8f6c\u5316\u683c\u5f0f\u3002<\/p>\n<h2>\u914d\u7f6eIPv6\u5730\u5740<\/h2>\n<p>\u4e00\u822c\u7684Linux\u53d1\u884c\u7248\u7528 \/etc\/network\/interfaces \u6587\u4ef6\u914d\u7f6e\u7f51\u5361\u3002\u5982\u679c\u6ca1\u6709\u8fd9\u4e2a\u6587\u4ef6\uff0c\u90a3\u4e48\u8bf7\u6ce8\u610f \/etc\/network \u76ee\u5f55\u4e0b\u5176\u5b83\u6587\u4ef6\u6216\u8005\u76ee\u5f55\u3002<\/p>\n<p>\u5047\u5982\u8981\u914d\u7f6e\u7684Linux\u7684\u9759\u6001IPv4\u5730\u5740\u662f 192.168.1.10\uff0c\u8fd9\u4e2aIPv4\u5730\u5740\u8f6c\u6362\u6210\u5bf9\u5e94\u7684IPv6\u5730\u5740\u5219\u662f 2002:c0a8:10a:: \u3002\u518d\u63d0\u9192\u4e00\u4e0b\uff0c\u4e0a\u6587\u63d0\u5230\u8fc7\u5982\u4f55\u628aIPv4\u5730\u5740\u8f6c\u6210IPv6\u5730\u5740\u3002<\/p>\n<p>\u7f51\u5173\u7684IPv4\u5730\u5740\u662f 192.168.1.1\uff0c\u8fd9\u4e2aIPv4\u5730\u5740\u8f6c\u6210\u5bf9\u5e94\u7684IPv6\u7684\u5730\u5740\u662f:2002:c0a8:0101:: \u3002<\/p>\n<p>\u90a3\u4e48 \/etc\/network\/interfaces \u6587\u4ef6\u5e94\u8be5\u914d\u7f6e\u6210\u5982\u4e0b\uff1a<\/p>\n<p>#IPV6 static configuration(\u6211\u662f\u6ce8\u91ca)<br \/>\n\tiface eth0 inet6 static<br \/>\n\tpre-up modprobe ipv6<br \/>\n\taddress 2002:c0a8:10a::<br \/>\n\tnetmask 64<br \/>\n\tgateway 2002:c0a8:0101::<\/p>\n<p>\u6ce8\u610f &quot;pre-up&quot; \u547d\u4ee4\u3002\u8fd9\u4e00\u884c\u4fdd\u8bc1\u7cfb\u7edf\u5728\u542f\u52a8\u7684\u65f6\u5019\u52a0\u8f7d\u652f\u6301ipv6\u7684\u6a21\u5757\u3002<br \/>\n\t\u6700\u540e\u91cd\u65b0\u542f\u53d1\u52a8\u7f51\u7edc\uff0c\u5982\u4e0b\uff1a<\/p>\n<p># \/etc\/init.d\/networking restart<\/p>\n<p>\u4f60\u73b0\u5728\u53ef\u4ee5\u4f7f\u7528\u4f60\u7684IPv6\u5730\u5740\u4e86\u3002<\/p>\n<h2>\u6d4b\u8bd5IPv6\u5730\u5740\uff1a<\/h2>\n<p>\u68c0\u6d4b\u8def\u7531\uff1a<\/p>\n<p># ip -6 route show<\/p>\n<p>\u5982\u679cIPv6\u5de5\u4f5c\u6b63\u5e38\u7684\u8bdd\uff0c\u5e94\u8be5\u4f1a\u6709\u5982\u4e0b\u7684\u63d0\u793a\u3002<\/p>\n<p>2002:c0a8:0100\/64 dev eth0 proto kernel scope link src 2002:c0a8:10a<\/p>\n<p>\u4f60\u4e5f\u53ef\u4ee5\u7528IPv6\u7248\u672c\u7684ping\u5de5\u5177\u6d4b\u8bd5\u3002\u9996\u5148\u60f3\u5230\u7684\u6700\u597d\u7684IPv6\u5730\u5740\u5f53\u7136\u662fgoogle\u7684\uff0c\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>ping6 ipv6.google.com<\/p>\n<p>\u5982\u679cipv6\u4e0d\u5de5\u4f5c\uff0c\u4f60\u4f1a\u5f97\u5230\u9519\u8bef\u4fe1\u606f\uff1aNetwork is unreachable&nbsp;<\/p>\n<p>If IPv6 is working you will see the standard ping results in your terminal window.<\/p>\n<p>\u5982\u679cIPv6\u5de5\u4f5c\u6b63\u5e38\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u770b\u5230\u6807\u51c6\u7684ping\u547d\u4ee4\u7684\u8f93\u51fa\u3002<\/p>\n<p>\u540e\u8bb0\uff1aIPv6\u662f\u4e0b\u4e00\u4ee3\u4e92\u8054\u7f51\u7684\u5de5\u4e1a\u6807\u51c6\u3002\u5982\u679c\u4f60\u662f\u4e00\u4f4dIP\u4ece\u4e1a\u4eba\u5458\uff0c\u5373\u65f6\u8ddf\u8fdbIPv6\u6280\u672f\u662f\u5fc5\u987b\u7684\u3002\u5982\u679c\u53ea\u662f\u666e\u901a\u7684\u6c11\u4f17\uff0c\u5219\u53ef\u4ee5\u4e0d\u5fc5\u7406\u4f1a\uff0c\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u4f60\u611f\u89c9\u4e0d\u5230IPv6\u548cIPv4\u7684\u533a\u522b\uff0c\u4f60\u5c31\u5e73\u6ed1\u8fc7\u6e21\u5230IPv6\u7684\u65f6\u4ee3\u4e86\u3002<\/p>\n<p>copyright ykyi.net<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IPv6\u6700\u7ec8\u5168\u9762\u53d6\u5f85IPv6\u662f\u4e0d\u53ef\u9006\u7684\u6f6e\u6d41\u3002\u672c\u6587\u5219\u8bb2\u4e00\u4e0b\u5728Linux\u4e0b\u5982\u4f55\u914d\u7f6eIPv6\u5730\u5740\u3002\u5f53\u7136\u672c\u6587\u5047\u8bbe\u4f60\u4f7f\u7528\u9759\u6001IP\uff08\u4e0d\u5fc5\u662f\u516c\u5171IPv6\u5730\u5740\u6216\u516c\u5171IPv4\u5730\u5740\uff0c\u53ef\u4ee5\u662f\u79c1\u6709IPv4\u5730\u5740\uff09\u3002\u672c\u6587\u4e0d\u9002\u7528\u4f7f\u7528DHCP\u83b7\u53d6\u5730\u5740\u7684\u60c5\u51b5\u3002 \u9996\u5148\uff0c\u4f60\u8981\u786e\u4fdd\u4f60\u4f7f\u7528\u7684Linux\u7684\u5185\u6838\u5df2\u7ecf\u652f\u6301IPv6\u3002\u5f53\u524d\u6bd4\u8f83\u65b0\u7684Linux\u90fd\u5df2\u7ecf\u5185\u5efaIPv6\u4e86\u3002 \u7528root\u7528\u6237\u767b\u5f55\uff0c\u8fd0\u884c\uff1a # lsmod | grep ipv6 \u770b\u770b\u7cfb\u7edf\u6709\u6ca1\u6709\u5df2\u7ecf\u52a0\u8f7d\u4e86IPv6\u6a21\u5757\u3002\u5982\u679c\u6ca1\u6709\uff0c\u5c1d\u8bd5\u7528\u4ee5\u4e0b\u547d\u4ee4\u52a0\u8f7d\uff1a&nbsp; # \/sbin\/modprobe ipv6 \u7b2c\u4e8c\uff0c\u4f60\u9700\u8981\u6709\u4f60\u7684\u9759\u6001IP\u5730\u5740\u3002 IPv4\u5730\u5740\u5982\u4f55\u8f6c\u6210IPv6\u5730\u5740\u5462\uff1f\u5982\u679c\u4f60\u7684IP\u662f\u4e00\u4e2aIPv4\u5730\u5740\uff0c\u90a3\u4e48\u53ef\u4ee5\u6362\u7b97\u5f97\u5230IPv6\u7684\u5730\u5740\u5f62\u5f0f\u3002\u6bd4\u8f83\u7b80\u5355\u7684\u4f5c\u6cd5\u53ef\u4ee5\u53bb\u5230 http:\/\/grox.net\/utils\/ipv6.php\u3002\u5728\u5de6\u8fb9\u7684\u4e0b\u62c9\u5217\u8868\u4e2d\u9009\u62e9: IPv4 to 6to4 Address\uff0c\u5728\u53f3\u8fb9\u7684\u7f16\u8f91\u6846\u4e2d\u586b\u4e0a\u4f60\u7684IPv4\u5730\u5740\u3002\u70b9\u51fb: Calculate \u5219\u5f97\u5230\u4e86\u4f60\u7684IPv4\u5730\u5740\u7684IPv6\u8f6c\u5316\u683c\u5f0f\u3002 \u914d\u7f6eIPv6\u5730\u5740 \u4e00\u822c\u7684Linux\u53d1\u884c\u7248\u7528 \/etc\/network\/interfaces \u6587\u4ef6\u914d\u7f6e\u7f51\u5361\u3002\u5982\u679c\u6ca1\u6709\u8fd9\u4e2a\u6587\u4ef6\uff0c\u90a3\u4e48\u8bf7\u6ce8\u610f \/etc\/network \u76ee\u5f55\u4e0b\u5176\u5b83\u6587\u4ef6\u6216\u8005\u76ee\u5f55\u3002 \u5047\u5982\u8981\u914d\u7f6e\u7684Linux\u7684\u9759\u6001IPv4\u5730\u5740\u662f 192.168.1.10\uff0c\u8fd9\u4e2aIPv4\u5730\u5740\u8f6c\u6362\u6210\u5bf9\u5e94\u7684IPv6\u5730\u5740\u5219\u662f 2002:c0a8:10a:: \u3002\u518d\u63d0\u9192\u4e00\u4e0b\uff0c\u4e0a\u6587\u63d0\u5230\u8fc7\u5982\u4f55\u628aIPv4\u5730\u5740\u8f6c\u6210IPv6\u5730\u5740\u3002 \u7f51\u5173\u7684IPv4\u5730\u5740\u662f 192.168.1.1\uff0c\u8fd9\u4e2aIPv4\u5730\u5740\u8f6c\u6210\u5bf9\u5e94\u7684IPv6\u7684\u5730\u5740\u662f:2002:c0a8:0101:: \u3002 \u90a3\u4e48 \/etc\/network\/interfaces \u6587\u4ef6\u5e94\u8be5\u914d\u7f6e\u6210\u5982\u4e0b\uff1a #IPV6 static configuration(\u6211\u662f\u6ce8\u91ca) iface eth0 inet6 static pre-up modprobe ipv6 address 2002:c0a8:10a:: netmask 64 gateway 2002:c0a8:0101:: \u6ce8\u610f &quot;pre-up&quot; &hellip; <a href=\"https:\/\/ykyi.net\/?p=824\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Linux\u5982\u4f55\u8bbe\u7f6eIPv6\u5730\u5740&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,7],"tags":[41,116],"class_list":["post-824","post","type-post","status-publish","format-standard","hentry","category-network","category-unix_linux","tag-ipv6","tag-116"],"_links":{"self":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=824"}],"version-history":[{"count":0,"href":"https:\/\/ykyi.net\/index.php?rest_route=\/wp\/v2\/posts\/824\/revisions"}],"wp:attachment":[{"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykyi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}