Mailinglist Archive: opensuse (4020 mails)

< Previous Next >
Re: [SLE] unconfigurable iwconfig
  • From: "Jake Sallee" <spark@xxxxxxxxxxxxxxxxx>
  • Date: Mon, 11 Oct 2004 14:14:19 -0500 (CDT)
  • Message-id: <34161.165.124.17.52.1097522059.squirrel@xxxxxxxxxxxxxxxxx>
>>I've noticed that sometimes the essid _has_ to be the first thing set,
>>otherwise iwconfig wouldn't accept the change there.
>>
>>
> No difference

when you use ifup, if it can't find ifcfg-wlan0 then it's going to use its
generic script to bring up the interface. I've located this in
/etc/sysconfig/network/scrips/ifup-wireless


Reading through the script, I found this, which I rememeber skimming
through back when I created my ifcfg-wlan0:

setup_iwdev()
{
# Mode need to be first : some settings apply only in a specific
mode !
run_iw_tool config mode $WIRELESS_MODE
# This is a bit hackish, but should do the job right...
if [ -n "$WIRELESS_ESSID" -o -n "$WIRELESS_MODE" ] ; then
test -z "$WIRELESS_NICK" && WIRELESS_NICK=`/bin/hostname`
fi
# Regular stuff...
while read OPT ARG; do
run_iw_tool config $OPT "$ARG"
done <<-EOL
nick $WIRELESS_NICK
nwid $WIRELESS_NWID
freq $WIRELESS_FREQ
channel $WIRELESS_CHANNEL
sens $WIRELESS_SENS
rate $WIRELESS_RATE
rts $WIRELESS_RTS
frag $WIRELESS_FRAG
$WIRELESS_IWCONFIG_OPTIONS
EOL
# set encryption key(s)
run_iw_tool config key off
if [ -z "$WIRELESS_SEC_MODE" ]; then
case "$WIRELESS_AUTH_MODE" in
shared|sharedkey|restricted) WIRELESS_SEC_MODE="restricted";;
esac
fi
if [ -n "$WIRELESS_KEY_0" -a \
-z "$WIRELESS_KEY_1" -a \
-z "$WIRELESS_KEY_2" -a \
-z "$WIRELESS_KEY_3" ]; then
# some drivers (at least madwifi) do not like multiple keys
# so we do not use that setting method when we have only one
run_iw_tool config key $WIRELESS_SEC_MODE $WIRELESS_KEY_0
elif [ -n "$WIRELESS_KEY_0" ]; then
ARG="key $WIRELESS_SEC_MODE $WIRELESS_KEY_0 [1]"
for i in 1 2 3 ; do
eval K=\$WIRELESS_KEY_$i
test -n "$K" && ARG="$ARG key $K [$((i+1))]"
done
run_iw_tool config $ARG
if [ $RETVAL -ne 0 ]; then
logerror "setting encryption key FAILED, aborting
interface setup"
exit $R_ERROR
fi
test -z "$WIRELESS_DEFAULT_KEY" && WIRELESS_DEFAULT_KEY=0
run_iw_tool config key [$((WIRELESS_DEFAULT_KEY+1))]


< Previous Next >
This Thread
Follow Ups