source: freewrt/package/broadcom-wl-util/files/wireless-broadcom.up@ 59eb2f4

freewrt_1_0 freewrt_2_0
Last change on this file since 59eb2f4 was 59eb2f4, checked in by Thorsten Glaser <tg@…>, 17 years ago

fix WDS:

  • wireless-mode must be “wds” not “ap”
  • it was impossible to use WDS in bridging mode due to abuse of the 「bridge-ifaces」 variable in the script, which did not allow for more than one value: introduce a new custom variable 「wireless-wds-interface」 to contain “eth2” or similar ONLY, thus allowing 「bridge-ifaces」 to contain “eth0.X eth2”

This does not break existing configurations:

  • when 「wireless-wds-interface」 is not set, let it default to the value of 「bridge-ifaces」

This commit sponsored by tarent GmbH

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@3836 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#!/bin/sh
2#
3# WDS configuration script, WDS needs to be activated after bridge
4#
5[ "$IF_WIRELESS_TYPE" != "broadcom" ] && exit 0
6[ "$IF_WIRELESS_MODE" != "wds" ] && exit 0
7logger -t wireless "setting lazywds to $IF_WIRELESS_LAZYWDS"
8[ "$IF_WIRELESS_LAZYWDS" ] && wl lazywds $IF_WIRELESS_LAZYWDS
9logger -t wireless "adding wds nodes $IF_WIRELESS_WDS"
10wl wds $IF_WIRELESS_WDS
11[ "$IF_WIRELESS_SECURITY" = "wpa-psk" ] && {
12 # wpa rekeying
13 gtk_rekey=$IF_WIRELESS_WPA_GTK_REKEY
14 gtk_rekey=${gtk_rekey#0}
15 gtk_rekey=${gtk_rekey:-3600}
16 case "$IF_WIRELESS_ENCRYPTION" in
17 wep)
18 crypto_num=1
19 ;;
20 tkip)
21 crypto_num=2
22 ;;
23 aes)
24 crypto_num=4
25 ;;
26 aes+tkip)
27 crypto_num=6
28 ;;
29 esac
30 case "$IF_WIRELESS_AUTHORIZATION" in
31 psk)
32 auth=4
33 ;;
34 psk2)
35 auth=128
36 ;;
37 "psk psk2")
38 auth=132
39 ;;
40 esac
41 wl ssid $IF_WIRELESS_SSID
42
43 # backwards compatibility hack for 1.0-stabke
44 [ -z "$IF_WIRELESS_WDS_INTERFACE" ] && IF_WIRELESS_WDS_INTERFACE=$IF_BRIDGE_IFACES
45
46 /usr/sbin/nas -P /var/run/nas.lan.pid -l $IF_WIRELESS_WDS_BRIDGE -H 34954 -i $IF_WIRELESS_WDS_INTERFACE -A -m $auth -k "$IF_WIRELESS_WPA_KEY" -s $IF_WIRELESS_SSID -w $crypto_num -g $gtk_rekey &
47 [ "$IF_WIRELESS_WDS_SECURITY" = "wpa-psk" ] && {
48 sleep 10 &&
49 for i in $(ip link show|awk -F : '/wds/ {print $2}'); do /usr/sbin/nas4not lan $i up auto $IF_WIRELESS_WDS_ENCRYPTION psk "$IF_WIRELESS_WDS_WPA_KEY" $IF_WIRELESS_SSID;done &
50 }
51}
52exit 0
Note: See TracBrowser for help on using the repository browser.