Saturday, November 17, 2007

Wireless bridging with Linksys WRT54G

I had bought a Linksys WRT54G (version 2.0) a few years back for home wireless networking. Since I already knew that it was Linux based and eminently hackable, choosing this particular router was a no brainer. However, I never really bothered to upgrade the firmware because the stock firmware served my needs. In fact, after I bought a Huawei ADSL modem with a 4-port switch and wireless, the WRT54G was idling in the back of my cupboard.

In my recent trip to San Jose (Sep/Oct), I was waxing ebulliently about VoIP ATA adapters to my friend Ramesh Panuganty when the topic of putting the VoIP phone in another room came up. These ATA adapters (Linksys PAP2T, Grandstream Handytone 503 etc) come with a regular ethernet port. Both our homes don't have a wired LAN configured, so this was a problem. When we looked at wireless bridging options, we found the solutions to be quite expensive and supported only one port (See Linksys WET54G for example, 90 bucks for 1 ethernet port!).

Compare that to the price of Linksys WRT54GL for only $64 at the same website. You can get other brands like Netgear or Buffalo for even cheaper. So the question of whether you can use these devices for bridging to LAN segments came up. A bit of googling and reading confirmed that this is called "Client-Bridge" mode and is supported by all of the open source firmware options for the WRT54G.

Incidentally, I was feeling a dire need for a ethernet hub to debug the SIP registration problems (no low end home networking switch seems to support span). Wouldn't it be nice to run tcpdump right on the WRT54G for this purpose? So it was time to dust out my little box and play with it. It turned out to be surprisingly simple. I initially downloaded the DD-WRT version which seemed to be more popular. Following the advice in the wiki pages, I first downloaded flashed the mini generic version of v23 SP2. Without even checking it out immediately upgraded to the WRT54G "voip" version (no good reason, the "voip" just sounded attractive :-). Wireless bridging worked beautifully. Just configured my SSID and my WEP key and everything worked flawlessly.

There was one small problem. After wasting half an hour on it I realized that my 4MB box had no free space to install tcpdump. So I switched to the mini WRT54G version which gave me enough space. After wasting another half an hour on it because I didn't configure the IP router and DNS correctly, I managed to install tcpdump package using ipkg. Only, tcpdump didn't work. I always got a bus error. Okay, what next?

Fortunately I had already downloaded X-WRT image bundled with the OpenWRT "White Russian" firmware. I download the X-WRT because it promised a better Web UI and I didn't really want to muck around with the CLI trying to configure the box. This one worked great. The original settings from the DD-WRT firmware worked fine for the OpenWRT firmware too. I was able to get tcpdump working. OpenWRT is more Linux/Debian like (more software options and no weird Microsoft like SP2 naming for the image). So everything is hunky-dory now :-).

No comments: