OpenWRT + 隧道IPv6配置(续)
这篇文章介绍如何在OpenWRT下面配置radvd,来分配客户端IPv6地址。这样的话路由器后面的电脑就相当于是native IPv6了。
Radvd的全称是Router Advertisement Daemon,其作用近似于DHCP,利用NDP协议分配IPv6的本地链路地址并且建立路由表。
如果是通过SixXS的Tunnel Broker访问IPv6的话,需要向他们申请subnet,这样才能让客户端使用,因为默认的Tunnel broker只提供从::2到::1的路由。
申请到之后需要先修改路由表,打开/etc/config/network
:
在桥接的interface上(以LAN Configuration开头的那一段)加入这么一句:
option ip6addr subnet-prefix::1/64
Subnet prefix是SixXS邮件里面的Subnet IPv6那个,除掉最后的::/48。
修改完成之后应该类似于下面这样:
config interface lan
option type bridge
option ifname "eth0.0"
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
option ip6addr your-subnet-prefix::1/64
然后需要安装radvd:
opkg update && opkg install radvd
完成后修改/etc/config/radvd
,修改如下位置:
option prefix
值修改为subnet-prefix::64
AdvSendAdvert
、AdvOnLink
、AdvAutonomous
值均为1
Ignore
(有两个)值均设为0
最后在LuCI里面启用radvd。
如果按照上篇文章里面改过aiccu的启动顺序的话这样应该就可以了。aiccu必须在radvd之后启动。
reboot之后客户机就可以直接访问ipv6的网站了。