[wplug] wireless card config

Brandon Kuczenski brandon at 301south.net
Mon Mar 22 16:03:23 EST 2004


On Mon, 22 Mar 2004, Clark Slater wrote:
> Hi-
> 
> I tried `ifdown eth1 ; ifup eth1` and it [failed].
> 

Two things.  One, I have a much more verbose ifcfg file than you -- but
the only substantial difference, I think, is the TYPE=Wireless entry and
the presence of encryption keys.  You might be able to solve the problem 
just by adding the appropriate key entry into your ifcfg file.

Which brings me to two, and this is of general interest to the list - I
had a hard time getting my wireless encryption to work.  I had to modify
the script ifup-wireless to accomodate what seemed to be peculiar behavior
of the router.

The situation was this: I have four different keys displayed for
wireless keys on both my router and my pcmcia card.  The selection of 
which key is active is controlled with iwconfig:
iwconfig eth1 key [2] <keycode>

The peculiar behavior was that it wasn't sufficient just to have the RIGHT
KEY -- I needed the key to also be in the SAME key index on the card as
the router was set to.

This necessitated the modification of the ifup-wireless script to pre-load 
all the different keys and then simply set the right index.  I added this 
to /etc/sysconfig/network-scripts/ifup-wireless and /etc/pcmcia/wireless:

# ======== begin added code ========
# this batch changed by me to accomodate multiple key indices
# Note: config file MUST include KEY[1], KEY[2], KEY[3], KEY[4], and 
# KEY_INDEX values if KEY ( or KEY[0]) is present and not set to off
#
# NOTE: This code is nearly duplicated in /etc/pcmcia/wireless
if [ -n "$KEY" -a  "$KEY" != "off" ] ; then
    for i in 1 2 3 4; do
        [ -z ${KEY[$i]} ] || {
            iwconfig $DEVICE key "[$i]" "${KEY[$i]}"
        }
    done
    iwconfig $DEVICE key "[$KEY_INDEX]"
else
    iwconfig $DEVICE key off
fi
# ======== end added code ========

and added these to the ifcfg-eth1 file:

# ======== begin added entries ========
KEY[0]=on
KEY[1]=<hex code for key 1>
KEY[2]=<hex code for key 2>
KEY[3]=s:<ascii code for key 3>
KEY[4]=
KEY_INDEX=1
# ======== end added entries ========

So - um - beware.

does that help at all?

> This is all I have in ifcfg-eth1:
> DEVICE=eth1
> BOOTPROTO=dhcp
> ONBOOT=no
> 

Attached is my ifcfg-eth1 file.

-Brandon

-------------- next part --------------
# Please read /usr/share/doc/initscripts-*/sysconfig.txt
# for the documentation of these parameters.
# this file is located in /etc/sysconfig/networking/profiles/default
GATEWAY=192.168.0.2
TYPE=Wireless
DEVICE=eth1
HWADDR=00:02:2d:b5:80:33
BOOTPROTO=dhcp
NETMASK=255.255.255.0
ONBOOT=no
DHCP_HOSTNAME=deepblue
NAME=
DOMAIN=
USERCTL=yes
PEERDNS=no
ESSID=301south
CHANNEL=7
MODE=Managed
KEY[0]=on
KEY[1]=<key here>
KEY[2]=<key here>
KEY[3]=s:<ascii key here>
KEY[4]=
KEY_INDEX=1
RATE=11Mb/s



More information about the wplug mailing list