Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Apr 2003 23:06:13 -0700 (PDT)
From:      Doug Barton <DougB@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Mike Makonnen <mtm@identd.net>
Subject:   Script to automatically configure a wireless card based on ssid
Message-ID:  <20030423223710.P7551@znfgre.qbhto.arg>
In-Reply-To: <XFMail.20030421132150.jhb@FreeBSD.org>
References:  <XFMail.20030421132150.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
John,

I took a look at your script, and it has some really good stuff. I ran
into a problem though. The premise of your script is that once you get an
ssid, you'll know how to configure that interface. I'm curious about what
kind of card you have. I have a netgear ma 401, and it's coming up with an
ssid as soon as I bring the card up. Here is an example:

ifconfig wi0 powersave:

wi0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether 00:09:5b:31:2d:2f
        media: IEEE 802.11 Wireless Ethernet autoselect (none)
        ssid ""
        stationname "FreeBSD WaveLAN/IEEE node"
        channel -1 authmode OPEN powersavemode CAM powersavesleep 100
        wepmode OFF weptxkey 1

ifconfig wi0 up:

wi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether 00:09:5b:31:2d:2f
        media: IEEE 802.11 Wireless Ethernet autoselect (DS/2Mbps)
        status: associated
        ssid WLAN 1:WLAN
        stationname "FreeBSD WaveLAN/IEEE node"
        channel 11 authmode OPEN powersavemode CAM powersavesleep 100
        wepmode OFF weptxkey 1

The problem is, WLAN is not the ssid of my (freebsd) AP, and there are no
other AP's in my area. As soon as I do 'ifconfig wi0 wepmode mixed' it
finds my AP, and then I can configure the interface using the rest of your
script. I'm not really surprised by the fact that it works when I turn on
wepmode, I'm annoyed that it comes up with an ssid that doesn't exist. :)

The interim solution I have is to loop through the "find an ssid I know
about" part of your script with the various combinations of wepmode. My
plan is to do something like this:

interface up
	find an ssid I know and configure successfully, or
wepmode mixed
	find an ssid I know and configure successfully, or
wepmode on
	find an ssid I know and configure successfully, or
wepmode off
	If I still have an ssid and status: associated, exit 0, or
exit 1

The purpose of the last step is for situations where you're a guest in a
place that has non-wep service enabled. I run into this at conferences all
the time, so I think it's a reasonable fallthrough case.

The other thing I'm interested in at this point is a good definition of
"configured successfully." When I find the right ssid and set the right
wep keys, I know that I'm successful if I can dhclient the interface.
However, I'd really like to find a metric I can test before I take that
step. So far I haven't been successful, but I'm hoping it's just due to my
ignorance.

I'm interested in your opinion of this plan for more general use, and also
the opinion of folks on the list. For those that aren't aware of the goal
here, the rc team is working on improvements to our scripts to
auto-configure a system on boot, including wired/wireless, etc.

Doug

-- 

    This .signature sanitized for your protection



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030423223710.P7551>