OpenWrt Forum Archive

Topic: help to configure Kamikaze with wds between 2 linksys wrt54gl routers

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

Hi,
  I have 2 Linksys wrt54gl routers with kamikaze 7.09 installed. One is setup as an Access Point and is working great, but I've bought another to create a wireless bridge and having problems creating a wds link between them. This is my current config:

Router 1 (my main AP):

config wifi-iface
        option device   wl0
        option network  lan
        option mode     ap
        option ssid     home
        option hidden   0
        option encryption psk
        option key "1234567890"

config wifi-iface
        option device   wl0
        option network  lan
        option mode     wds
        option ssid     wdsap
        option encryption none
        option bssid "00:1C:x:x:x:x" (mac of other router)

Router 2 (the new one)

config wifi-iface
        option device   wl0
        option network  lan
        option mode     ap
        option ssid     home
        option hidden   0
        option encryption psk
        option key "1234567890"
                                                       
config wifi-iface
        option device   wl0
        option network  lan
        option mode     wds
        option ssid     wdsap
        option encryption none
        option bssid "00:1C:x:x:x:x" (mac of other router)

I couldn't really find any docs on how to set this up, so I'm not sure if my second router needs to also be setup as an Access point, accept this related line in the docs "WDS links can only be used in pure AP mode and cannot use WEP (except when sharing the settings with the master interface, which is done automatically)." I'm not entirely sure what this means, I'm assuming it means my second router also needs to be an Access Point. I've  tried taking out the Access Point settings on the second router config and I get an error trying to restart the networking (Command 'set up' failed: -1) so this is the best I've come up with. However it's not working, I'm getting this error in the logs: "wds0.1: attempt to add interface with same source address." so have I maybe mis configured the network settings? Any help or suggestions would be great.

Right I got it eventually smile I first tried disabling encryption on all the configs and that allowed it to start working (wish I'd tried this sooner smile ). I then put the authentication back for both the ap and wds config and it still works, so looks like I was nearly there, just needed to be consistent with the authentication. Here's the config I ended up with:

Router 1 & 2:

config wifi-iface
        option device   wl0
        option network  lan
        option mode     ap
        option ssid     home
        option hidden   0
        option encryption psk
        option key "1234567890"

config wifi-iface
        option device   wl0
        option network  lan
        option mode     wds
        option ssid     home
        option encryption psk
        option key "1234567890"
        option bssid "00:1C:x:x:x:x" (other router mac)

Has this actually worked for you. You may have to change some scripts to make it work properly.


Read this (this comes up every now and then, the script hasn't been fixed though).
http://forum.openwrt.org/viewtopic.php?id=11472

Well I guess I'm not totally sure the encryption part is enabled, have you any suggestions on how I can prove this? After reading that tread I tried changing the key on one of the routers (just for the wds part) and after a couple of reboots the connection wasn't being made. I had a look at the  /etc/hotplug.d/net/20-broadcom_wds script and doesn't seem quite the same as the one shown as edited and my version already has a sleep 1 command in there.

include /lib/wifi

setup_broadcom_wds() {
        local iface="$1"
        local remote="$(wlc ifname "$iface" wdsmac)"

        [ -z "$remote" ] && return

        config_cb() {
                [ -z "$CONFIG_SECTION" ] && return

                config_get type "$CONFIG_SECTION" TYPE
                [ "$type" = "wifi-iface" ] || return

                config_get network "$CONFIG_SECTION" network
                [ -z "$network" ] && return

                config_get addr "$CONFIG_SECTION" bssid
                addr=$(echo "$addr" | tr 'A-F' 'a-f')
                [ "$addr" = "$remote" ] && {
                        local cfg="$CONFIG_SECTION"

                        include /lib/network
                        scan_interfaces

                        setup_interface "$iface" "$network"

                        config_get encryption "$cfg" encryption
                        config_get key "$cfg" key
                        config_get ssid "$cfg" ssid

                       [ "$encryption" != "none" ] && {
                                sleep 1
                                nas4not lan "$iface" up auto aes "$encryption" "$key" "$ssid"
                        }

                }
        }

        config_load wireless
}

case "$ACTION" in
        add|register)
                [ "${INTERFACE%%0.*}" = wds ] && setup_broadcom_wds "$INTERFACE"
        ;;
esac

Do you see the code below?

                      [ "$encryption" != "none" ] && {
                                sleep 1
                                nas4not lan "$iface" up auto aes "$encryption" "$key" "$ssid" 
                        }

It is inadequate for you to use a WDS with any encryption. As it defaults to trying to establish WPA2 encryption which a WRT would be unable to establish (due to binary drivers that have bugs). You have to have your WDS with WPA encryption so you have to modify the line above to be more responsive to what kind of encryption you chose.

Right, Ok I see now, thanks for pointing that out. So if I change that part of the script as per the link above to:

sleep 10

                        case "$encryption" in
                                psk|PSK)
                                        nas4not "$network" "$iface" up auto tkip psk "$key" "$ssid"
                                ;;
                                psk2|PSK2)
                                        nas4not "$network" "$iface" up auto aes psk "$key" "$ssid"
                                ;;
                                psk+psk2|psk2+psk|PSK+PSK2|PSK2+PSK)
                                        nas4not "$network" "$iface" up auto aes+tkip psk "$key" "$ssid"
                                ;;
                                *)
                                ;;
                        esac

that should enable the encryption. Can I ask if you know of an easy way  to check that encryption is actually enabled or not after adding this code? I'd just feel a little happier to prove that it has worked. Running a standard network scan with "iwlist wl0 scanning" just shows my main access point and shows that's encypted.

I dunno how exactly, but it should be.

The discussion might have continued from here.