I bought a pair of Linksys WRT54GL wireless routers. I used these routers to allow internet connections around my apartment. One is connects directly to my ASDL modem, and that one is also used for connecting computers in that room. The second one uses a wireless connection (called wireless ethernet) to the first one to allow internet access in a second room without needing to run a cable. I have also encrypted this connection using WPA, which means that this connection should be secure.
Contents |
OpenWRT
The first step is installing OpenWRT on both routers. This is an alternate firmware that you can install on the routers. It basically turns them into little Linux boxes. This allows them to perform many functions that they were not originally intended, like wireless ethernet.
The caveat is, of course, putting an unofficial, unsupported OS on your router voids you warranty. So it takes a little bit of bravery to do this.
The Basics
The OpenWRT Wiki does has a pretty good article on how to set this up. I'm not going to duplicate those instructions here. However I am going to give a bit more of a complete run through on what I did to set mine up.
I'm also going to assume that you are logging into your routers via telnet or ssh. Some of these steps require terminal access.
- First, we'll call the router that is directly connected to the internet router1. The other router, the one that wirelessly connects to router1 to obtain it's internet connection, is called router2.
- router1 is configured as a basic access point (AP). For an encrypted connection, this means installing nas. It also means you should have picked an SSID, a channel and a WPA preshared key(PSK). For help picking a secure PSK, use this page. Your network is only as secure as your WPA key, so use a nice long, random key. I believe that router1 can be any router capable of running as an wireless AP.
- router2 does not require nas installed. Its hardware will handle the WPA connection. However its configuration is more complex.
- Remove /etc/init.d/S35firewall. router2 does not have a direct internet connection so it does not need to have a firewall installed. As well, the firewalling could get in the way of your intranet connections. If you are more paranoid, you could leave a firewall set up, but the default one is probably a bit too restrictive.
- Remove /etc/init.d/S60dsnmasq. router2 will not be acting as the DHCP server, so we don't want it running. router1 will be managing all these services.
- Set the nvram variable wl0_mode=wet. This tells the router to act as a client instead of an access point.
- Now we need to configure the wireless connection. The following nvram variables should be set on both routers:
Basic Wireless
- wl0_ssid=<your ssid>
- wl0_channel=<your channel>
- wl0_infra=1
Encryption Settings
- wl0_akm=psk
- wl0_crypto=aes
- wl0_wpa_psk=<your key>
- wl0_lazywds=0
- wl0_wep=disabled
- wl0_auth=0
As well, you should configure each routers to have a static lan ip address.
On router1 set
- lan_proto=static
- lan_ipaddr=192.168.1.1
and on router2 set
- lan_proto=static
- lan_ipaddr=192.168.1.2
And that's it. For all the other settings, the defaults should be correct. If you made a bunch of other changes trying to get this working, consider resetting the nvram variables back to their defaults. If you have other values set, they could interfere with these setting. Once you've done all these steps reboot both routers and they should automatically create the wireless ethernet connection.
Troubleshooting
Here are some problems I had.
WDS
I messed around with WDS, but did not get it working properly. Having wl0_wds and wl0_maclist set caused the above to not work properly.