OpenWrt Forum Archive

Topic: Using WRT54GL as wireless AP and wireless client at the same time

The content of this topic has been archived on 24 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have finally upgraded my WRT54GL device to Kamikaze 8.09RC2 (coming from White Russian) and tried to configure the device according to this repeater howto: http://wiki.openwrt.org/Repeater
The client part works fine and I was also able to create an access point at the same time, but unfortunately I am unable to connect to it with any client. It is visible but when trying to associate with that AP the connection always times out.

These lines appear in the log on the client trying to connect to the AP:

wlan0: authenticate with AP 02:1a:70:a2:ba:1d
wlan0: authenticate with AP 02:1a:70:a2:ba:1d
wlan0: authenticate with AP 02:1a:70:a2:ba:1d
wlan0: authentication with AP 02:1a:70:a2:ba:1d timed out
wlan0: direct probe to AP 02:1a:70:a2:ba:1d try 1
wlan0 direct probe responded
wlan0: authenticate with AP 02:1a:70:a2:ba:1d
wlan0: authenticate with AP 02:1a:70:a2:ba:1d
wlan0: authenticate with AP 02:1a:70:a2:ba:1d
wlan0: authentication with AP 02:1a:70:a2:ba:1d timed out

It does not matter which encryption the AP uses. Even with no encryption at all the result is the same.
Is there anything I might have missed somehow?

In the meantime I have played around with the settings a bit and as soon as I remove the virtual client interface, the access point immediately works as expected. Re-adding the client interface makes it impossible for clients to associate again.
Is there anything else I could try? Is this a known bug in Kamikaze 8.09RC2? If so, is there a work-around available (e.g. manually configuring the interfaces?)?

Any help is very appeciated.
Thanks.

Which kernel did you pick?

Looks like 2.6 (wlan0). Broadcom wifi on kernel 2.6 can't handle multiple wifi networks yet.
@Penguin: You should try with the brcm-2.4 variant instead.

Edit:
nvm, log above was from a client.

~ JoW

(Last edited by jow on 9 Feb 2009, 04:25)

I'm using the 2.4.35.4 kernel on the WRT54GL.

This is a difference from 7.09: you can only bridge the wireless to WAN or LAN, not both (on broadcom 2.4).  Otherwise your client just endlessly tries to asscociate.

/etc/config/network:

config    switch eth0
    option vlan0        "0 1 2 3 4 5*"

config interface loopback
    option ifname        lo
    option proto        static
    option ipaddr        127.0.0.1
    option netmask        255.0.0.0

config interface wan
    option ifname        wl0                     #### NOT eth0.1
    option proto        dhcp
    
config interface lan
    option ifname        eth0.0
    option type        bridge
    option proto        static
    option ipaddr        192.168.1.1
    option netmask        255.255.255.0

/etc/config/wireless:

config wifi-device  wl0
    option type        broadcom
    option disabled        0

config wifi-iface
    option device        wl0
    #option network        wan                     #### DON'T USE THIS 
    option mode        sta
    option ssid        remote
    option encryption    wep
    option hidden        1
    option isolate        0
    option bgscan        0
    option wds        0
    option key        1
    option key1        **********          #### hex key

config wifi-iface
    option device        wl0
    option network        lan
    option mode        ap
    option ssid        local
    option encryption    psk+psk2
    option hidden        1
    option isolate        0
    option bgscan        0
    option wds        0
    option key        ******************             #### ascii key

(Last edited by Belfry on 9 Feb 2009, 15:42)

Even when removing the WAN from the wireless client interface, the AP does not work either. Only removing the virtual client interface alltogether makes it possible for clients to connect to the AP again.
Besides, even if it would work that way, it would be pretty much useless.

I have used the above configuration with 8.09 rc1 & rc2 .bin downloads on a WRT54GL.  This allows me to use it "as wireless AP and wireless client at the same time."  It purrs like a kitten: NAT and firewall rules function seamlessly, video plays well...

Did you notice the "option ifname wl0" line in /etc/config/network?  You might also have to add "wifi up" to /etc/init.d/custom-user-startup.  If all else fails, wipe your configurtion (mtd -r erase rootfs_data) and enter my configuration files (changing the ssids, encryption and keys of course.)

To other users who stumble upon this post wondering about this capability--this is the single best reason for upgrading to 8.09 using broadcom 2.4.  It cured the CPU spiking and reassociation problems inherent in 7.09.  Thanks Openwrt developers for the job well done!

(Last edited by Belfry on 9 Feb 2009, 19:37)

Oh, I'm sorry. I have totally missed that one. Thank you very much for your help. Seems to work now.

Oops!

One more thing you may have to do:  take your wireless mac address, add two to the first set and one to the last (it should match the mac address that a scanner app would reveal)  This seems to be a bug in 8.09 on the WRT54GL.

example mac wl0.1 = 00:01:02:03:04:05

add this to /etc/init.d/custom-user-startup:

ifconfig wl0.1 down
ifconfig wl0.1 hw ether 02:01:02:03:04:06
wifi up
sleep 10
wifi up

(Last edited by Belfry on 9 Feb 2009, 22:53)

Sorry for resurrecting this relatively old post (is one of the latest related to wifi repeater) but I want to know something:

I've been struggling for a while to set up a repeater bridge (whose clients belongs to the same IP range that the wired network) without success. I have my repeater working in STA+AP, the drawback is that there are lots of windows machines the network, and obviously the shares are not visible to the clients of the repeater so easily because they're in separate networks.

Belfry wrote:

This is a difference from 7.09: you can only bridge the wireless to WAN or LAN, not both (on broadcom 2.4).  Otherwise your client just endlessly tries to asscociate.

What Belfry says is true, if you put the AP and STA interfaces (wl0 and wl0.1 in my case) in the same bridge, the clients simply won't associate to the network, anybody knows WHY???

And one last question... Is the repeater bridge really a possibility???

Please help, I'm getting brain damage here, I've been trying to get this to work since May (my first post on the subject) without luck...

Thanks

Edit: Almost forgot, my hardware: two Linksys WRT54GL v1.1 with Kamikazee 8.09.1, r17456.

(Last edited by exelsus on 7 Sep 2009, 03:49)

nobody?!?! come on sad

IMHO I think a moderator should make some repeater/wds post sticky, because there are so MANY posts about it, and every one with different solutions...

I sucessfully tested at least multi-AP and WDS setups with brcm-2.4 on recent 8.09 branch revisions.

There are a couple of things to keep in mind:
* NEVER add the wireless ifnames to the network config directly, it's not supported and when it does work it is pure luck. Use the "option network" directive instead
* Broadcom VIFs don't handle unicast traffic properly if they are NOT within a bridge, symptoms are that dhcp works but ping not
* OpenWrt versions prior to 8.09.1 had a bug in the VIF-MAC-assignement which prevented WPA from working
* The standard configuration as suggested in the documentation worked for me with multi-AP, bridged client and WDS scenarios

Regards,
JoW

Which version of OpenWRT are you guys using?

I'm trying the following on Kamikaze 8.09.1 on a WRT54GL:

config 'wifi-device' 'wl0'
    option 'type' 'broadcom'
    option 'disabled' '0'
    option 'channel' '6'
#        option 'channel' '7'

config 'wifi-iface'
    option 'device' 'wl0'
    option 'network' 'lan'
    option 'mode' 'ap'
    option 'ssid' 'name1'
        option 'encryption' 'psk2'
        option 'key' 'key1'

config 'wifi-iface'
    option 'device' 'wl0'
    option 'ssid' 'name2'
    option 'network' 'wan'
    option 'mode' 'sta'
    option 'encryption' 'wep'
    option 'key' 'key2'

and get

 wifi
Command 'set ssid' failed: -1

I found a bug report here:
https://dev.openwrt.org/ticket/4777

that claims is fixed on 8.09.1 but is clearly not.

Thank you
Misha

I have a working repeater setup on my asus wl-500gp with broadcom radio wunning openwrt 8.09.1.
There was an issue with 'user.info sysinit: Command 'set ssid' failed: -1'.
To overcome this I executed the following commands:

     ifdown wan && ifup wan
     iwconfig wl0 essid 'ap-essid' (since the AP doesn't have any encryption)

After that the wl0 (wan) interface succesfully associated with the AP and obtained the ip addres through dhcp.
The AP mode on the router is running ok.

I don't know the exact problem origin, but maybe related to the:

config interface wan
    option ifname        wl0                     #### NOT eth0.1
    option proto        dhcp

since the wl0 interface has to be first initialized by the 'wifi up' command executed in /etc/init.d/network.
But I don't know enough about openwrt configuration scripts, so I'm not sure abouth this.

(Last edited by matt1606 on 2 Nov 2009, 22:02)

The discussion might have continued from here.