Nicolas314

All my geeky stuff ends up here. Mostly Unix-related

Posts Tagged ‘dd-wrt

Running optware on Tomato

leave a comment »

If you have an ARM- or MIPS-based router like the Linksys WRT54g (MIPS) or Netgear’s WNR3500L (MIPS), you probably know you can run alternative firmware like dd-wrt, Tomato, or openwrt. Choosing the right one for your router is both a matter of user requirements (what do you want to do with your router?) and a question of taste (which one do you find easier to handle?). Whatever you choose, you may end up running a firmware version lacking a couple of functionalities and this is where optware shines.

Optware is a Debian-like distribution for ARM-based Linux devices. Packages live under /opt and all share common dynamic libraries stored there. Package management itself is handled by ipkg, a close equivalent to dpkg on Debian. There are pre-compiled binaries available for ARM on various sites, allowing you to install handy network-based functionalities in a couple of commands.

More information about Optware can be found on these sites:

Check out the list of packages offered by this distribution, it is quite impressive. To give you ideas you could run:

  • lighttpd, apache, cherokee or nginx for your own web site served directly from your router!
  • Python, Perl, Lua and other scripting languages
  • cron jobs
  • ftp or samba server, bittorrent clients
  • etc.

The only trouble with the default WNR3500L is that you will quickly run out of space if you only rely on flash memory included on the router. The solution is quite obvious though: dedicate a USB stick to the task and install everything onto it. Here are the steps I took to achieve this under Tomato:

Mount your USB stick on /opt on boot

This part was heavily inspired by Adventures with DD-WRT. On your Tomato admin interface, select Administration and then Scripts in the left menu. Copy/paste the following code inside the Init tab:

#!/bin/sh
sleep 6
umount -f /tmp/mnt/sda1
mount -rw -o noatime,nodev /dev/sda1 /opt

In other words: you are asking the router to wait for six seconds to let the USB stick get mounted (default is /tmp/mnt/sda1) and then you un-mount it and re-mount immediately on /opt where Optware lives.

Reboot your router. Make sure your USB stick has been re-mounted correctly on /opt e.g. by ssh’ing into your router and running df -h /opt

Install Optware

This part was taken from the dd-wrt site. You first download a bootstrapping shell script from an active mirror and then run it to download and setup Optware basics. I got the initial script from pastebin but there are alternative mirrors:


# wget http://pastebin.ca/raw/1031954 -O - | tr -d '\r' > /tmp/optware-install.sh
# sh /tmp/optware-install.sh

Check the Optware/dd-wrt pages for more detailed information. You will see that the script is taking care of setting up shared C libraries for all optware packages to use, and then configure ipkg (the package manager) for immediate usage.

That’s about it. You can now install packages with ipkg like this:


# ipkg install python25
[...]
# python2.5
Python 2.5.5 (r255:77872, May 20 2010, 23:37:05)
[GCC 4.1.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

I cannot thank enough the team behind Optware, this is really a wonderful set of tools! Porting and compiling packages is a tedious task, I would probably not be running a Python-based web server on my router without Optware.

Advertisements

Written by nicolas314

Saturday 13 November 2010 at 12:52 am

Posted in hardware, optware, router

Tagged with , , ,

Beefing up my home network

with 2 comments

WNR3500L

My proud WNR3500L standing

Recently got myself a new router: A WNR3500L from Netgear. Sweet! This little beast hides incredible power under the hood: Gbit LAN, Wireless N, a USB port, a fast CPU and lots of RAM. It is advertized by Netgear as please hack me!

Not kidding: Netgear points you to myopenrouter, a site containing alternative firmware, articles and forums about how to root and brick your new router to your heart’s content. I had to hack the thing away and tried the three most popular firmware versions they had: Netgear’s own, dd-wrt and tomato. I will review them in turn here.

Netgear’s own

The native Netgear firmware has been rated among the best in terms of network performance on various blogs and review sites. The user interface is unfortunately ugly enough to repulse the most tolerant user. Configuring things is not made any easier with cryptic module and function names and everything you click will reboot the router, making it a never-ending pain to configure it at all. I am ready to endure anything but this was beyond me.
Port forwarding to your NAT does not offer any option to forward e.g. port 8080 on the Internet to port 80 on your internal network. I found this very inconvenient as I am running several HTTPS and SSH servers internally and occasionally open them on dedicated ports. Furthermore, changing any option in port forwarding would reboot the unit. Entering all the rules for my home network quickly ruined my patience.

One good point though: this firmware offers configuration options to setup a second wireless access point with its own firewall and security rules, which makes it very easy to install a guest access point for neighbours and friends. But wait… you can do that with dd-wrt too.

 

dd-wrt

I am already running dd-wrt on other hardware so I thought I knew it all, but no. The sheer number of options to configure is overwhelming! This is great for tinkerers like me but it can quickly become old as minutes go by and you have clicked on all possible menus and still cannot find the option you are looking for. I ended up as usual browsing Google more than the user interface because I could not find what I was looking for. Bummer!
dd-wrt comes with the kitchen sink, that one is pretty obvious. You have every possible option and its brother and if you really spend the time you definitely feel you are in control. Ok, maybe too much in control. It is fairly easy to tweak the configuration parameters into a completely non-working state, at which point you will have to revert to the 30-30-30 reboot option. For those who think they bricked their router, here is the manipulation:

  • Push a pin into the reset button at the back, hold it for 30 seconds
  • Still holding the pin, turn power off and wait 30 more seconds
  • Still holding the pin, turn power back on and wait 30 more seconds
  • Pull the reset pin now, wait for 15-20 seconds for the router to come
    back to its senses and power off/on again.

You can sing a song during the whole procedure, that helps. And be prepared to do it again because the next option you modify may brick your router again… Sigh…

In the end I chose not to keep dd-wrt. Despite the zillion parameters there were things I could not (find how to) configure. I have already lots of experience with Tomato and decided to give it a try.

 

Tomato

Tomato is an interesting piece of firmware. It has been built with user ease in mind and it really shows. Everything is available from the left-side menu and once you have seen all options it is really easy to find your way around. The interface is snappy, reactive, easy to understand and contains almost everything I am looking for. Since the WNR3500L has lots of RAM I could install the complete version, including an openvpn client.
The only thing I am missing from Tomato is the guest wireless access point, but that should not be a real issue. I still have my old routers for that kind of thing.

 

Switching between firmware versions

Not sure the issue has been solved, but installing firmware on the WNR3500L proved a bit harder than advertized. The box comes with Netgear’s firmware pre-installed (obviously), and from there you can only update to a reduced version of dd-wrt, from which you can then upgrade to a complete dd-wrt or Tomato.

This does not sound like much but it took me some time to figure this outand juggling between firmware versions had me 30-30-30’ing the beast at least a dozen times during the same evening. If you want to try all firmware out, make sure you have ample time in front of you and be careful about the order in which you install them.

 

Conclusion

I will stick to Tomato. It is really the best firmware today for this kind of box.

References:

One down point though: the LEDs at the front keep happily blinking away all day long. Even if it is a merry sight at first, I’d rather have an option to disable them altogether.

Written by nicolas314

Thursday 11 November 2010 at 10:53 pm

Posted in hardware, router

Tagged with , , , ,