Update: See end of post for easier way to get IPv6!
Ever since my ISP announced their IPv6 beta, I've wanted to use it. They chose a recent protocol for their offering: 6rd. Support for this protocol is very limited among home routers and I'm not ready to give up on the advanced features found in custom firmwares.
6rd is basically a 6to4 tunnel for which we receive configuration through dhcp by enabling a flag in the request we send to our ISP. Instead of using public anycast relays, the ISP sends you the IPv4 of his own relay. And instead of using the standard 6to4 prefix 2002::/16, the ISP sends you one of his own prefix that you must combine with part of your IPv4 address to create your assigned IPv6 prefix.
In theory calculation of our assigned prefix with the info received via dhcp is easy: If the assigned prefix length is a multiple of 8 (ex: Comcast's /64), it's easy, transform your IPv4 to hexadecimal with printf and append it to ISP's prefix. But if the assigned prefix length is not a multiple of 8 (Vidéotron's /60), we must work at the binary level and this is no fun with the limited busybox sh! (See the "Calculating your settings" in the log below to visualize how the combination is done)
The script is a proof of concept tested only with my own ISP and router(Toasman miniipv6). It retrieves the 6rd information with udhcpc and it configures your router accordingly (alternatively it can tell you the values you need to populate on the gui in 6in4 tunnel section without touching your configuration). It may be desirable to create the tunsit/tunnel manually with 6rd in mind, but I thought using existing 6in4 gui capability was easier for most people.
#SSH to your router: root@tomato# cd /tmp root@tomato# wget http://alexou.net/pub/script-collection/tomato-6rd.sh root@tomato# chmod +x tomato-6rd.sh root@tomato# ./tomato-6rd.sh
Note: The script will have to be rerun every time your IPv4 changes (In Vidéotron's case it's almost never, unless your router's MAC changes.)
root@tomato:/tmp/home/root# /tmp/6rd.sh udhcpc (v1.18.5) started I'm working as expected! Sending discover... Sending select for 188.8.131.52... Lease of 184.108.40.206 obtained, lease time 83700 Bound...6rd :) ip6rd 14 42 2607:FA48:6E00:0000:0000:0000:0000:0000 220.127.116.11 ip6rd_ipv4masklen 14 ip6rd_6rdprefixlen 42 ip6rd_6rdprefix 2607:FA48:6E00:0000:0000:0000:0000:0000 ip6rd_6rdbripv4address 18.104.22.168 -------------------------- Calculating your settings: bin_ip6rd_6rdprefix = 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000 bin_wanip = 01100000000101 bin_client_prefix = 001001100000011111111010010010000110111000000010100100101101 -------------------------- 6in4 static tunnel settings: Assigned / Routed Prefix = 2607:FA48:6E02:92D0:: Prefix Length = 60 Router IPv6 Address = Default Enable Router Advertisements = yes Tunnel Remote Endpoint (IPv4 Address) = 22.214.171.124 Tunnel Client IPv6 Address = 2607:FA48:6E02:92D0:: / 60 Do you want me to configure it for you? [y/n]y Applying settings...done Do you want to commit to nvram now? (Say no if you are testing) [y/n]n Restarting network.................................................................................Killed ......................................... Done. root@tomato:/tmp/home/root# ping6 ipv6.google.com PING ipv6.google.com (2607:f8b0:4002:802::1012): 56 data bytes 64 bytes from 2607:f8b0:4002:802::1012: seq=0 ttl=55 time=41.180 ms 64 bytes from 2607:f8b0:4002:802::1012: seq=1 ttl=55 time=40.246 ms 64 bytes from 2607:f8b0:4002:802::1012: seq=2 ttl=55 time=40.457 ms 64 bytes from 2607:f8b0:4002:802::1012: seq=3 ttl=55 time=40.468 ms --- ipv6.google.com ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max = 40.246/40.587/41.180 ms
Alexandre Blanchette made changes to the script to make it compatible with DD-WRT, you can download his version there: https://fc.csvdc.qc.ca/~blancha/ddwrt-6rd.txt. I also mirrored it there: https://alexou.net/pub/script-collection/ddwrt-6rd.txt
A reader sent me good news. Apparently Shibby firmware, version 100 up to 108, supports 6rd natively and have working RA! Why version 108? Because newer versions use dnsmasq for RA announcements and for some reason it doesn't work with Vidéotron IPv6. Version 108 or earlier use radvd.