The ipv6 era has come.  Now it seems that Facebook and all the services in Google have implemented IPV6 connectivity.  I know China Tel always trying to block users from IPV6.  Microsoft Teredo server seems down here.  To integrate my home network with IPV6, A tunnel broker is a good choice.

 

First, make sure all the devices you own are IPV6 capable.  An openwrt Router is preferred.  Linux desktops is recommended (Only Linux can update the DNS record from radvd RDNSS).  Windows 7/Vista is acceptable.(They only accept DHCPv6 for DNS update).  Windows XP or earlier version is unacceptable.  Mac OS X 10.6.8 or higher is recommended.

 

The whole article aims to provide IPV6 through Router using tunnel broker.

 

1. As a Hurricane Electric Certified Sage, I recommend tunnel broker provided by HE.  Register your account and create a regular tunnel here.

2.Install the essential modules on Openwrt Router.  I installed: ip, kmod-ipv6, kmod-sit, radvd, dibbler, curl.  Here I use radvd for Router Advertisement and dibbler for DHCPv6.  dibbler is somewhat big.  If you prefer ISC DHCPv6 or wide DHCPv6, that is OK.  curl is for update my tunnel Endpoint IP address cuz my Router is under Dynamic Address Allocation over PPPoE.

3.Bring the router to the IPV6 network.

This is a shell script for me to add my router to IPV6 Network.

username=xxxxxx

password=xxxxxx

tunnelid=xxxxxx

curl --insecure https://$username:$password@ipv4.tunnelbroker.net/ipv4_end.php?tid=$tunnelID

# Here I use --insecure for not verifying the server certification.  or you can use --cacert to specify the CA file

myip=$(ifconfig|grep -A2 'pppoe-wan'|grep 'inet addr:'|cut -d: -f2 |awk '{ print $1}')

myv6ip=2001:470:c:1376::2/64

server=66.220.18.42

ip tunnel add he-ipv6 mode sit remote $server local $myip ttl 255

ip link set he-ipv6 up

ip addr add $myv6ip dev he-ipv6

ip route add ::/0 dev he-ipv6

If everything is fine you can ping ipv6.google.com on your router now.

 

4.Because my Allocated Routed /64 is 2001:470:d:1376::/64 (be aware, the prefix is different from the address your router get, here is a d, not a c).  This /64 block is for my home network, so I route it to the lan.

ip -6 route add 2001:470:d:1376::/64 dev br-lan

5.Configure /etc/config/radvd and /etc/dibbler/server.conf for Router Advertisement and DHCPv6.  The configuration I am using is:

/etc/config/radvd:

config interface
option interface        'lan'
option AdvSendAdvert    1
option AdvManagedFlag   1
option AdvOtherConfigFlag 0
option ignore           0

config prefix
option interface        'lan'
# If not specified, a non-link-local prefix of the interface is used
option prefix           '2001:470:d:1376::/64'
option AdvOnLink        1
option AdvAutonomous    1
option AdvRouterAddr    0
option ignore           1

config rdnss
option interface        'lan'
# If not specified, the link-local address of the interface is used
option addr             '2001:470:20::2'
option ignore           1

/etc/dibbler/server.conf:

log-level 8
log-mode short
preference 0
iface "br-lan" {
// also ranges can be defines, instead of exact values  t1 1800-2000  t2 2700-3000
prefered-lifetime 86400
valid-lifetime 172800
class {
pool 2001:470:d:1376::/64
}
option dns-server 2001:470:20::2
}

6.Enable ipv6 forwarding in /etc/sysctl.conf

net.ipv6.conf.all.forwarding=1

7.After everything finished, just enjoy the IPV6 in your home network.

P.S.  If  you disable IPV4 on your laptop, it will lead your laptop to IPV6 only network.  At least in IPV6 only network Facebook and all services Google providing are accessible.