Marius's Personal site

My personal blog & gallery
Welcome to Marius's Personal site Sign in | Join | Help
in Search

Blogging About .NET

Running IPv6 on a router near you

I told you before that I updated my WRT54GL router to DD-WRT. One of the neat things of this new firmware is IPv6 support. In case you do not know IPv6 is the next generation of IP protocol, which addresses a major problem nowadays, the fact that IPv4 addresses will most likely to run out in a few years.

The setup is fairly simple, you enable two radio buttons in the DD-WRT web management interface, setup the RADVD and tunnel configuration according to DD-WRT Wiki and enable IPv6 on your Windows XP / 2003 box. Simple to say, simple to do, but I ran into a few problems, the main one being the fact that I wasn't able to communicate with anything over IPv6 from computers connected to the router. After a little bit of digging I found out that the scripts and configuration on the DD-WRT wiki were a little bit wrong, and with a minor fix I was able to use IPv6 successfully. This made me to write this post as it might be helpful to someone in the future.

In the original startup script V6IPNET variable was wrongly computed along with the netmask on V6IP which I think it should be /48, because 2002:x:y:z:w::1/16 is equivalent of 2002::/16, and the routing table would be wrong as it adds address on br0 interface and route also on br0. Anyway the modified script is presented below, and it works for me:

sleep 5
  WANIP=$(ip -4 addr show dev vlan1 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)
  if [ -n "$WANIP" ]  then
   V6IP=$(printf '2002:%02x%02x:%02x%02x::1/48' $(echo $WANIP | tr . ' '))
   ip tunnel add tun6to4 mode sit ttl 255 remote any local $WANIP
   ip link set tun6to4 mtu 1280
   ip link set tun6to4 up
   ip addr add $V6IP dev br0
   ip -6 route add 2002::/16 dev tun6to4
   ip -6 route add 2000::/3 via ::192.88.99.1 dev tun6to4
   kill -HUP $(cat /var/run/radvd.pid)
  fi  

Additionally, you may want to modify the RADVD configuration to advertise prefix 0:0:0::/48 instead of 0:0:0:1::/64, to match the above script, but it is not necessary, as 0:0:0:1::/64 it is a subset of 0:0:0::/48.

These modifications were inspired from OpenWRT wiki, where I found also an interesting configuration tip on how to make Windows XP more IPv6 friendly, not to discriminate IPv6 protocol by favoring IPv4.

If you are interested in IPv6 (and you should be as the change is near), you can find a lot of links for various operating systems at ManyBytesAgo.

Published Sunday, October 08, 2006 9:54 PM by cchrism
Filed Under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Michael Adams said:

Hey, thanks for the reference to my old website. ManyBytesAgo was getting hammered by Chinese spammers, so I nixed it. I did try starting up a new bookmark collection on my own website, which is wiki-powered, but self-edited.
December 30, 2007 7:40 PM

What do you think?

(required)
(optional)
(required)

This Blog

Post Calendar

<October 2006>
SuMoTuWeThFrSa
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

News

Listed on BlogShares

Syndication

Powered by Community Server, by Telligent Systems