{"id":192152,"date":"2020-11-03T20:00:41","date_gmt":"2020-11-03T12:00:41","guid":{"rendered":"http:\/\/4563.org\/?p=192152"},"modified":"2020-11-03T20:00:41","modified_gmt":"2020-11-03T12:00:41","slug":"x86-%e8%bd%af%e8%b7%af%e7%94%b1%e9%85%8d%e7%bd%ae-ipv6-%e8%b8%a9%e5%9d%91%e5%b0%8f%e8%ae%b0","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=192152","title":{"rendered":"X86 \u8f6f\u8def\u7531\u914d\u7f6e IPv6 \u8e29\u5751\u5c0f\u8bb0"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  X86 \u8f6f\u8def\u7531\u914d\u7f6e IPv6 \u8e29\u5751\u5c0f\u8bb0               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xarthur <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u539f\u6587\u8fde\u63a5<\/p>\n<h2>\u80cc\u666f\u6545\u4e8b<\/h2>\n<p>\u8fd9\u4e00\u6b21\u8e29\u5751\u4e4b\u65c5\u7684\u8d77\u6e90\u662f\u4e00\u6bb5\u6765\u81ea\u5185\u6838\u6050\u614c Telegram \u7fa4\u7684\u5173\u4e8e IPv6 \u7684\u8ba8\u8bba\uff0cRio \u53d1\u4e86\u5173\u4e8e\u4ed6\u914d\u7f6e IPv6 \u65f6\u5019\u7684\u8e29\u5751\u5e16\u5b50\uff0c\u800c\u6211\u6b63\u597d\u4e00\u76f4\u60f3\u628a\u5bb6\u91cc\u8f6f\u8def\u7531\u7684 IPv6 \u914d\u7f6e\u8d77\u6765\uff0c\u5c31\u6709\u4e86\u8fd9\u4e00\u6b21\u7ecf\u5386\u3002\u8fd9\u91cc\u975e\u5e38\u611f\u8c22 Rio \u548c\u542c\u4f17\u7fa4\u7684\u670b\u53cb\uff0c\u6ca1\u6709\u4ed6\u4eec\u7684\u5e2e\u52a9\u4e5f\u5c31\u6ca1\u6709\u8fd9\u6b21\u7684\u7ecf\u5386\u3002<\/p>\n<h2>\u5173\u4e8e IPv6 \u7684\u5c0f\u4ecb\u7ecd<\/h2>\n<p>\u5728\u5f00\u59cb\u914d\u7f6e\u73af\u5883\u4e4b\u524d\uff0c\u6211\u60f3\u5148\u505a\u4e00\u4e2a\u5173\u4e8e IPv6 \u7684\u5c0f\u4ecb\u7ecd\u3002\u4ecb\u7ecd\u4e00\u4e0b\u4e4b\u540e\u4f1a\u6d89\u53ca\u5230\u7684\u4e00\u4e9b\u6982\u5ff5\uff0c\u6bd4\u5982\uff1aRA\uff0cslaac \u7b49\u3002\u8fd9\u4e2a\u4ecb\u7ecd\u4e0d\u4f1a\u6d89\u53ca\u5230 IPv6 \u6574\u4f53\u662f\u600e\u4e48\u5de5\u4f5c\u7684\uff0c\u4e3b\u8981\u4ecb\u7ecd\u4e00\u4e0b\u5728 IPv6 \u8bbe\u5907\u662f\u5982\u4f55\u83b7\u53d6 IPv6 \u5730\u5740\u7684\u3002<\/p>\n<p>\u5728\u5f00\u59cb\u4ecb\u7ecd\u5728 IPv6 \u73af\u5883\u4e4b\u524d\uff0c\u5f97\u5148\u4ecb\u7ecd\u4e00\u4e0b\u4ec0\u4e48\u662f RA \u3002RA \u4e5f\u5c31\u662f\uff1aRouter Advertisement \uff08\u8def\u7531\u5668\u901a\u544a\u62a5\u6587\uff09\u662f\u4e00\u79cd ICMPv6 \u62a5\u6587\uff0cICMP \u4e5f\u5c31\u662f\u6211\u4eec\u65e5\u5e38 Ping \u547d\u4ee4\u4f7f\u7528\u7684\u62a5\u6587\u3002\u5728 IPv6 \u70b9\u73af\u5883\u4e2d\u8def\u7531\u53d1\u51fa\u7684 RA \u4f1a\u643a\u5e26\u4e00\u7cfb\u5217\u7684\u4fe1\u606f\u544a\u77e5\u8bbe\u5907\u5982\u4f55\u914d\u7f6e\u81ea\u5df1\u7684 IP \u5730\u5740\u3002<\/p>\n<p>\u5728 IPv6 \u4e2d\u6709\u591a\u79cd\u81ea\u52a8\u914d\u7f6e IP \u7684\u65b9\u5f0f\uff0c\u8fd9\u91cc\u6211\u4eec\u53ea\u4f1a\u63a5\u89e6\u5230 slaac \u548c DHCPv6\uff0c\u4e0b\u9762\u6709\u4e2a\u5173\u4e8e\u8fd9\u4e24\u79cd\u65b9\u5f0f\u533a\u522b\u7684\u89e3\u91ca\u3002<\/p>\n<blockquote>\n<p><strong>\u5176\u4e2d\u201c\u81ea\u52a8\u914d\u7f6e\u201d\u6839\u636e\u83b7\u53d6\u65b9\u5f0f\uff0c\u53c8\u5206\u4e3a<\/strong><\/p>\n<p>\u25b7 \u65e0\u72b6\u6001\uff08 Stateless \uff09\uff1a\u6839\u636e\u8def\u7531\u901a\u544a\u62a5\u6587 RA \uff08 Router Advertisement \uff09\u5305\u542b\u7684 prefix \u524d\u7f00\u4fe1\u606f\u81ea\u52a8\u914d\u7f6e IPv6 \u5730\u5740\uff0c\u7ec4\u6210\u65b9\u5f0f\u662f Prefix + (EUI64 or \u968f\u673a)\u3002Stateless \u4e5f\u53ef\u4ee5\u79f0\u4e3a SLAAC \uff08 Stateless address autoconfiguration \uff09<\/p>\n<p>\u25b7 \u6709\u72b6\u6001\uff08 Stateful \uff09\uff1a\u901a\u8fc7 DHCPv6 \u65b9\u5f0f\u83b7\u5f97 IPv6 \u5730\u5740<\/p>\n<p>\u2014\u2014IPv6 \u7cfb\u5217-\u8be6\u89e3\u81ea\u52a8\u5206\u914d IPv6 \u5730\u5740<\/p>\n<\/blockquote>\n<p>\u56e0\u4e3a\u5b89\u5353\u8bbe\u5907\u53ea\u652f\u6301 slaac\uff0c\u6240\u4ee5\u6211\u4f7f\u7528\u4e86 slaac \u65b9\u5f0f\u914d\u7f6e\u5c40\u57df\u7f51\u5185\u8bbe\u5907\u7684 IP \u3002<\/p>\n<h2>\u73af\u5883<\/h2>\n<p>\u6211\u8fd9\u91cc\u4f7f\u7528\u7cfb\u7edf\u662f\uff1a<\/p>\n<pre><code>Linux version 4.19.0-9-amd64 ([email&#160;protected]) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) <\/code><\/pre>\n<p>\u673a\u5668\u672c\u8eab\u662f\u4e00\u53f0\u56db\u4e2a\u7f51\u53e3\u7684\u8f6f\u8def\u7531\u3002<\/p>\n<p>\u4e0a\u7f51\u65b9\u5f0f\u662f PPPoE \u62e8\u53f7\u4e0a\u7f51<\/p>\n<h2>\u73af\u5883\u914d\u7f6e<\/h2>\n<p>\u9996\u5148\u914d\u7f6e\u7f51\u5361\u3002<\/p>\n<p><code>\/etc\/network\/interfaces<\/code><\/p>\n<pre><code>source \/etc\/network\/interfaces.d\/*  # \u672c\u5730\u63a5\u53e3 auto lo iface lo inet loopback  # \u5e7f\u57df\u7f51\u63a5\u53e3 allow-hotplug enp1s0  # \u5c40\u57df\u7f51\u63a5\u53e3 auto br0 allow-hotplug br0 iface br0 inet static       address 192.168.2.1       network 192.168.2.0       netmask 255.255.255.0       brocast 192.168.2.255       bridge-ports enp2s0 enp3s0 enp4s0        # PPPoE \u63a5\u53e3\uff0c\u7531 pppoeconf \u81ea\u52a8\u751f\u6210 auto dsl-provider iface dsl-provider inet ppp pre-up \/bin\/ip link set enp1s0 up # line maintained by pppoeconf provider dsl-provider iface enp1s0 inet manual <\/code><\/pre>\n<p>\u8fd9\u91cc\u662f\u6211\u7684\u7684\u8f6f\u8def\u7531\u7684\u63a5\u53e3\u914d\u7f6e\uff0c\u53ef\u4ee5\u770b\u5230\u51fa\u53e3\u7f51\u5361\u662f enp1s0\uff0c\u6211\u4f1a\u901a\u8fc7\u8fd9\u4e2a\u7f51\u5361\u8fdb\u884c PPPoE \u62e8\u53f7\u4e0a\u7f51\u3002\u8fd9\u4e2a\u914d\u7f6e\u6700\u540e\u7684 <code>dsl-provider<\/code> \u662f\u7531 pppoeconf \u81ea\u52a8\u751f\u6210\u7684\uff0c\u6211\u4eec\u4e4b\u540e\u4f1a\u8bb2\u5230\u3002<\/p>\n<p>\u8bf7\u6ce8\u610f\uff0c\u5728\u8fd9\u91cc\u4e0d\u8981\u914d\u7f6e DHCP \u8fde\u63a5\uff0c\u4e0d\u7136\u5185\u7f6e\u7684 dhclient \u4f1a\u548c\u4e4b\u540e\u6211\u4eec\u7528\u5230\u7684 <code>wide-dhcpv6-client<\/code> \u51b2\u7a81\u3002<\/p>\n<p>\u56e0\u4e3a\u6211\u4eec\u662f\u8981\u914d\u7f6e\u8f6f\u8def\u7531\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u542f\u7528 IPv6 \u8f6c\u53d1\u3002<\/p>\n<p>\u5728 <code>\/etc\/sysctl.conf<\/code> \u6dfb\u52a0\u4e0a\uff1a<\/p>\n<pre><code>net.ipv6.conf.all.forwarding=2 net.ipv6.conf.default.forwarding=2  net.ipv6.conf.all.accept_ra=2 net.ipv6.conf.default.accept_ra=2  net.ipv6.conf.all.use_tempaddr=2 net.ipv6.conf.default.use_tempaddr=2 <\/code><\/pre>\n<p>\u6211\u4eec\u901a\u8fc7\u8bbe\u7f6e: <code>net.ipv6.conf.all.forwarding=2<\/code> \u548c <code>net.ipv6.conf.default.forwarding=2<\/code> \u542f\u7528\u4e86 IPv6 \u8f6c\u53d1\uff0c\u4f46\u662f\u6839\u636e\u6ce8\u91ca\uff1a<\/p>\n<blockquote>\n<p>Uncomment the next line to enable packet forwarding for IPv6<\/p>\n<p>Enabling this option disables Stateless Address Autoconfiguration<\/p>\n<p>based on Router Advertisements for this host<\/p>\n<\/blockquote>\n<p>\u5f00\u542f\u4e86\u8fd9\u4e2a\u9009\u9879\u4e4b\u540e\uff0c\u7cfb\u7edf\u5c06\u4e0d\u4f1a\u8fdb\u884c RA \u5904\u7406\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u7684\u5e7f\u57df\u7f51\u5c06\u4e0d\u4f1a\u6709 IPv6 \u5730\u5740\uff0c\u6240\u4ee5\u6211\u4eec\u8fd9\u91cc\u624b\u52a8\u8bbe\u7f6e\u4e86\uff1a<code>net.ipv6.conf.all.accept_ra=2<\/code> \u548c <code>net.ipv6.conf.default.accept_ra=2<\/code> \u6765\u542f\u7528 RA \u5904\u7406\u3002<\/p>\n<p>\u6700\u540e\u4e24\u884c\u662f\u542f\u7528 IPv6 \u7684\u9690\u79c1\u6269\u5c55\uff0c\u5177\u4f53\u53ef\u4ee5\u9605\u8bfb Arch Wiki \u7684\u76f8\u5173\u4ecb\u7ecd\u3002<\/p>\n<p>\u56e0\u4e3a RA \u662f ICMPv6 \u62a5\u6587\uff0c\u6240\u4ee5\u6211\u4eec\u8981\u5728\u9632\u706b\u5899\u4e0a\u5141\u8bb8 ICMPv6 \u7684\u901a\u8fc7\u3002<\/p>\n<pre><code>iptables -A INPUT -p ipv6-icmp -j ACCEPT iptables -A FORWARD -p ipv6-icmp -j ACCEPT iptables -A OUTPUT -p ipv6-icmp -j ACCEPT ip6tables -A INPUT -p ipv6-icmp -j ACCEPT ip6tables -A FORWARD -p ipv6-icmp -j ACCEPT ip6tables -A OUTPUT -p ipv6-icmp -j ACCEPT <\/code><\/pre>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u6765\u914d\u7f6e PPPoE \u4e0a\u7f51\uff0c\u8fd0\u884c:<\/p>\n<pre><code>apt install pppoeconf <\/code><\/pre>\n<p>\u5728\u5b89\u88c5 <code>pppoeconf<\/code> \u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u5b89\u88c5 <code>pppd<\/code>\uff0c<code>pppoeconf<\/code> \u662f\u4e2a\u5e2e\u52a9\u4f60\u914d\u7f6e <code>pppd<\/code> \u7684\u5c0f\u5de5\u5177\uff0c\u5b89\u88c5\u5b8c\u6210\u540e\u8f93\u5165\uff1a<\/p>\n<pre><code>pppoeconf <\/code><\/pre>\n<p>\u7136\u540e\u6309\u7167\u6307\u793a\u8f93\u5165\u4f60\u5bbd\u5e26\u7684\u8d26\u53f7\u5bc6\u7801\uff0c\u5982\u679c\u5176\u4ed6\u9009\u9879\u7684\u542b\u4e49\u4e0d\u6e05\u695a\u8bf7\u9009\u62e9\u9ed8\u8ba4\uff0c\u5728\u914d\u7f6e\u6210\u529f\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7: <code>poff<\/code>\uff0c<code>pon<\/code> \u548c <code>plog<\/code>\uff0c\u6765\u5173\u95ed\u3001\u5f00\u542f PPoE \u4ee5\u53ca\u663e\u793a log \u3002<\/p>\n<p>\u4f46\u662f\u5728\u9ed8\u8ba4\u7684\u60c5\u51b5\u4e0b\uff0c<code>pppoeconf<\/code> \u81ea\u52a8\u751f\u6210\u7684\u914d\u7f6e\u6587\u4ef6\u4e0d\u4f1a\u542f\u7528 IPv6\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u5bf9\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u4e00\u4e9b\u4fee\u6539\u3002<\/p>\n<p>\u914d\u7f6e\u6587\u4ef6\u5728 <code>\/etc\/ppp\/peers\/<\/code> \u76ee\u5f55\u4e0b\uff0c\u6211\u8fd9\u91cc\u81ea\u52a8\u751f\u6210\u7684\u662f <code>dsl-provider<\/code>\u3002<\/p>\n<p><code>\/etc\/ppp\/peers\/dsl-provider<\/code><\/p>\n<pre><code>noipdefault defaultroute replacedefaultroute hide-password noauth persist persist maxfail 0 plugin rp-pppoe.so nic-enp1s0 user \"\u5bbd\u5e26\u8d26\u53f7\" usepeerdns +ipv6 debug <\/code><\/pre>\n<p>\u8fd9\u91cc\u6211\u5728\u672b\u5c3e\u6dfb\u52a0\u4e0a\u4e86<code>+ipv6<\/code>\uff0c\u8bf7\u6ce8\u610f\u52a0\u53f7\uff0c\u5176\u6b21\u6211\u8fd8\u6dfb\u52a0\u4e0a\u4e86 <code>debug<\/code>\uff0c\u7528\u4e8e\u4e4b\u540e\u4f7f\u7528 <code>plog<\/code> \u6765 Debug \u95ee\u9898\uff0c\u6b64\u65f6\u4f60\u91cd\u65b0\u542f\u52a8 PPPoE\uff0c\u7136\u540e\u8f93\u5165 <code>ip addr show ppp0<\/code>\uff0c\u89c2\u5bdf <code>ppp0<\/code> \u63a5\u53e3\u5e94\u8be5\u5c31\u80fd\u770b\u5230\u5206\u914d\u7684 IPv6 \u5730\u5740\u4e86\uff0c\u56e0\u4e3a\u6211\u4eec\u542f\u7528\u4e86\u9690\u79c1\u6269\u5c55\uff0c\u6240\u4ee5\u4f60\u80fd\u770b\u5230\u6709\u4e24\u4e2a IPv6 \u5730\u5740\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/11\/20201115_5fb0f8eb82e18.jpg\" alt=\"X86 \u8f6f\u8def\u7531\u914d\u7f6e IPv6 \u8e29\u5751\u5c0f\u8bb0\" \/><\/p>\n<p>\u63a5\u4e0b\u6765\u6211\u4eec\u9700\u8981\u7ed9\u5185\u7f51\u8bbe\u5907\u4e5f\u5206\u914d\u5bf9\u5e94\u7684 IPv6 \u5730\u5740\u3002\u8fd9\u91cc\u6211\u4eec\u7528\u5230\u4e86 Prefix delegation \uff08\u524d\u7f00\u4ee3\u7406\uff09\uff0c\u7b80\u79f0 PD \u3002\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u6211\u4eec\u5411\u6211\u4eec\u7684\u4e0a\u7ea7\u8def\u7531\u53d1\u9001 PD \u8bf7\u6c42\uff0c\u4e0a\u7ea7\u8def\u7531\u4f1a\u5206\u7ed9\u6211\u4eec\u4e00\u4e2a\u524d\u7f00\u957f\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 64 \u7684\u7f51\u6bb5\uff0c\u7136\u540e\u6211\u4eec\u5c31\u80fd\u5c06\u4e2a\u7f51\u6bb5\u5212\u5206\u6210\u4e00\u4e2a\u6216\u8005\u4e00\u4e9b \/64 \u7684\u7f51\u6bb5\u63a5\u7740\u5411\u5c40\u57df\u7f51\u5185\u7684\u8bbe\u5907\u5206\u914d\uff0c\u6b64\u65f6\u5c40\u57df\u7f51\u5185\u7684\u8bbe\u5907\u7684\u4e0a\u7ea7\u8def\u7531\u5c31\u662f\u6211\u4eec\u7684\u7f51\u5173\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e2a\u9700\u8981\u6ce8\u610f\u7684\u5730\u65b9\uff0c\u6211\u4eec\u5411\u5c40\u57df\u7f51\u8bbe\u5907\u5206\u914d\u7684 IP \u5730\u5740\u4e5f\u662f\u516c\u7f51\u5730\u5740\uff0c\u800c\u4e0d\u662f IPv4 \u65f6\u4ee3\u7684\u79c1\u6709\u5730\u5740\uff0c\u4e0d\u8fc7\u56e0\u4e3a\u4e0a\u7ea7\u8def\u7531\u662f\u6211\u4eec\u7684\u7f51\u5173\uff0c\u6240\u4ee5\u8fd9\u4e9b\u8bbe\u5907\u5176\u5b9e\u662f\u5728\u4e00\u4e2a\u5c40\u57df\u7f51\u5185\uff0c\u5e76\u4e14\u56e0\u4e3a\u8fd9\u4e9b\u5730\u5740\u90fd\u662f\u516c\u7f51\u5730\u5740\uff0c\u6240\u4ee5\u6211\u4eec\u4e0d\u9700\u8981\u505a NAT \u8f6c\u5316\u7684\u64cd\u4f5c\u3002<\/p>\n<p>\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528 <code>wide-dhcpv6-client<\/code>\u3002<\/p>\n<p>\u9996\u5148\u5b89\u88c5\uff1a<\/p>\n<pre><code>apt install wide-dhcpv6-client <\/code><\/pre>\n<p>\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6e PD \u3002<\/p>\n<p>\u7f16\u8f91\uff1a<code>\/etc\/wide-dhcpv6\/dhcp6c.conf<\/code><\/p>\n<pre><code>interface ppp0 {   send ia-pd 0; }; id-assoc pd 0 {   # use the interface connected to your LAN   prefix-interface br0 {     sla-id 1;     sla-len 4;   }; }; <\/code><\/pre>\n<p>\u8fd9\u6bb5\u914d\u7f6e\u4e5f\u662f\u6765\u81ea Archi Wiki\uff0c\u5176\u4e2d\u7684 <code>ppp0<\/code> \u5e94\u8be5\u662f\u4f60\u5e7f\u57df\u7f51\u7684\u63a5\u53e3\uff0c\u800c <code>br0<\/code> \u5e94\u8be5\u662f\u4f60\u5c40\u57df\u7f51\u7684\u63a5\u53e3\uff0c\u5173\u4e8e <code>sla-len<\/code>\u7684\u957f\u5ea6\u6709\u4e2a\u6ce8\u91ca\u9700\u8981\u6ce8\u610f\uff1a<\/p>\n<blockquote>\n<p><strong>\u6ce8\u610f\uff1a<\/strong> <code>sla-len<\/code> \u5e94\u8bbe\u7f6e\u4e3a\u6ee1\u8db3 <code>(WAN-prefix) + (sla-len) = 64<\/code> \u7684\u503c\u3002\u8fd9\u91cc\u793a\u8303\u7684\u60c5\u51b5\u662f\u9488\u5bf9\u4e00\u4e2a\u957f\u5ea6 <code>\/56<\/code> \u7684\u524d\u7f00\uff0c56+8=64 \u3002\u5bf9\u4e8e\u524d\u7f00\u957f\u5ea6 <code>\/64<\/code> \u7684\u7f51\u7edc\uff0c<code>sla-len<\/code> \u5e94\u4e3a <code>0<\/code>\u3002<\/p>\n<\/blockquote>\n<p>\u56e0\u4e3a\u6211\u7684 ISP \u5206\u914d\u7684\u662f\u4e2a <code>\/60<\/code> \u7684\u7f51\u6bb5\uff0c\u6240\u4ee5 <code>sla-len<\/code> \u7684\u503c\u662f <code>4<\/code>\uff0c\u6211\u5efa\u8bae\u5927\u5bb6\u53ef\u4ee5\u5148\u586b\u6210 <code>0<\/code>\uff0c\u7136\u540e\u901a\u8fc7\u8fd0\u884c\uff1a<code>dhcp6c -f -D ppp0<\/code> \u547d\u4ee4\uff0c\u89c2\u5bdf\u4f60\u7684 ISP \u5206\u914d\u7684\u7f51\u6bb5\u5927\u5c0f\uff0c\u7136\u540e\u518d\u4fee\u6539\u5bf9\u5e94\u7684\u503c\u3002<\/p>\n<p>\u8fd9\u91cc\u975e\u5e38\u611f\u8c22 Rio \u63d0\u4f9b\u7684\u4e00\u4e2a\u65b0\u7684\u73b0\u4ee3\u5316\u7684 DHCP6c System Service \u7528\u6765\u66ff\u6362\u81ea\u5e26\u7684 <code>wide-dhcpv6-client.service<\/code> \u3002<\/p>\n<p>\u6dfb\u52a0\u5230 <code>\/etc\/systemd\/system\/dhcp6c.service<\/code>\u3002<\/p>\n<pre><code>[Unit] Description=WIDE DHCPv6 Client Wants=network-online.target After=network-online.target  [Service] ExecStart=\/usr\/sbin\/dhcp6c -f ppp0 ExecReload=\/bin\/kill -HUP $MAINPID Restart=on-failure RestartSec=3 NoNewPrivileges=yes PrivateTmp=yes ProtectHome=yes ProtectSystem=strict ReadWritePaths=\/run\/ \/var\/log\/ ProtectKernelTunables=yes ProtectControlGroups=yes [email&#160;protected] SystemCallArchitectures=native LockPersonality=yes MemoryDenyWriteExecute=yes RestrictRealtime=yes RemoveIPC=yes  [Install] WantedBy=multi-user.target <\/code><\/pre>\n<p>\u7136\u540e\u8fd0\u884c:<\/p>\n<pre><code>systemctl stop wide-dhcpv6-client.service systemctl disable wide-dhcpv6-client.service systemctl enable dhcp6c.service <\/code><\/pre>\n<p>\u4f60\u5c31\u53ef\u4ee5\u901a\u8fc7 <code>dhcp6c.service<\/code> \u6765\u63a7\u5236 <code>wide-dhcpv6-client<\/code> \u4e86\u3002<\/p>\n<p>\u8fd0\u884c\u6210\u529f\u540e\uff0c\u89c2\u5bdf\u4f60\u5c40\u57df\u7f51\u7684\u63a5\u53e3\uff0c\u5e94\u8be5\u5c31\u80fd\u770b\u5230\u5bf9\u5e94\u5206\u914d\u7684\u5730\u5740\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/11\/20201115_5fb0f8ef252fe.jpg\" alt=\"X86 \u8f6f\u8def\u7531\u914d\u7f6e IPv6 \u8e29\u5751\u5c0f\u8bb0\" \/><\/p>\n<p>\u6700\u540e\u9700\u8981\u5411\u5c40\u57df\u7f51\u8bbe\u5907\u53d1\u9001 RA\uff0c\u4f7f\u7528 slaac \u6765\u5206\u914d IP \u5730\u5740\uff0c\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528\u4e86 Dnsmasq\uff0c\u56e0\u4e3a Dnsmasq \u662f\u4e2a\u975e\u5e38\u5e38\u7528\u7684\u8f6f\u4ef6\uff0c\u5c31\u4e0d\u591a\u4ecb\u7ecd\u4e86\uff0c\u5728 Dnsmasq \u7684\u914d\u7f6e\u6587\u4ef6\u91cc\u52a0\u4e0a:<\/p>\n<pre><code>enable-ra dhcp-range=::,constructor:br0,ra-only,slaac <\/code><\/pre>\n<p><code>br0<\/code> \u586b\u5165\u5165\u4f60\u7684\u5c40\u57df\u7f51\u63a5\u53e3\u3002<\/p>\n<p>\u8fd9\u65f6\u4f60\u7684\u5c40\u57df\u7f51\u8bbe\u5907\u5e94\u8be5\u4e5f\u80fd\u5206\u914d\u5230\u5168\u7403\u552f\u4e00\u7684 IPv6 \u5730\u5740\u4e86\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>16<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4138157\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AoTmmy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u597d\u5bb6\u4f19\u5199\u7684\u771f\u8be6\u7ec6\uff0c\u4e0d\u8fc7 x86 \u7684 op \u76f4\u63a5\u628a IPv6 \u6253\u5f00\u5c31\u80fd\u7528\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138158\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xarthur <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @AoTmmy \u7528 OpenWRT \u6ca1\u6709\u5b8c\u6574\u7684 Linux \u53d1\u884c\u7248\u7075\u6d3b\uff08\u9003                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138159\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 0987363 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             v6 \u597d\u4e9b\u63d2\u4ef6\u652f\u6301\u6709\u95ee\u9898\uff0c\u6211\u90fd\u662f\u53ea\u7528 v4.\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138160\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xtx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u56fe\u90fd\u6302                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138161\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xarthur <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xtx \u6211\u8fd9\u91cc\u6ca1\u4ec0\u4e48\u95ee\u9898\uff0c\u4e0d\u8fc7\u6302\u4e86\u4e5f\u4e0d\u5f71\u54cd\u6587\u7ae0\u5c31\u662f\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138162\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jousca <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u56fe\u6211\u89c2\u5bdf\u6b63\u5e38\u3002\u6302\u4e86\u662f\u4ec0\u4e48\u64cd\u4f5c\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138163\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : leeyuky <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u5230\u8fd9\u5e16\u5b50\u53ea\u60f3\u8bf4\u4e00\u53e5 windows server \u81ea\u5e26\u7684 hyper-v \u91cc\u9762\u7684 virtual switch \u5bf9 ipv6 \u652f\u6301\u6709\u95ee\u9898\uff0c\u5f53\u65f6\u6298\u817e\u4e86\u597d\u4e45\u624d\u641e\u597d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138164\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tankren <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             pfsense \u8def\u8fc7                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138165\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : brMu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bb2\u771f\uff0c\u6211\u4e4b\u524d\u4e5f\u662f\u62ff debian 9 \u6765\u6298\u817e\u7684\uff0c\u4e5f\u662f\u9047\u5230\u5404\u79cd\u5751\uff0c\u6700\u540e\u4e5f\u662f\u6210\u529f\u4e86\uff0c\u4e0d\u8fc7\u518d\u540e\u8fd8\u662f\u653e\u5f03\u4e86\u7528 debian9 \u6765\u62e8\u53f7\uff0c\u76f4\u63a5\u7528\u7231\u5feb\u6765\u62e8\u53f7\u548c\u5206\u6d41\uff0cdebian \u505a\u4e3a\u4e8c\u7ea7\u8def\u7531\u6765\u5b9e\u73b0\u5404\u79cd\u529f\u80fd\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138166\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : brMu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8865\u5145\u4e00\u4e0b\uff0c\u539f\u56e0\u5f88\u7b80\u5355\uff0c\u7231\u5feb\u505a\u4e3a\u8def\u7531\uff0c\u62e8\u53f7\uff0c\u5206\u6d41\uff0cDDNS\uff0c\u9650\u901f\uff0cUPNP\uff0cNAT\uff0c\u5df2\u7ecf\u975e\u5e38\u7684\u5b8c\u5584\u4e86\uff0c\u81ea\u5df1\u6298\u817e\u5b9e\u5728\u592a\u8d39\u5fc3\uff0c\u7528 debian \u505a\u4e3a\u4e8c\u7ea7\u8def\u7531\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u6240\u6709\u60f3\u8981\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u4e13\u5fc3\u5728\u8fd9\u4e0a\u9762\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138167\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shikkoku <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u70b9\u590d\u6742\uff0c\u4e0d\u77e5\u9053\u5982\u4f55\u5b9e\u73b0 full cone \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138168\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qbqbqbqb <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shikkoku Full cone \u662f\u9488\u5bf9 ipv4 \u6709 NAT \u7684\u60c5\u51b5\u7684\u3002ipv6 \u6ca1\u6709 NAT\uff0c\u90fd\u662f\u516c\u7f51\u5730\u5740\uff0c\u53ea\u8981\u5728 iptables \u9632\u706b\u5899\u7684 FORWARD chain \u653e\u884c\u76f8\u5e94\u7aef\u53e3\u5c31\u884c\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138169\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cwbsw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @qbqbqbqb FaceTime \u8fd9\u7c7b VOIP \u5e94\u7528\u6709\u670d\u52a1\u5668\u5e2e\u52a9\u8054\u673a\u7684\u8bdd\uff0c\u4e0d\u9700\u8981\u9632\u706b\u5899\u653e\u884c\u7aef\u53e3\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138170\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : xarthur <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @shikkoku \u4e0d\u9700\u8981 full cone\uff0c\u5728 IPv6 \u91cc\u6ca1\u6709 NAT \u4e86<br \/>IPv4:<br \/> |<br \/> \u7f51\u5173: 192.168.1.1 and 154.233.233.233 \uff08 192.168.1.1 -&gt; 154.233.233.233 \uff0c \u9700\u8981\u8fdb\u884c NAT \uff09 <br \/> \/ <br \/> \/ <br \/> \/ <br \/> \u8bbe\u5907 1 \u8bbe\u5907 2<br \/> 192.168.1.2 192.168.1.3<\/p>\n<p>IPv6:<br \/> |<br \/> \u7f51\u5173 : 2408:8256:3075:BEEF::1<br \/> \/ <br \/> \/ <br \/> \/ <br \/> \/ <br \/> \/ <br \/> \/ <br \/> \/ <br \/> \u8bbe\u5907 1 \u8bbe\u5907 2<br \/>2408:8256:3075:BEEF::2 2408:8256:3075:BEEF::2 <\/p>\n<p>\u4f60\u53ef\u4ee5\u770b\u5230\u8fd9\u91cc\u662f\u5728 IPv6 \u7684\u7f51\u7edc\u91cc\uff0c\u4f60\u4e0d\u9700\u8981\u8fdb\u884c\u5730\u5740\u8f6c\u6362\uff0c\u56e0\u4e3a\u6240\u4ee5\u7684\u8bbe\u5907\u90fd\u6709\u516c\u7f51 IP\uff0c\u6240\u8c13\u7684\u300c\u5c40\u57df\u7f51\u300d\u8bf4\u660e\u7684\u662f\u8fd9\u4e9b\u8bbe\u5907\u7684\u4e0a\u5c42\u8def\u7531\u662f\u4f60\u7684\u7f51\u5173\u8bbe\u5907\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138171\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : feast <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bb2\u534a\u5929\u6211\u611f\u89c9\u4f60\u8fd8\u662f\u5728\u628a SLAAC \u548c DHCP6 \u6df7\u7528                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4138172\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : szdosar <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u60f3\u77e5\u9053\uff0c\u6709\u516c\u7f51\u7684 IPv6 \u540e\uff0c\u5982\u4f55\u5229\u7528\uff1f\u6bd4\u5982\uff0c\u5982\u4f55\u8fdc\u7a0b\u8bbf\u95ee\u6211\u7684\u8f6f\u8def\u7531\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>X86 \u8f6f\u8def\u7531\u914d\u7f6e IPv6 \u8e29\u5751&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/192152"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192152"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/192152\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192152"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}