Setting up a 6to4 tunnel on freewrt:

#!/bin/sh
# http://tldp.org/HOWTO/Linux+IPv6-HOWTO/configuring-ipv6to4-tunnels.html

ip -6 route flush dev tun6to4
ip link set dev tun6to4 down
ip tunnel del tun6to4

sleep 2

ttldefault=15
ipv4=$(ip a show ppp0 | sed -ne 's/.*inet \([^ ]*\).*/\1/p')
local6to4prefix=$(printf "2002:%02x%02x:%02x%02x" `echo $ipv4 | tr "." " "`)
local6to4address="$local6to4prefix::1"

ip tunnel add tun6to4 mode sit ttl $ttldefault remote any local $ipv4
ip link set dev tun6to4 up
ip -6 addr add $local6to4address/16 dev tun6to4
ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4

ip -6 addr add $local6to4address/64 dev eth0.0
ip -6 route add $local6to4address/64 dev eth0.0

sed -i -e "s/prefix.*/prefix $local6to4prefix::\\/64/" /etc/radvd.conf
/etc/init.d/S51radvd restart