Sunday, October 12, 2008

Wireless bridge to debug Gumstix

If you debug Gumstix over Ethernet, you will soon realize the networking in Ubuntu 7.01 is not very well supported, especially if you try to constantly switch between wireless and wired connections. It would certainly be more convenient to have the Gumstix be on the same wired network as your development station. Also, if you have a wireless setup going at home, then having a bridge between the wireless and wired networks becomes absolutely essential.

The following steps allow you to set up a wireless client bridge. The Gumstix and development PC are on the remote wired network. The remote wired network is connected to the main wireless network through the client bridge. The network may look something as below:


Internet cloud
+ ---> cable modem
+ ---> netgear router (mr814 802.11b)
---/wireless/---
+ Linksys wrt54g (802.11b/g)
--- wired network ---
+---> PC
|---> Gumstix


(I wanted to have wireless G routers all around, but since I didn't want to spend money and had an older, spare wireless B router sitting at home, this is the network I had to work with.)

Typically, the older router should be the "main" router that connects to the cable modem because

  • the network capabilities (e.g. throughput and protocol) will, typically, be decided by the older router
  • older routers will, typically, have lesser support and configurability
  • lowest common denominator will be the dominant bottleneck



By design, the Linksys wrt54g v5 firmware doesn't allow the device to be configured as a network bridge. However, this feature may be enabled by replace the firmware with the open source dd-wrt. This may be performed according to instructions from the bit-sum page.

The instructions to get the new firmware are pretty straightforward and fool-proof.

Once dd-wrt is up and running, the following will need to be done on the PC and the two routers to set the bridge.

The generic instructions are here
NOTE: for whatever reason, dd-wrt seems to work better with IE.

  • If using a laptop, ensure that the laptop's wireless is disabled
  • Connect PC's Ethernet port to one of the LAN ports (not WAN) of the secondary router with an Ethernet cable
  • Give the PC a static IP on the same subnet as the secondary router's ip. E.g. if the secondary router's default address is 192.168.1.1, then set your PC's static IP to 192.168.1.10. Preferably the address should be outside the DHCP address range served by the router.
  • main router's WAN should be set up to DHCP (or however the ISP recommends so that router gets a valid IP address when connected to a working cable modem)
  • set "main" router (mr814) LAN ip address to be 192.168.1.1. This is the private (home) network that is managed by the main router
  • set dhcp to be on
  • set dhcp range 192.168.1.100 - 192.168.1.150 (these are the addresses that fall under dhcp)
  • disable the "secondary" (wrt54g) router's DHCP server
  • set "secondary" router IP to 192.168.1.2 (this should be on the same subnet as the "main" router)
  • set DNS servers to be those obtained from the ISP or 192.168.1.1 ("main" router)
  • save settings
  • apply settings
  • Select Status | Wireless | Site Survey
  • Ensure that the target wireless network is visible ("main" router)
  • Click "Join"
  • Save and Apply Settings
  • Power cycle the secondary router
  • Once the router comes back up, ensure that it is reachable at 192.168.1.2.
  • If for whatever reason, this fails, use the reset button: hold down the reset button while the router is on. Pull the power cord. Wait 10 seconds, attach power cord again. Try reaching the router at 192.168.1.1 when connected directly to one of its lan ports.

No comments: