Extend Wireless Router Capabilities Using a Netbook or Laptop

1
5478

There are now a range of devices that are Wi-Fi enabled. So for situations where a wireless router is required, the additional functionality of Network Manager 0.98 is a great convenience.

Fedora 18 includes NetworkManager 0.98 and most new distributions will now have it. In addition to the Infrastructure and Ad-hoc modes, NetworkManager now supports the Access Point (AP) mode.

Currently, the nm-applet does not offer a way to configure an access point. GNOME 3 includes the option to create a hotspot by just clicking a button. It uses WEP encryption and assigns a password to the network. KDE network management offers greater flexibility in configuring an access point.

In case you are using a lightweight distribution, you can configure an access point by creating a hotspot file in /etc/NetworkManager/system-connections. You may then start it manually. You can route the traffic from the hotspot to the Ethernet interface.

The limitation is that not all drivers support this mode. For instance, brcmsmac, which is used by my Lenovo netbook, does not support it, though ath5k, which is used by EEEPC 701, does.

This brings up an interesting option. Can you use an old system like an EEEPC 701 easily as a ‘proper’ router, and what flexibility would it offer?

The answer, of course, is ‘yes’. You may download and use generic x86 distributions like the OpenWRT distribution in snapshots/trunk/x86/ from http://downloads.openwrt.org/. You can copy it on a USB stick and may need to change the root partition from /dev/sda1 to, for instance, /dev/sdb1 in the Grub configuration file.

The generic distribution includes a limited number of drivers and you may need to download the additional drivers. In my experiments, the Ethernet driver needed for Lenovo S10 was included. However, the brcmsmac needed for wireless was not included. As mentioned earlier, the brcmsmac does not have the support for access point mode and is not very useful as a router. However, I could use the netbook to download the drivers needed for EEEPC 701 and use the USB stick on EEEPC 701 for further experiments.

A bridged router
It is very simple to set up OpenWRT as a simple wireless router. You define the Wi-Fi mode as ‘AP’ (access point) and specify the SSID, the encryption type and the key. The wireless and the LAN are bridged by default.

Chances are that you may already have a wireless router. However, its range may not cover the entire premises. You may need to extend the range of your Wi-Fi connection by using a repeater. Inexpensive routers do not come with this option. However, it is pretty simple to implement this functionality in OpenWRT.

OpenWRT offers a number of ways to achieve this goal, which depends upon the driver used. The different options can be found in http://wiki.openwrt.org/doc/howto/clientmode.  The various recipes are available on the same wiki.

If the driver supports WDS (Wireless Distribution System) or similar functionality, the set-up is fairly simple. You just need to set it up as a client of the main access point and in the Wi-Fi-iface section, add the following option:

option wds 1

Both the access point and the repeater need to support WDS. In case the driver does not support WDS, there will be no warnings or errors and the effort to act as a Wi-Fi relay/repeater will silently fail.

You can rely upon alternate set-ups that achieve similar goals.

A relay client
You need the Wi-Fi to work as an access point for your wireless devices. You also want it to work like a client of your primary router. The router needs to relay the data across the two modes.

The first option makes the entire set-up turn into a single network. OpenWRT recipes will call this a ‘routed client with relayd’. The relayd package implements the functionality of WDS. The key part of the wireless configuration file will be:

config wifi-iface
option device 'radio0'
option mode 'sta'
option network 'wan'
option ssid 'Wifi-network'
option encryption...
config wifi-iface
option device 'radio0'
option mode 'ap'
option network 'lan'
option ssid 'Wifi-relay'
option encryption...

You will notice that the single physical device has two virtual Wi-Fi interfaces, each with its own SSID. This set-up is, hence, not totally transparent. Your device will need to explicitly connect to the access point or the relay.

The corresponding network configuration will contain the following code:

config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.254'

config interface 'wan'
option proto 'dhcp'

config 'interface' 'stabridge'
option 'proto' 'relay'
option 'network' 'lan wan'
option ipaddr '192.168.1.253'

You will also need to disable the firewall.

A routed client
The second option is that the second Wi-Fi router establishes a separate network and routes traffic from this network to the access point. The configuration file for wireless remains the same as for the relay client. The network configuration file will contain the following:

config interface 'lan'
option ifname 'eth0'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.2.254'

config interface 'wan'
option proto 'dhcp'

The IP address for the LAN will be outside the address range of the main router. The firewall is preconfigured to forward traffic from the LAN to the WAN.

OpenWRT is a Linux distribution. So, in principle, you should be able to add packages to your normal distribution and create a Wi-Fi extender on your normal laptop. But you would lose the convenience of Network Manager. So you may not want to use it every day, but it is a fun thing to try out.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here