{"id":371,"date":"2016-06-16T23:22:52","date_gmt":"2016-06-16T15:22:52","guid":{"rendered":"http:\/\/wp.xyz1943.net\/?p=371"},"modified":"2016-06-16T23:22:52","modified_gmt":"2016-06-16T15:22:52","slug":"%e8%bd%89%e8%b2%bc-%e5%81%9c%e6%8e%89-linux-ipv6%e4%b8%b4%e6%97%b6%e5%9c%b0%e5%9d%80","status":"publish","type":"post","link":"https:\/\/nas1.xyz1943.net\/wordpress\/2016\/06\/16\/%e8%bd%89%e8%b2%bc-%e5%81%9c%e6%8e%89-linux-ipv6%e4%b8%b4%e6%97%b6%e5%9c%b0%e5%9d%80\/","title":{"rendered":"[\u8f49\u8cbc] \u505c\u6389 linux ipv6\u4e34\u65f6\u5730\u5740"},"content":{"rendered":"<h1 class=\"postTitle\"><a id=\"cb_post_title_url\" class=\"postTitle2\" href=\"http:\/\/www.cnblogs.com\/makefile\/p\/5040615.html\">linux ipv6\u4e34\u65f6\u5730\u5740<\/a><\/h1>\n<div class=\"clear\"><a href=\"http:\/\/www.cnblogs.com\/makefile\/p\/5040615.html\">\u00a0http:\/\/www.cnblogs.com\/makefile\/p\/5040615.html<\/a><\/div>\n<div class=\"clear\"><\/div>\n<div class=\"clear\"><\/div>\n<div class=\"postBody\">\n<div id=\"cnblogs_post_body\">\n<p>\u5728Ubuntu\u7cfb\u7edf\u4e0a\u60f3\u8981\u901a\u8fc7ipv6\u6765\u4e0a\u7f51\uff0c\u7ed3\u679c\u53d1\u73b0\u901a\u8fc7DHCP\u83b7\u53d6\u5230\u4e86ipv6\u5730\u5740\u5374\u65e0\u6cd5\u8fde\u63a5\u5916\u7f51\u3002<\/p>\n<div class=\"cnblogs_code\">\n<pre>ping6 ipv6.google.com<\/pre>\n<\/div>\n<p>\u6570\u636e\u5305\u6709\u53bb\u65e0\u56de\uff0c100% loss \u3002<\/p>\n<p>\u5947\u602a\u7684\u662f\u901a\u8fc7DSL PPPoE\u62e8\u53f7\u8fde\u63a5\u663e\u793a\u4e24\u4e2aglobal\u7684ip\uff1a<\/p>\n<div class=\"cnblogs_code\">\n<pre>ifconfig ppp0\n\n\u3000\u3000inet6 \u5730\u5740: 2001:250:1006:dff0:4913:2aa5:8075:7c01\/64 Scope:Global\n\u3000\u3000inet6 \u5730\u5740: 2001:250:1006:dff0:99b1:935b:57a5:9b10\/64 Scope:Global\n\u3000\u3000inet6 \u5730\u5740: fe80::99b1:935b:57a5:9b10\/10 Scope:Link<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u901a\u8fc7traceroute6\u53d1\u73b0\u6570\u636e\u5305\u4ece\u5c3e\u53f7\u4e3a7c01\u7684\u90a3\u4e2a\u5730\u5740\u53d1\u51fa\u7684\uff08\u8bb0\u4e3a\u5730\u5740A),\u901a\u8fc7\u67e5\u8be2\u5b66\u6821\u7684\u8ba1\u8d39\u8ba4\u8bc1\u670d\u52a1\u5668\u7684web\u9875\u9762\u770b\u5230\u5b9e\u9645\u5206\u914d\u7ed9\u6211\u7684ip\u53ea\u6709\u90a3\u4e2a\u5c3e\u53f7\u4e3a9b10\u7684\u5730\u5740\uff08\u5730\u5740B\uff09\u3002<\/p>\n<p>\u7b2c\u4e00\u6b21\u9047\u5230\u8fd9\u79cd\u60c5\u51b5\uff0c\u5f88\u4e0d\u7406\u89e3\u3002\u4e8e\u662f\u60f3\u5c06\u5730\u5740A\u76f4\u63a5\u5e72\u6389\uff0c\u628a\u5b83\u5c4f\u853d\u6216\u5220\u6389\u3002\u4e8e\u662f\u641c\u7d22\u5220\u9664\u5df2\u83b7\u53d6ip\u7684\u65b9\u6cd5\uff0c\u53d1\u73b0ip\u547d\u4ee4\u7684del\u53c2\u6570\u53ef\u4ee5\uff1a<\/p>\n<div class=\"cnblogs_code\">\n<pre>ip -6 addr show ppp0  #\u663e\u793a\u51fa\u6307\u5b9a\u63a5\u53e3\u7684ipv6\nip -6 addr del \u5730\u5740A dev ppp0 #\u6216\u8005\u4f7f\u7528 ifconfig \u63a5\u53e3 inet6 del v6\u5730\u5740<\/pre>\n<\/div>\n<p>\u5c06\u5730\u5740A\u5220\u6389\u540e\u53ef\u4ee5\u6210\u529f\u4e0aipv6\u7684\u7f51\u7ad9\u4e86\uff0c\u53ef\u662f\u9ad8\u5174\u4e86\u6ca1\u51e0\u5206\u949f\u53c8\u4e0a\u4e0d\u4e86\u4e86\uff0c\u5730\u5740\u53c8\u56de\u6765\u4e86\u3002<br \/>\n<!--more--><\/p>\n<p>\u6ce8\u610f\u5230ip show\u663e\u793a\u7684\u5730\u5740A\u662fscope global temporary dynamic\u7684\uff0c\u5c45\u7136\u662f\u4e2a\u4e34\u65f6\u5730\u5740\u3002<\/p>\n<p>\u7ee7\u7eed\u641c\u7d22\u4ec0\u4e48\u662f\u4e34\u65f6\u5730\u5740\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528\u4e34\u65f6\u5730\u5740\u3002\u3002\u3002<\/p>\n<p>\u5927\u6982\u610f\u601d\u662f\u4e0d\u60f3\u56fa\u5b9a\u4e00\u4e2a\u8bbe\u5907\u7684ip\uff0c\u9632\u6b62\u88ab\u8ffd\u8e2a\u5b9a\u4f4d\uff0c\u4e3a\u4e86\u9690\u79c1\u8003\u8651\u3002\u56e0\u4e3a\u4f7f\u7528ipv6\u5730\u5740\u65e0\u9700\u50cfipv4\u4e00\u6837\u4f7f\u7528NAT\u516c\u7528\u4e00\u4e2aip\uff0c\u8bbe\u5907\u95f4\u8fde\u63a5\u66f4\u5bb9\u6613\uff0c\u4f46\u5bb9\u6613\u9020\u6210\u9690\u79c1\u6cc4\u6f0f\u3002\u4e3a\u6b64\u64cd\u4f5c\u7cfb\u7edf\u53ef\u4ee5\u9009\u7528\u591a\u4e2a\u4e34\u65f6ip\uff0c\u6bcf\u4e2aip\u6709\u56fa\u5b9a\u7684\u751f\u547d\u5468\u671f\u3002ipv6\u81ea\u52a8\u914d\u7f6e\u65f6\u4f7f\u7528\u4f60\u7684MAC\u5730\u5740\u6765\u9009\u62e9\u4e00\u4e2aip\u5730\u5740\uff0c\u8fd9\u6837\u5176\u5b83\u8bbe\u5907\u6839\u636e\u4f60\u7684ip\u5730\u5740\u53ef\u80fd\u4f1a\u7b97\u51fa\u4f60\u7684mac\u5730\u5740\uff08\u5168\u7403\u552f\u4e00)\u3002<\/p>\n<p>\u8fd9\u786e\u5b9e\u662f\u4e0d\u9519\u7684\u505a\u6cd5\uff0c\u73b0\u5728\u7684\u7591\u95ee\u5c31\u662f\u8fd9\u4e9b\u4e34\u65f6ip\u7684\u751f\u6210\u548c\u4f7f\u7528\u673a\u5236\u662f\u4ec0\u4e48\u4ee5\u53ca\u6211\u73b0\u5728\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u7528\u5b83\u6765\u4e0a\u7f51\uff1f<\/p>\n<p>\u53ea\u4e86\u89e3\u5230\u4e34\u65f6\u5730\u5740\u7684\u4f5c\u7528\u662f\u5728\u7528\u6237\u5bf9\u5916\u53d1\u8d77\u8fde\u63a5\u7684\u65f6\u5019\u5145\u5f53\u8fde\u63a5\u53d1\u8d77\u7684IPv6\u5730\u5740\uff0c\u8fd9\u4e00\u884c\u4e3a\u7684\u76ee\u7684\u5728\u4e8e\u4fdd\u8bc1\u4e3b\u673a\u5728\u5bf9\u5916\u901a\u4fe1 \u65f6\u5019\u7684\u533f\u540d\u6027\u3002\u8fd9\u4e2a\u5730\u5740\u662f\u7531\u8def\u7531\u524d\u7f00\u548c\u7531\u4e3b\u673a\u968f\u673a\u751f\u6210\u7684\u63a5\u53e3\u6807\u8bc6\u7ec4\u6210\u7684\u3002\u8fd9\u4e2a\u5730\u5740\u662f\u6709\u6709\u6548\u671f\u9650\u5236\u7684\uff0c\u51e0\u4e2a\u5c0f\u65f6\u6216\u8005\u51e0\u5929\uff0c\u5728\u671f\u95f4\uff0c\u7cfb\u7edf\u4e00\u76f4\u4ee5\u8fd9\u4e2a\u5730\u5740\u4e3a\u4e3b\u673a \u5730\u5740\u5411\u5916\u53d1\u51fa\u8fde\u63a5\u548c\u8bf7\u6c42\u3002\u6bcf\u4e00\u4e2a\u65f6\u523b\u53ea\u6709\u4e00\u4e2a\u4e34\u65f6\u5730\u5740\u662f\u6709\u6548\u7684\uff0c\u5728\u4e00\u4e2a\u5730\u5740\u8fc7\u671f\u65f6\u4f1a\u7acb\u523b\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u5730\u5740\u4f5c\u4e3a\u65b0\u7684\u4e34\u65f6\u5730\u5740\u3002\u5df2\u7ecf\u8fc7\u671f\u7684\u5730\u5740\u4e0d\u4f1a\u7acb\u5373\u88ab\u5220\u9664\uff0c\u5b83\u4f1a\u4fdd\u5b58\u51e0\u4e2a\u5c0f\u65f6\u6216\u8005\u51e0\u5929\uff0c\u6b64\u65f6\u8fc7\u671f\u7684\u4e34\u65f6\u5730\u5740\u4e0d\u80fd\u5bf9\u5916\u53d1\u8d77\u8fde\u63a5\uff0c\u4f46\u662f\u53ef\u4ee5\u63a5\u53d7\u5916\u90e8\u53d1\u6765\u7684\u4e4b\u524d\u8bf7\u6c42\u7684\u4fe1\u606f\u3002\u4e0b\u9762\u7f51\u7ad9\u4e0a\u6307\u51fa\u5728 RFC 3041 \u4e2d\u63cf\u8ff0\u4e86\u4e00\u79cd\u5907\u7528\u7684 IPv6 \u63a5\u53e3\u6807\u8bc6\uff0c\u5b83\u662f\u968f\u673a\u751f\u6210\u7684\uff0c\u5e76\u4e14\u968f\u65f6\u95f4\u53d8\u5316\u800c\u53d8\u5316\u3002<\/p>\n<p><a href=\"https:\/\/msdn.microsoft.com\/zh-cn\/library\/cc736439(v=ws.10).aspx\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/msdn.microsoft.com\/zh-cn\/library\/cc736439(v=ws.10).aspx<\/a><\/p>\n<p>\u81f3\u4e8e\u4e3a\u4ec0\u4e48\u5728\u6211\u7535\u8111\u4e0a\u4f7f\u7528\u4e34\u65f6\u5730\u5740\u65e0\u6cd5\u8fde\u63a5\u8fd8\u4e0d\u5f97\u77e5\uff0c\uff0c\uff0c<\/p>\n<p>\u5f53\u52a1\u4e4b\u6025\u662f\u628a\u4e34\u65f6ip\u7ed9\u53d6\u6d88\u6389\uff0c\u672c\u6765\u83b7\u53d6\u5230\u7684ip\u5c31\u662f\u52a8\u6001\u7684\uff0c\u4e5f\u65e0\u9700\u8fd9\u4e48\u6ce8\u91cd\u9690\u79c1\uff0c\u51b5\u4e14\u73b0\u5728\u5927\u591a\u6570\u670d\u52a1\u5668\u90fd\u662f\u7528\u9759\u6001ip\u554a\u3002<\/p>\n<p>\u539f\u6765ubuntu\u7684\u591a\u4e2a\u7248\u672c\u90fd\u662f\u5982\u4e0b\uff08linux\u5185\u6838\u53c2\u6570\uff0c\u53ef\u4f7f\u7528cat\u3001echo\u6765\u67e5\u770b\u4fee\u6539\/proc\/sys\uff09\uff1a<\/p>\n<div class=\"cnblogs_code\">\n<pre>sudo sysctl -a | grep tempaddr\n    net.ipv6.conf.all.use_tempaddr = 2\n    net.ipv6.conf.default.use_tempaddr = 2\n    net.ipv6.conf.eth0.use_tempaddr = 2\n    net.ipv6.conf.lo.use_tempaddr = 2<\/pre>\n<\/div>\n<p>\u503c\u4e3a2\u8868\u793a\u7cfb\u7edf\u6253\u5f00\u4e86\u8be5\u9009\u9879\u5e76\u4e14\u5728\u5efa\u7acb\u8fde\u63a5\u65f6\u4f18\u5148\u4f7f\u7528\u4e34\u65f6\u5730\u5740\u3002<\/p>\n<pre>\u53ea\u9700\u6539\u4e3a0\u5e76\u91cd\u542f\u5373\u53ef\uff08\u91cd\u542f\u7f51\u7edc\uff09\uff0c\n\u6267\u884csudo sysctl net.ipv6.conf.ppp0.use_tempaddr=0 \u53ef\u4ee5\u4e34\u65f6\u6539\u53d8ppp0\u63a5\u53e3\u7684use_tempaddr\u7684\u503c\u3002\n\u7136\u800c\u5728\u6267\u884c\u4e0b\u5217\u547d\u4ee4\u65f6\u53c8\u88ab\u91cd\u7f6e\u4e3a2\u3002\n\u3000\u3000sudo \/etc\/init.d\/networking restart #\u624b\u52a8\u914d\u7f6e\u7684\u7f51\u7edc\n\u3000\u3000sudo pkill NetworkManager ;\u3000sudo NetworkManager #NetworkManager\u6258\u7ba1\u7684 \uff09\n\u4e00\u52b3\u6c38\u9038\u7684\u65b9\u5f0f\u4e3a\n\u5c1d\u8bd5\u5c06net.ipv6.conf.all.use_tempaddr=0\u5199\u5165\/etc\/sysctl.conf\nsysctl -p  #\u8bfb\u53d6sysctl.conf\u4f7f\u65b0\u8bbe\u7f6e\u751f\u6548,\u4f46\u5e76\u4e0d\u52a0\u8f7dsysctl.d\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\nsysctl --system #\u52a0\u8f7d\u6240\u6709\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u50cf\/etc\/sysctl.d\/*\u7b49<\/pre>\n<pre>\u91cd\u542f\u4e4b\u540e\u53d1\u73b0\u4e0d\u518d\u4ea7\u751f\u4e34\u65f6\u5730\u5740\u4e86\uff0c\u8fc7\u4e86\u51e0\u4e2a\u6708\uff0c\u5728\u6211\u5347\u7ea7\u5185\u6838\u4e4b\u540e\u53d1\u73b0\u4e0a\u8ff0\u505a\u6cd5\u4e0d\u53ef\u884c\u4e86\u3002\n\u53d1\u73b0\/etc\/sysctl.d\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u6709\u4e2a10-ipv6-privacy.conf \u5185\u5bb9\u5982\u4e0b\uff1a<\/pre>\n<div class=\"cnblogs_code\">\n<pre>1 # IPv6 Privacy Extensions (RFC 4941)\n2 # ---\n3 # IPv6 typically uses a device's MAC address when choosing an IPv6 address\n4 # to use in autoconfiguration. Privacy extensions allow using a randomly\n5 # generated IPv6 address, which increases privacy.\n6 #\n7 # Acceptable values:\n8 # 0 - don\u2019t use privacy extensions.\n9 # 1 - generate privacy addresses\n10 # 2 - prefer privacy addresses and use them over the normal addresses.\n11 net.ipv6.conf.all.use_tempaddr = 2\n12 net.ipv6.conf.default.use_tempaddr = 2<\/pre>\n<\/div>\n<pre>\u5c06net.ipv6.conf.default.use_tempaddr\u6539\u4e3a0\u540e\n\u6267\u884csysctl --system\u91cd\u65b0\u62e8\u53f7\u8fde\u63a5\uff0c\u5c31\u4e0d\u518d\u6709\u4e34\u65f6\u5730\u5740\u4e86\u3002<\/pre>\n<p>\u4e0d\u6e05\u695aall\u4e0edefault\u7684\u533a\u522b\uff0c\u4f3c\u4e4e\u662fall\u7684\u8bbe\u7f6e\u4f1a\u88ab\u7279\u5b9a\u63a5\u53e3\u7684\u8bbe\u7f6e\u8986\u76d6\uff0cdefault\u7684\u503c\u5728\u5185\u6838\u542f\u52a8\u65f6\u8bbe\u7f6e\u3002<\/p>\n<p>\u5728<a href=\"http:\/\/tldp.org\/HOWTO\/Linux+IPv6-HOWTO\/proc-sys-net-ipv6..html\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/tldp.org\/HOWTO\/Linux+IPv6-HOWTO\/proc-sys-net-ipv6..html<\/a>\u00a0\u4e0a\u9762\u5199\u7740\uff1a<\/p>\n<div class=\"SECT2\">\n<h2 class=\"SECT2\">conf\/default\/*<\/h2>\n<p>Change the interface-specific default settings.<\/p>\n<\/div>\n<div class=\"SECT2\">\n<h2 class=\"SECT2\">conf\/all\/*<\/h2>\n<p>Change all the interface-specific settings.<\/p>\n<p>Exception: <em>conf\/all\/forwarding<\/em> has a different meaning here<\/p>\n<p>\uff08\u8bbe\u7f6eipv6\u8f6c\u53d1\u7684all.forwarding\u53c2\u6570\u6709\u70b9\u7279\u6b8a\uff0c\u5982\u679c\u8bbe\u4e3a0\u5219\u5168\u5c40\u7981\u6b62\u4e86\u6570\u636e\u5305\u8f6c\u53d1\uff0c\u4f60\u4e0d\u80fd\u4e3a\u6bcf\u4e2a\u8bbe\u5907\u63a5\u53e3\u8bbe\u7f6e\u4e0d\u540c\u7684\u8f6c\u53d1\u5f00\u5173\u3002\u8fd9\u8ddfipv4\u4e0d\u540c\u3002\uff09<\/p>\n<\/div>\n<pre>\n\n\u53c2\u8003\u94fe\u63a5\uff1a\n<a href=\"https:\/\/www.ipsidixit.net\/2012\/08\/09\/ipv6-temporary-addresses-and-privacy-extensions\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.ipsidixit.net\/2012\/08\/09\/ipv6-temporary-addresses-and-privacy-extensions\/<\/a>\n<a href=\"https:\/\/www.hpc.mil\/index.php\/2013-08-29-16-03-23\/networking-overview\/2013-10-03-17-24-38\/ipv6-knowledge-base-ip-transport\/enabling-ipv6-in-debian-and-ubuntu-linux\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.hpc.mil\/index.php\/2013-08-29-16-03-23\/networking-overview\/2013-10-03-17-24-38\/ipv6-knowledge-base-ip-transport\/enabling-ipv6-in-debian-and-ubuntu-linux<\/a>\n<a href=\"https:\/\/asininetech.com\/2014\/04\/17\/ubuntu-14-04-server-and-ipv6-temporary-addresses\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/asininetech.com\/2014\/04\/17\/ubuntu-14-04-server-and-ipv6-temporary-addresses\/<\/a>\n<a href=\"http:\/\/blog.csdn.net\/eddy_liu\/article\/details\/7166165\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/ipv6int.net\/systems\/linux-ipv6.html#privacy\nhttp:\/\/blog.csdn.net\/eddy_liu\/article\/details\/7166165\n<\/a><\/pre>\n<\/div>\n<\/div>\n<div class=\"postBody\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>linux ipv6\u4e34\u65f6\u5730\u5740 \u00a0http:\/\/www.cnblogs.com\/m &hellip; <a href=\"https:\/\/nas1.xyz1943.net\/wordpress\/2016\/06\/16\/%e8%bd%89%e8%b2%bc-%e5%81%9c%e6%8e%89-linux-ipv6%e4%b8%b4%e6%97%b6%e5%9c%b0%e5%9d%80\/\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/posts\/371"}],"collection":[{"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/comments?post=371"}],"version-history":[{"count":0,"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/posts\/371\/revisions"}],"wp:attachment":[{"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/media?parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/categories?post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nas1.xyz1943.net\/wordpress\/wp-json\/wp\/v2\/tags?post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}