IPv6: Linksys, DD-WRT, Comcast 6to4

I got IPv6 working with my home router, DD-WRT, and Comcast’s 6to4 service. 6to4 works by setting up a tunnel for IPv6 over IPv4. It uses the anycast address as the tunnel endpoint. The IPv6 address is constructed from the host’s IPv4 address with 2002: prefix. 6to4 only works for hosts with public IP address which is why it has to be run on the router. Comcast has 6to4 proxies. Comcast was testing 6RD which is similar but the prefix and proxy address are configured.

First, I had to flash DD-WRT to my WRT400N. Second, I had to enable IPv6. The 6to4 config for 2.6 kernels requires a radvd config and startup script to be entered. Also, the scripts had to be changed for the WRT400N since they don’t have vlan2 device but eth1 worked.

radvd config:

interface br0 { 
MinRtrAdvInterval 3; 
MaxRtrAdvInterval 10; 
AdvLinkMTU 1480; 
AdvSendAdvert on; 
prefix 0:0:0:1::/64 { 
AdvOnLink on; 
AdvAutonomous on; 
AdvValidLifetime 86400; 
AdvPreferredLifetime 86400; 
Base6to4Interface eth1; 

Startup script:

insmod /lib/modules/`uname -r`/kernel/net/ipv6/sit.ko 
sleep 5 
radvd -C /tmp/radvd.conf start 
sleep 5 
WANIP=$(ip -4 addr show dev eth1 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1) 
if [ -n "$WANIP" ] 
V6PREFIX=$(printf '2002:%02x%02x:%02x%02x' $(echo $WANIP | tr . ' ')) 
ip tunnel add tun6to4 mode sit ttl 255 remote any local $WANIP 
ip link set tun6to4 mtu 1480 
ip link set tun6to4 up 
ip addr add $V6PREFIX:0::1/16 dev tun6to4 
ip addr add $V6PREFIX:1::1/64 dev br0 
ip -6 route add 2000::/3 via :: dev tun6to4 
kill -HUP $(cat /var/run/radvd.pid) 
sleep 10 
radvd -C /tmp/radvd.conf start