Rather than using rc.wireless.conf, you could do what I'm doing... I have a script that sets the values for me. I find that with rc.wireless.conf, it doesn't really help. With my laptop, I connect to several different wireless nets, and I can't set the options in rc.wireless.conf, because I would need to boot up, change the values accordingly, and then run rc.inet1.
Instead, I wrote a script and called it from rc.local. This script asks which wireless net I want to use, and then sets the card accordingly.
Here's the script, edited for content.
Code:
#!/bin/bash
# New wlan-up script, prompt for which wireless LAN AP we want to use.
# I am deliberately not putting in a WHILE loop. I want it to skip the setup of the WLAN if I
# don't tell it to specifically use one of the lans.
# Global variables:
INTERFACE="ath0"
ESSID="no-essid"
KEY="none"
TIMELIMIT=5
# Show the menu:
echo ""
echo "-=-=-=- Choose a Wireless AP for connection -=-=-=-"
echo "a. Home 54mbit - Bedroom end of house"
echo "b. Home 11mbit - Dining room and Sun Room"
echo "c. University Library"
echo ""
echo "-=-=- Type anything else to cancel connection -=-=-"
read -t ${TIMELIMIT} choice
case $choice in a)
ESSID="essid1"
KEY="key1"
esac
case $choice in b)
ESSID="essid2"
KEY="key2"
esac
case $choice in c)
ESSID="essid3"
esac
if echo "${ESSID}" | grep -q "no-essid"
then
echo "*** Exiting without configuring LAN. You can reinvoke it with /sbin/wlan ***"
else
echo ""
echo "Enabling ${INTERFACE}"
ifconfig ${INTERFACE} up
echo " Setting ESSID"
iwconfig ${INTERFACE} essid ${ESSID}
sleep 2
if echo "${KEY}" | grep -q "none"
then
echo " Configuring for access without encryption"
else
echo " Setting Network Key"
iwconfig ${INTERFACE} key ${KEY}
sleep 2
fi
echo " Obtaining DHCP"
killall dhcpcd
sleep 1
dhcpcd ${INTERFACE}
fi
As you can see, it's very easy to add extra wireless nets to the configuration file. Just update the menu, and add a new case declaration following the same format as above. I've set it to timeout without setting up the wlan if I don't make my choice in 5 seconds, or if I don't make a valid choice.
I find this script allows me more leeway, in that it gives me a chance to choose which wireless net I'm going to use, and it also lets me choose whether or not to have encryption enabled just by whether or not I set a variable.
HTH.