Connecting your subnet
It is possible (and not difficult) to put the subnet containing addressing for your network on the public IPv6 internet. Once you do this, you'll be able to access it from anywhere in the world.
Instructions
- Get a publicly routeable prefix for the machine that will serve as the router between the sensor network and the internet. If you happen to have an ISP that gives out IPv6 addresses, you probably get at least a /64 prefix, which will work fine. Otherwise, go to http://tunnelbroker.net and sign up for their IPv6-over-IPv4 tunnel broker service. They have instruction on how to set it up for most platforms; it's surprisingly easy.
- Now that you have a public prefix, follow the instructions in code/b6lowpan/trunk/README to set up your subnet. Replace the prefix in /etc/radvd.conf with your public one so that the motes will know they are part of that networks.
- Also, edit code/b6lowpan/trunk/support/sdk/c/lib6lowpan/router_address.h to reflect your public prefix.
- You're almost done! If you have finished the README, the final step is to edit the kernel routing table to route packets coming from the IPv6 tunnel to the sensor network. You can examine the IPv6 routing table (as root) using route -A inet6. There is probably an entry like
Destination Next Hop Flags Metric Ref Use Iface 2001:470:1f04:56d::/64 :: U 256 0 0 sit1
What this says is that the prefix on the left will be forwarded to sit1, the tunnel interface. This is wrong, since we want to send packets addressed to this subnet to the sensor network instead. Remove this entry using# ip -6 route del 2001:470:1f04:56d::/64 dev sit1
Finally, we need to re-add the prefix, except point it at the right interface (tun0).# ip -6 route add 2001:470:1f04:56d::/64 dev tun0
Of course, you should replace the prefix in all of these entries with your public prefix. Once you're done, you should see a couple of entries forwarding packets to the loopback interface, and the most important entry forwarding packets destined to your prefix to tun0, where the driver will route them.
There are a couple of flags in /proc/sys/net/ipv6 which must be set right in order for this to work; however, the radvd script will take care of this for you.
