Extend Wireless Router Capabilities using a Netbook/Laptop

You now have a range of devices which are wifi enabled. You may wish for a wireless router in circumstances where you do not have one. The additional functionality of Network Manager 0.98 becomes a great convenience. Fedora 18 includes this version of Network Manager and most new distributions will now have it.

In addition to the Infrastructure and Ad-hoc modes, Network Manager now supports the Access Point (ap) mode.

Currently, 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 for the network. KDE network management offers greater flexibility in configuing 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. E.g. brcmsmac used by my Lenovo netbook does not support it. However, ath5k used by EEEPC 701 does support it.

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 distribution 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, e.g., /dev/sdb1 in the grub configuration file.

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

Bridged Router

It is very simple to set up OpenWRT as a simple wireless router. You define the wifi mode as 'ap' (access point) and specify the ssd, 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 whole premises. You may need to extend the range of your wifi 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 depend upon driver used. The various options can be found in http://wiki.openwrt.org/doc/howto/clientmode. Various recipes are available on the same wiki.

If the driver supports WDS (Wireless Distribution System) or similar functionality, the setup is fairly simple. You just need to set it up as a client of the main access point and in the wifi-iface section, add the 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 wifi relay/repeater will silently fail.

You can rely upon alternate setups which achieve similar goals.

Relay Client

You need the wifi 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 setup as a single network. OpenWRT recipes will call this a “routed client with relayd”. The relayd package implements functionality of wds. The key part of 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 wifi interfaces, each with its own ssid. This setup 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:

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.

Routed Client

The second option is that the second wifi 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:

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 lan will be outside the adress range of the main router. The firewall is preconfigured to forward traffice from lan to wan.

OpenWRT is a linux distribution. So, in principle, you should be able to add packages to your normal distribution and create an wifi extender on your normal laptop. You would lose the convenience of NetworkManager. You may not want to use it everyday but it would be a fun thing to try.

July 2013

Comments