DD-WRT on Buffalo WHR-HP-G54

Today I installed the open source router firmware DD-WRT on a newly purchased Buffalo WHR-HP-G54 broadband router. I’m very impressed with its rich feature set and ease of installation.

Months ago a friend had recommended OpenWRT, another open source solution for low cost broadband routers, but following the old “don’t try to fix it if it ain’t broken” mantra, I had stuck with my standard NEC Aterm WR6650S WarpStar router (firmware revision 8.72) .

A few weeks ago I started having random problems connecting to the internet. When I clicked on links in the browser, either it was very slow or it returned an error or timed out on me. When I investigated I noticed that the internal log of the NEC WarpStar was full of error messages like these:

2008/08/24 18:09:29 NAT TX-ERROR List Create Error : UDP 192.168.1.102 : 31320 > 201.29.227.157 : 7701 (IP-PORT=1)
2008/08/24 18:09:29 NAT TX-ERROR List Create Error : UDP 192.168.1.102 : 31320 > 99.227.142.5 : 9205 (IP-PORT=1)

A router reset (briefly pulling the power cord) would cure it for a few hours to two days at most, but then the problem always came back. The router firmware obviously had trouble tracking which entries in its Network Address Translation (NAT) table could be discarded and the table would overflow, making connections to the outside world hit and miss, as NAT entries are essential for replies to requests sent to servers out there to get back into the LAN.

Of the 8 PCs and Macs in my home and office that are sharing a cable internet connection, at least four are on all the time, crunching spam data received from around the world day and night. So you can imagine that whatever router I’m using is always getting a good workout. I can’t afford it to be unreliable.

So I started doing a bit of research on OpenWRT and its cousin DD-WRT and what sort of routers that are compatible with them I could get locally here in Yokohama, Japan.

The Linksys WRT54G was the first router fitted with open source firmware, but Yamada Denki, the biggest electronics store in my part of town, does not sell any Linksys products. They were selling mostly NEC and Buffalo, but none of the models I found on the shelves appeared on the list of supported hardware.

I searched Google for the WHR-HP-G54, a supported Buffalo router, for pages in Japanese and found it on kakaku.com, a price search website. It was available for 6,500 yen from Mr. Direct, a company based in Hiroshima. Less than 48 hours later the router arrived at my doorstep by takkyubin (parcel service), for about $70 including tax and shipping.

Installing DD-WRT on the router turned out to be so easy, it actually took less time to do it than to get my Windows Vista notebook working with the new wireless security keys afterwards!

Here’s what I did:

  1. First I downloaded the firmware (v24-sp1 / Consumer / Buffalo / WHR-HP-G54 / dd-wrt.v24_mini_generic.bin) and saved it on my local hard disk. Update 2009-05-25: Do not use any DD-WRT V24-sp1 builds dated in between 030309 and 051809, these builds have known problem that didn’t exist in the March 3, 2009 version and was fixed in the May 18 2009 version.
  2. Next I verified the router was working with its default firmware. I hooked my notbook to one of the LAN ports by ethernet cable and accessed 192.168.11.1 with the browser. The Japanese factory firmware came up (user: root, blank password).
  3. I added the tftp program in the Windows Vista control panel (Programs and Features / Turn Windows features on or off)
  4. I opened two command prompt windows. In the first I executed
    ping -t 192.168.11.1

  5. In the second command prompt window I went into the folder where I had saved the downloaded DD-WRT firmware and then typed the following, without hitting Enter:
    tftp -i 192.168.11.1 PUT dd-wrt.v24_mini_generic.bin

  6. Unplug the power cable from the back of the router, then reconnect it.
  7. As soon as you see the router responding to the PING command in the first window, hit enter on the second window (tftp command). The diag LED will flash for a number of seconds and tftp will report that the file was transferred.
  8. When the LEDs on the router are quiet, the update will have finished. Renew your IP (or reboot your PC), because the router will now be at 192.168.1.1. Access it with the browser and you’re ready to configure your new DD-WRT router!

Update Manager hangs in Ubuntu 8.04 (and how to fix it)

Last month I upgraded my notebook from Ubuntu 7.10 to 8.04 (“Hardy Heron”). Since then, whenever I tried tried to install the up to 133 updates that had become available, the Update Manager would hang indefinitely instead of prompting me for the user password.

If you’re in the same situation, the following tips might help you. Edit /etc/hosts with an editor of your choice (e.g. sudo vi /etc/hosts). There should be two entries with IPv4 addresses starting with 127.0.x.x, like this:

127.0.0.1 localhost
127.0.1.1 mycomputername.mydomain

Remove the domain name from the entry starting with 127.0.1.1, leaving only the computer name and save the file. Now try again.

When I made this change I got the password prompt as expected and all the updates where downloaded and applied.

Ubuntu 8.04 LTS released

The latest version of Ubuntu, the most popular desktop version of Linux on the market, was released on Thursday, 24 April 2008.

New versions are released every six months and labelled after the release year and month, therefore the latest will be known as 8.04, replacing 7.10. The “LTS” suffix stands for “Long Term Support”, as this version will be supported for three years.

The new version, code named “Hardy Heron” bundles the new FireFox 3.0 web browser, updates to photo management and video and music-related features. It can also install on top of an existing copy of Windows without the need to repartition the hard disk. This lowers the barrier to entry for new users who, if they’re not happy with Ubuntu, can always remove it using the Windows Control Panel, just like any other Windows application.

If you have a bittorrent client such as uTorrent, you can download ISO images of install CDs and DVDs via this page:

http://torrent.ubuntu.com:6969/

Links:

First impressions of Vista and Ubuntu

Last week I was on a business trip to the USA and decided it was finally time for me to buy a new notebook computer. Here in Japan it’s difficult to get machines with US keyboards.

My previous one was a 650 MHz Pentium III whose RAM was maxed out at 512 MB while my main desktops and servers have 2 GB or more. Lack of RAM slows down PCs much more than a slow clock speed does. People who buy entry level Vista machines equipped with only 512 MB would be better off with a sub-1 GHz CPU but a full 1 GB of RAM.

I picked a Gateway M-6750 with a 1.66 GHz Core 2 Duo CPU, a 250 GB 3.5″ hard disk and 3 GB of RAM. It comes with a built-in microphone and webcam, very handy for Skype-addicts like me.

Every single machine at Best Buy and Circuit City that I looked at came with some form of Vista preinstalled. Microsoft sure does not want to give customers any choice whether they stick with XP. Ideally, I would have wiped off Vista and installed Windows XP on it. Until now I had kept my office a Vista-free zone, but knowing that occasionally I will needed to test some software on it, I stuck with it for the new machine.

I spent some time reconfiguring the Vista desktop to be as Windows 2000 and XP-like as possible. The constant alerts to permit some actions I had requested soon became annoying. Often a single operation results in the user having to agree two or three times. Inevitably, agreeing to anything without giving it much thought soon becomes a habit. Does Microsoft seriously believe that training users to constantly click “Allow”, “OK”, “Yes” will lead to a noticeable gain in security?

So far I have seen little reason for anyone to upgrade from Windows XP or Windows 2000 (my favourite Windows version) to Vista. Sure, there is plenty of new eye candy, but who but the makers and vendors of graphics chipsets, CPUs and RAM benefits from that? Users spent countless hours relearning the user interface and getting old application working (or replacing them). Even for upgrades from Vista to Vista Service Pack 1 there were so many land mines that Microsoft decided to hold off general availability of SP1 via Windows Update for several more months.

One of the reasons I picked this model was its large hard disk, because I was planning to also run Ubuntu. I downloaded the ISO image and burnt it to DVD using the burner software included with Vista. Ubuntu initially boots off a live DVD that includes an installer. The installation was fairly straightforward. The installer shrank the Windows NTFS partition to make space for Ubuntu. After the main installation it downloaded close to 200 updated packages and fixes, then it was all done. The default configuration took up only 2.4 GB of disk space.

I was impressed that I can access shared folders and volumes on Windows machines from Ubuntu, as well as being able to read files in the NTFS (Windows Vista) partition on the drive.

There were two driver issues however, which I have yet to resolve [now partly resolved, see updates below!]:

  • The sound hardware is missing a driver. The loadspeaker symbol in the top right corner of the desktop is showing disabled and I can’t get sound output on the builtin speakers.
  • The builtin wireless card doesn’t appear to be suppported. I can only connect to the LAN and internet by using a wired connection.

In general, driver support in Ubuntu is good, but there are obviously still some rough edges. It would help if Gateway and other manufacturers were to offer pre-configured Ubuntu machines, as Dell already does.

Similar driver issues can occur on Vista. In fact, last week I was helping set up an AOpen MiniPC, which had been upgraded to Vista after a memory upgrade from 512 MB to 1 GB and it also had issues with its wireless, which wasn’t supported until a couple of Windows Update runs.

I think Linux and in particular Ubuntu will become an increasingly serious challenger to Microsoft’s de-facto monopoly on the desktop and not before time.

Update, 2008-03-14:
Ubuntu 7.10 (“Gutsy Gibbon”, released in October 2007) detects the sound hardware on this Intel chipset, but there doesn’t seem to be a driver for it yet. When I enter ” lspci -v” at the shell prompt, it lists this:

00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
Subsystem: Gateway 2000 Unknown device 0380
Flags: fast devsel, IRQ 22
Memory at fa500000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [50] Power Management version 2
Capabilities: [60] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-
Capabilities: [70] Express Unknown type IRQ 0

I checked the sound drivers for Intel chips listed at http://www.alsa-project.org/main/index.php/Matrix:Vendor-Intel and it appears the ICH8 chipset is not supported yet.

Update, 2008-03-18:
The Marvell TOPDOG wireless adapter is now working with Ubuntu, by following the advice given by others and installing the Windows 2000/XP drivers for the hardware using ndiswrapper. I had first tried the Vista driver, but had no luck with that. The Ndiswrapper project page on SourceForge specifically recommended to avoid Vista drivers and use Windows 2000 or XP NDIS drivers. For PCI device ID 11AB:2A08 you need the NetMW14x.inf file which references the two driver files NetMW143.sys (for Windows 2000) and NetMW145.sys (for Windows XP).

The following threads and instructions proved very helpful, please read them both if you have the same problem as I did:

  1. https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper
  2. http://ubuntuforums.org/archive/index.php/t-575785.html

Here is what I did after installing the Ndiswrapper software and copying over the Windows drivers from a Windows machine where I had run the installer:

$ sudo ndiswrapper -i NetMW14x.inf
installing netmw14x …
$ sudo ndiswrapper -a 11ab:2a08 netmw14x
WARNING: Driver ‘netmw14x’ will be used for ’11AB:2A08′
This is safe _only_ if driver netmw14x is meant for chip in device 11AB:2A08
$ sudo ndiswrapper -l
netmw14x : driver installed
device (11AB:2A08) present

After that I followed the instructions for Configuring Wireless Network Settings. Voila! Wireless network connectivity under Ubuntu anywhere in the building!

Update, 2008-04-16:
Drew’s advice on how to get sound working did the trick for me too: I can now use the audio on my Gateway M-6750. I ran this as he suggested:

sudo apt-get install linux-backports-modules-generic

and restarted the machine. Thanks, Drew!