Update (9.4.2009): Whiterussian has been superseded by Kamikaze, therefore the information given in this post are to be considered out-of-date, and most of the links are dead anyway.
Please refer to openwrt.org for up-to-date information.
Need to run a WRT54GL wireless router in client mode? I’m so happy I made it myself work, that I decided to write down the steps, since it isn’t that easy after all.
Note: Here below you will find the exact steps I have done to make the WRT54GL work in client mode, that is, making it capable to connect a wireless network and give access to internet to the computers cabled to it.
This means that you will make the router working in a reverse way; that is, you will be able to connect to an internet provider wirelessly through the antennas (instead of the the internet slot on the back of the router, that will become inactive), and you will connect your computer to it through one of the four connection on the back of the router.
For a more detailed description of the process (in case the procedure below doesn’t work for you), please refer to the OpenWRT documentation (especially the HOWTOs and Client Mode Wireless) and to the OpenWRT forum.
The firmware version I’m using is White Russian (RC6), Kernel Version Linux version 2.4.30. It should, however, work also with newer versions.
To run a Linksys WRT54GL in client mode you can try the following procedure:
- Power on your WRT54GL and connect it to your computer by a network cable connected in one of the four slots on the back of the wireless router (NOT into the internet slot!)
- First of all you have to install the OpenWrt firmware on your WRT54GL. This means that you will overwrite the firmware that comes with the device. Do this at your own risk, you can of course reinstall later the original Linksys firmware by downloading it from its website, but if you make some mistakes during the process and lose access to the firmware of your device, you have to solve the problem on your own, since this process will void your guarantee.
To install OpenWrt, read and follow carefully these steps. Since you have to do some choices during the process, let me remark the following:
- Choose the OpenWrt firmware called openwrt-wrt54g-squashfs.bin found in the default directory
- Save it on your hard disk (for example on the desktop)
- Access the router web interface page at 192.168.1.1
- Update the firmware going to system – > administration – > firmware upgrade
- Wait (don’t do anything) until you get the message that the firmware has been updated
- Reload on your web browser the address 192.168.1.1 and you will enter the OpenWRT web interface.
- By clicking, for example, on Info, you will be asked to choose a password. Do it. Your username will be automatically root
- Go now to the System page and switch boot_state to enabled
- Log into WRT54GL using telnet, ssh or similar. For example I used the ssh client Putty, configuring it to access to the address 192.168.1.1. Logging in, you will be asked for the username. Put root, and as the password, the one you have chosen in the previous step.
- Ok, now you have to enter the commands that will make your WRT54GL work as a client (as described in this page). I made my router work in routed client mode by running the following commands:
nvram set wl0_mode=sta nvram set lan_ifname=br0 nvram set lan_ifnames=vlan0 nvram set wan_ifname=eth1 nvram set lan_ipaddr=192.168.2.1 nvram set lan_proto=static nvram set wan_proto=dhcp
- Now you have to commit the changes and reboot the device. To do this run the following:
nvram commit reboot
After doing the reboot, Putty will tell you that you’ve lost the connection to 192.168.1.1. Don’t worry! That’s ok.
- Wait a minute and then disconnet the network cable that connects your computer with the router and connect it again. Now your device is not accessible anymore at the ip address 192.168.1.1, but it’ll be at 192.168.2.1. You can check it by accessing the OpenWRT web interface. Do it, you might be asked to set your password again.
N.B.: if you can’t connect to the router anymore, don’t panic! You can reset the configuration entering in Failsafe mode (more information below)
- Open again a connection to the router via ssh using Putty (remember to change the address to 192.168.2.1)
- Check out the available wireless networks running the command
iwlist eth1 scanning
If nothing shows up, run it again. I’ve noticed that it needs to be run several times, before it shows all the available wireless networks in range.
The networks are listed as Cell 01, Cell 02, and so on. For each of them you will find its name (ESSID) and its channel (CHANNEL_NUMBER). To connect to a no-encrypted network, run the following commands from the ssh shell (replace ESSID and CHANNEL_NUMBER with real name and channel number of the chosen network, respectively):
ifdown wan nvram set wl0_ssid=ESSID nvram set wl0_channel=CHANNEL_NUMBER ifup wan; /sbin/wifi
For an encrypted network, run the following (replace WEP key in hex format with the real WEP key)
ifdown wan vram set wl0_ssid=ESSID nvram set wl0_channel=CHANNEL_NUMBER nvram set wl0_wep=enabled nvram set wl0_key=1 nvram set wl0_key1=WEP key in hex format ifup wan; /sbin/wifi
Don’t forget to commit if you want your settings to survive a reboot:
- You’re done! Now you should be able to access the internet. If so, you can close the ssh connection. The settings are already saved and they will be kept even if you turn off the device.
Troubleshooting: I can’t access the router anymore!!!
If at a certain step you can’t connect to the router anymore, you can reset its configuration entering in Failsafe mode (read carefully the linked page). Here are the steps if you use Windows:
- Download the recvudp utility and save it somewhere (e.g. on your desktop).
- Open a DOS shell (a command prompt) and run the recvudp.exe that you have just saved
- Running it nothing will happen, the cursor will just blink on the following line. That’s ok.
- Go to the properties of the network from your control panel and set a fixed IP in the TCP/IP preferences (192.168.1.10 will do the job)
- Switch off the WRT54GL and switch it on again. You will notice that the DMZ light (on the front of the device) is off. As soon as it gets on, press the reset button on the back. You will notice that now the DMZ light will quickly flash 3 times every second.
- In the DOS window you have open in step 2, you will notice that the following messages have appeared:
Msg from 192.168.1.1: Press reset now, to enter Failsafe! Msg from 192.168.1.1: Entering Failsafe!
- Good. Now open a new ssh session with Putty on the address 192.168.1.10.
- To reset the router, run the following command:
- You can now exit Putty and, going back on the network configuration, reset in the TCP/IP properties to obtain an IP address automatically.
- You are now back at the step 3 of the procedure explained above, that is at the point when you just installed the OpenWRT. You should be now able to access the OpenWRT configuration at the web address 192.168.1.1. You can try again to set the router in client mode in case you are not sure that you have carefully followed the steps depicted above.