How to extend the wireless network with OpenWrt

openwrtwifi

I have two routers, both running OpenWRT 10.04

The first is a WRT160NL router connected to my ISP. I am using it as an access point with the ESSID of "160AP". It's WEP password is "AAAAA" and it's broadcasting on on channel 5.

My purpose: extend the range of this first router with another router. My other router is an Asus WL500GPv2.

Documentation for bridging is on the OpenWRT wiki here.

Following Step 1 I edited /etc/config/wireless to look like this:

config 'wifi-device' 'wl0'
    option 'type' 'broadcom'
    option 'channel' '5'
    option 'disabled' '0'

config 'wifi-iface'
    option 'device' 'wl0'
    option 'network' 'lan'
    option 'ssid' '160AP'
    option 'mode' 'sta'
    option 'encryption' 'wep'
    option 'key' 'AAAAA'

Now I am trying to run the wifi command:

root@OpenWrt:~# wifi
Command 'set wepkey' failed: -1
root@OpenWrt:~# 

What am I missing? The 5 character password for the WEP is good. The SSID and channel of the WRT160NL is good too.

If try to continue: (XX:XX:XX:XX:XX:XX is the MAC of the WT160NL wlan0):

root@OpenWrt:~# iwconfig wl0
wl0       IEEE 802.11-DS  ESSID:"160AP"  
      Mode:Managed  Frequency:2.432 GHz  Access Point: XX:XX:XX:XX:XX:XX
      Bit Rate=54 Mb/s   Tx-Power:32 dBm   
      RTS thr:off   Fragment thr:off
      Power Management:off
      Link Quality=5/5  Signal level=-52 dBm  Noise level=-92 dBm
      Rx invalid nwid:0  Rx invalid crypt:7  Rx invalid frag:0
      Tx excessive retries:0  Invalid misc:0   Missed beacon:0

So does this mean that the "Command 'set wepkey' failed: -1" message was just a warning, and it actually connected?

So I continued as follows:

Editing /etc/config/network:

#### LAN configuration
config interface lan
    option type     bridge
    option ifname   "eth0.0"
    option proto    static
    option ipaddr   192.168.1.2
    option netmask  255.255.255.0

Disabled the firewall:

$ /etc/init.d/firewall stop
$ /etc/init.d/firewall disable

Edit /etc/config/dhcp

config dhcp lan
    option interface        lan
    option start    100
    option limit    150
    option leasetime        12h
    option ignore   1

Restarting DNS services:

$ /etc/init.d/dnsmasq restart

Then I rebooted the router and scaned the available wireless networks from my notebook. But here comes the fun part (At this point I've been trying to solve this for about ~2 hours now, so yes, very funny):

I can Only see the "160AP" Access Point which is the original WT160NL router. (I think this because the signal strength is the same… my notebook is next to the WL500GPv2).

What is the problem with my setup? What am I missing?

Best Answer

The user fyi on the OpenWRT forum suggested that using WEP is a bad idea for bridges and that using WDS instead could fix this. Did you try that?

In reviewing your configs and comaring them to the tutorial you linked, it looks like you might be missing a whole section. In /etc/config/wireless you need two sections titled config 'wifi-iface'. Both of them are for the same device but one will have option 'mode' 'ap' and the other option 'mode' 'sta'. It looks like you only have the 'sta' one on your configs. Can you post a full config file dump from both units?

Related Question