Joerg J - 2010-10-09

Hallo,

ich moechte ein WPA verschluesseltes WDS zwischen einem W500V und einem WRT54G aufbauen. Der W500V soll AP sein und WRT54 der Repeater.

Die Traumkonfig wäre WPA2//CCMP, das ist jedoch laut vielen Berichten im OpenWrt-Forum und hier schwierig, daher fange ich leicht an und wäre auch mit WPA/CCMP oder WPA/TKIP zufrieden.

Auf dem WRT54G setzte ich OpenWrt-Backfire 10.03 mit 2.4er Kernel ein, da dort auch der BroadCom Binary-Only-Treiber verwandt wird um möglichst kompatibel zum W500V zu sein. Auf dem W500V setze ich BitSwitcher 0.3.8 und gerade zum weiteren debuggen WRT500V ein.

Okay, was habe ich bisher getan: Ich habe out of the Box die WEB-Konfigmöglichkeiten benutzt in OpenWrt und BitSwitcher wie oben skizziert aufgesetzt.
Da es out-of the Box jedcoh nicht geklappt hat, habe angefangen das automatische WLAN-Konfigurieren auf beiden Seiten auszuschalten und zu besseren Nachvollziehbarkeit Skripte zu bauen.

Auf dem W500V spanne ich derzeit das WLAN wie folgt auf:

wlctl apsta 0
wlctl ap 1
wlctl channel 1
wlctl macmode 0
wlctl maxassoc 128
wlctl ap_isolate 0
ifconfig wl0 up
wlctl up
wlctl wds 00:0F:66:xx:xx:xx
nas -P /var/run/nas.br0.pid -H 34954 -l br0 -i wl0 -A -m 132 -k presharedsecret -s wlan -w 6 -g 3600

Auf dem WRT54G mach die automatiche Konfig für WDS etwas anderes wie die WDS-WPA-HowTo auf bitswitcher.sf.net.
Die OpenWrt Config /etc/config/wireless generiert folgende wl/wlc Codeschnippsel:

# /etc/confi/wireless
config wifi-device  wl0
        option type     broadcom
        option channel  1
        # REMOVE THIS LINE TO ENABLE WIFI:
        #option disabled 1
config wifi-iface
        option device   wl0
        option network  lan
        option mode     wds
        option ssid     wlan
        option encryption psk
        option key presharedsecret
        option bssid 00:03:04:05:06:02

Da macht die Skript-Magie von Openwrt daraus:

/sbin/wlc ifname wl0 down
/sbin/wlc ifname wl0 stdin
down
vif 0
enabled 0
vif 1
enabled 0
vif 2
enabled 0
vif 3
enabled 0
apsta 0
ap 1
infra 1
802.11d 0
802.11h 0
wme 0
rxant 3
txant 3
fragthresh 2346
rtsthresh 2347
monitor 0
passive 0
radio 1
macfilter 0
maclist none
wds none
wds 00:03:04:05:06:02
country IL0
channel 1
maxassoc 128
slottime -1
up
/sbin/wlc ifname wl0 stdin
/sbin/wlc ifname wds0.1 wdsmac

Dies zeigt der W500V dazu:

w500v# wl assoclist
assoclist 00:0F:66:xx:xx:xx
w500v# wl sta_info 00:0F:66:xx:xx:xx
 STA 00:0F:66:xx:xx:xx:
     rateset [ 1 2 5.5 11 18 24 36 48 54 ]
     idle 19 seconds
     in network 19 seconds
     state: AUTHENTICATED ASSOCIATED
     flags 0x59: BRCM

Beim "state:" fehlt leider "AUTHORIZED" um Pakete versenden zu dürfen.
Dies kann man schoen bei einen erfolgreich eingebuchten Laptop sehen:

w500v# wl assoclist
assoclist 00:90:05:xx:xx:xx
w500v# wl sta_info 00:90:05:xx:xx:xx
 STA 00:90:05:xx:xx:xx:
     rateset [ 1 2 5.5 11 18 24 36 48 ]
     idle 5 seconds
     in network 23 seconds
     state: AUTHENTICATED ASSOCIATED AUTHORIZED
     flags 0x11:

Okay, da es automatisch nicht ging habe ich die WPA_WDS-Howto auf der BS-Hauptseite probiert auf dem WRT,
da ja auch hier der Broadcom Binary-Only-Treiber zum Einsatz kommt. Die Syntax und Semantik vom wl/wlctl ist weitgehend gleich.

Hier das Script welches leider zum selben Ergebniss kommt, wie die Automatische Konfiguration. Das wl0 device ist
nicht gebrückt daher spare ich mir die ebtables-Rules.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
set -x
CHANNEL="1"
SSID="wlan"
WPA_PSK='presharedsecret'
BSSID="00:03:04:05:06:02"
pkill -9 nas
ifconfig wl0 down
wl down
wl restart
wl up
wl ap 0
wl channel $CHANNEL
wl wet 1
ifconfig wl0 192.168.23.5 netmask 255.255.255.128
#ebtables -t broute -A BROUTING -p arp -j ACCEPT
#ebtables -t broute -A BROUTING -p ipv4 -j ACCEPT
#ebtables -t broute -A BROUTING -j DROP
# wl bssid "$BSSID"
# wl wds "$BSSID"
wl wepstatus 0
nas -i wl0 -S -m 4 -k "$WPA_PSK" -s "$SSID" -w 4 -g 3600 &

Die Werte für die Argumente -w und -m habe auch schon durchpermutiert.
Ebenso bringt das Setzen der bssid auf dem WRT54G keine Besserung.

Interessant ist das man mit tcpdump auf dem W500V sehen kann, da kurzzeitig auf dem
Twisted-Air-Kabel kommuniziert wird:

~# tcpdump -i br0 -nvv not port 22 and not port 80  
tcpdump: listening on br0, link-type EN10MB (Ethernet), capture size 96 bytes
13:16:45.856376 00:0f:66:xx:xx:xx > ff:ff:ff:ff:ff:ff Null Unnumbered, xid, Flags [Response], length 6: 01 00
13:16:45.858376 02:03:04:05:06:02 > 00:03:04:05:06:02, ethertype Unknown (0x886c), length 98: 
    0x0000:  8001 007e 0000 1018 0001 0001 0000 0000  ...~............
    0x0010:  0008 0000 0000 0000 0000 0000 0000 0000  ................
    0x0020:  001a 000f 66c7 8248 7764 7330 2e31 0011  ....f..Hwds0.1..
    0x0030:  006c a6db 0000 0100 dd18 0050 f201 0100  .l.........P....
    0x0040:  0050 f204 0100 0050 f204 0100 0050 f202  .P.....P.....P..
    0x0050:  0c00                                     ..

Ich kann nur leider erstmal nix damit anfangen. Eine Analyse der zwei Pakete mit Wireshark ist nich besonders informativ.

Wie kann ich weiter vorgehen um zu debuggen?
Hat jemand schonmal ähnliches probiert und ggf. Erfolg gehabt?

cya