A few weeks ago I got my hands on a new Linksys WRT320N router (it looks extremelly nice, I should say) which replaced my Buffalo WHR-HP-G54. I played with the original firmware for a few minutes and then, of course, flashed it with the latest DD-WRT build for my router (based on 2.6 kernel). It all worked great but I just couldn’t properly configure IPv6 for my network. On my Buffalo I used a specialized crushedhat’s build and it worked like a charm, but here, no scripts I found on internet worked and after a few hours of searching and experimenting I finally found the solution. Since there are no working solutions around I considered it logical to share mine.

I’m using Hurricane Electric Tunnel Broker and text enclosed in square brackets and capitalized should be replaced by your own data from your “Tunnel Details”.

1. Turn on IPv6 and radvd under Administration -> Management and paste this inside “Radvd config” box:

interface br0 { 
        AdvSendAdvert on; 
        prefix [ROUTED 64] 
        { 
                AdvOnLink on; 
                AdvAutonomous on; 
        }; 
};

2. Go to Administration -> Commands, paste the following code into the box and click “Save startup”:

insmod ipv6
insmod sit 

ip tunnel add he-ipv6 mode sit remote [SERVER IPV4 ADDRESS] local [CLIENT IPV4 ADDRESS] ttl 64
ip link set he-ipv6 up
ip addr add [CLIENT IPV6 ADDRESS] dev he-ipv6
ip route add ::/0 dev he-ipv6
ip addr add [ROUTED 64] dev br0 

echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
radvd -C /tmp/radvd.conf

3. After saving startup script, paste the following code into the box and click “Save Firewall”:

iptables -I INPUT 2 -p ipv6 -i vlan1 -j ACCEPT

4. Reboot the router and you should have IPv6 connectivity for all connected (and IPv6 capable) clients.

The only problem for now is that by doing this, you are leaving yourself with no firewall (on DD-WRT’s side) through IPv6 and you need to have properly configured firewall on your computer.

I’ve contacted the developers about including ip6tables and they might soon fix that (well, it’s not really broken).

Oh, and here is the list of material that helped me: