Setting up a Nokia #N900 to be an #IPv6 Enabled Web Server

This morning, I set up my Nokia N900 to be an #ipv6 enabled web server. In this article, I will discuss what some background information about setting this up and then the details of what I did.

Let me start off by describing the Nokia N900 for those who are not acquainted with it. It is, in my opinion, the best geeks’ phone out there. While non-geeks might enjoy some of the power off the phone, I generally steer my non-geek friends to an iPhone or an Android. However, for someone that wants a phone that they can configure, customize and program for, to their hearts content, there is nothing I have found like the N900.

The N900 connects to the internet over WiFi or over cellular. Out of the box, it only supports version 4 of the Internet Protocol (IPv4). For many people this is sufficient. You can browse the web, and run many specialized applications over IPv4. The problem is that we are running out of IPv4 addresses. To get around this, people use network address translation (NAT) so that they can have one IPv4 address for their home, which they share with all their computers. Cellphone companies also typically offer IPv4 addresses that are behind NAT as well.

NAT makes it easy for a device to access the Internet, but it makes it difficult for other devices to start a conversation with a device behind NAT. This means that while my cellphone can easily contact servers out on the Internet, as long as I am running IPv4 behind NAT, other devices cannot access my cellphone as a server. Generally, this is a good thing. In most cases, you don’t want anyone on the Internet to be able to access your cellphone.

Version 6 of the Internet Protocol (IPv6) fixes this by making many more internet addresses available. It also provides for enhanced security and mobility, so that a device can keep the same internet address no matter where it is and how it is connecting to the Internet. Both of these are very important if you are going to set up a lot of cellphones to act as servers where ever they might be used.

There is a package for the Nokia N900 called Kernel Power. Among other things that this does, it enables IPv6. I’ve loaded Kernel Power on my N900 and have been using it for a long time. It appears to be very reliable.

My home internet service does not provide IPv6 connectivity. However, by using Freenet6 I have connectivity. I have an Ubuntu server that uses the Tunnel Service Protocol (TSP) to connect to Freenet6 and runs a radvd router to make IPv6 available to other devices on my home network.

I’ve created an AAAA record which provides the IPv6 address for my phone. I do not have Mobility IP configured yet, so you can only access my phone over IPv6 when it is connected via WiFi to my home network. Mobility IP is one of the next topics that I wish to explore.

I am running SSH, so people who have proper keys to my server can connect, and I’m exploring allowing other users to connect in. The next idea was to set up a web server. I’ve read about people trying to set up Apache for their N900’s, but that seemed like overkill and too much work. I read about web2py, and installed it on my machine. However, it takes up 24 meg of diskspace, and I couldn’t find any way to access it other than through an IPv4 localhost address.

Another possible server was the Monkey Project. It does not appear to be packaged for the N900 and looks like it would require compiling in a sandbox and then loading on to the N900. Again, this looked like more work than I was ready to take on this morning.

One person recommended httpi. This is a lightweight webserver written in perl. It looks promising, and I’ve set it up. Unfortunately, it does not yet support IPv6, so I haven’t explored it further.

With this, I ended up using the lighttpd server. It is working fairly nicely for me. It is available as a package to download and install. It does not support IPv6 out of the box, but all you really need to do is add the line
server.use-ipv6 = “enable”
to the /etc/lighttpd.conf file, and IPv6 starts working.

I did a few other minor configuration changes. For example, I changed static-file.exclude-extentions to include .py files for python and .rb files for Ruby. I then changed cgi-assign to point to the appropriate files. For example, I needed to change the php program to point to php in /usr/bin instead of /usr/sbin. I also needed to add the files for processing python and ruby.

I turned on statistics and experimented, unsuccessfully, with aliases. With that, I have an interesting little server up and running.

If you have IPv6 connectivity and want to check things out, go to Aldon’s N900. I have simple programs in PHP, Perl, Python and Ruby running. The PHP programs display battery information and php configuration. The Python program accesses the GPS and provides information about where the phone is currently located.

With a web server, PHP and databases available, if I get really ambitious, I might try setting up some standard LAMP based package like Drupal or Wordpress. There are other servers that I’m interested in running. For example, I am running for media sharing. It is based on uPnP. I don’t know the details of how uPnP works with IPv6, so I haven’t really tested this out yet. However, if anyone can help me in this area, I would love to hear more.

Another area that is particularly interesting to me is Asterisk. Asterisk is an open source PBX that has been ported to the N900. I haven’t experimented with this yet, but it would be very interesting to see if I could have my cellphone be a PBX. There is an effort to get Asterisk to work with IPv6 which gets even more interesting.

There are probably lots of other interesting things that can be done with a N900 as a server, such as making it available as a webcame. So, are you running anything interesting on your cellphone? Are you doing anything cool with IPv6? I’m always looking for new ideas to experiment with.

(Categories: )