Script to automatically configure a wireless card based on ssid
John Baldwin
jhb at FreeBSD.org
Thu Apr 24 08:05:40 PDT 2003
On 24-Apr-2003 Doug Barton wrote:
> 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:
I have a lucent card:
wi0: <Lucent Technologies WaveLAN/IEEE> at port 0x100-0x13f irq 11 function 0 config 1 on pccard0
> 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
Well, it claims to be associated, which is odd. I don't actually check
the ssid except for matching up wepkeys. Instead, I check the status
which is 'associated' in this case. If there really isn't an AP, then that's
a bug that should be addressed.
> 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.
dhclient is the only such metric I really know of.
> 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.
I think your plan sounds ok. My script is specific to my needs and I
posted it primarily as an example of how you can solve the wireless
problem. I think personally my direction is to not depend on rc to be
smart, but to write a kde applet similar to the airport applet in OS X
that lets you see signal strength as well as choose which AP you are
associated with.
--
John Baldwin <jhb at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
More information about the freebsd-mobile
mailing list