Ok, since I'm still a novice with Linux (is it ever possible to get pass this stage? ><) and I wanted to use the HostAP drivers for the benefit of iwlist <> scan and the other features it offers over the orinoco drivers that come with Slack. So after doing a fresh install of Slackware Current after a botched attempt to install HostAP with kernel 2.4.28, I figured it would be easier to start from a clean install. This is what I came up with:
1.) Full install of Slackware Current, minus KDE/Gnome like always.
2.) Upgraded to kernel 2.6.9 (seem to have issues with 2.6.10 giving me a blank screen between bootup and starting X)
3.) Removed from the kernel configuration all the drivers for pcmcia cards, basically leaving it only to see the cardbus so I could use my NetGear MA401RA card.
4.) Installed the latest stable version of HostAP driver 0.2.6 and rebooted to make sure my laptop was loading the modules
hostap,
hostap_cs,
hostap_crypt_wep, and
ds (I assume this is also a hostap module but I am not completely sure).
Everything before this point was simply installing these are my configuration scripts to get my card working.
Firstly, thanks to
eric.r.turner's
guide to make a Slackware AP, I used his script to bring up wlan0 and suited it to my needs. This file I named
rc.wlan0 and placed in /etc/rc.d/ directory with an exec property.
Code:
#!/bin/sh
#
# rc.wlan0
#
CHANNEL=6
ESSID="mynetwork"
INTERFACE="wlan0"
IPADDR="192.168.1.3"
KEY="01AB-23CD-45" # My 64 bit WEP key
MODE="Managed"
NETMASK="255.255.255.0"
# Determine broadcast and network addresses from the IP address and netmask:
BROADCAST=`/bin/ipmask $NETMASK $IPADDR | cut -f 1 -d ' '`
NETWORK=`/bin/ipmask $NETMASK $IPADDR | cut -f 2 -d ' '`
# Set up the WiFi card
echo "Configuring ${INTERFACE} for home network:"
/sbin/ifconfig ${INTERFACE} ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
/sbin/route add default gw 192.168.1.1
# I know this is probably a crude method and should be probably
# done in rc.inet1, but I figured I'd keep everything togethor.
# However, without defining the gateway, this doesn't work.
/sbin/iwconfig ${INTERFACE} essid ${ESSID}
/sbin/iwconfig ${INTERFACE} channel ${CHANNEL}
/sbin/iwconfig ${INTERFACE} mode ${MODE}
sleep 1 # seems like I need a pause also, just not a long one.
/sbin/iwconfig ${INTERFACE} key ${KEY}
Now that I have my script to configure wlan0 to work with my AP, I made a small change to
rc.inet1 to exec. my script upon the initial startup and
rc.inet1 start.
This checks to see if rc.wlan0 has permission to be executed, it is placed directly before the MAIN area of the script:
Code:
############
# wlan0 up #
############
# Function to bring up wlan0:
wlan0_up () {
if [ -x /etc/rc.d/rc.wlan0 ]; then
/etc/rc.d/rc.wlan0
fi
}
Yes, I know I should call the gateway there, but it seems easier to leave it in rc.wlan0.
Now to make sure that wlan0 is called upon during the boot cycle and whenever /etc/rc.d/rc.inet1 start is called, I added a few lines into these spots:
Code:
############
### MAIN ###
############
case "$1" in
'start') # "start" brings up all available interfaces:
lo_up
eth_up 0
eth_up 1
eth_up 2
eth_up 3
gateway_up
wlan0_up # Calls for my configuration
;;
{SKIPPING THE OTHER CALLS}
*) # The default is to bring up all interfaces:
lo_up
eth_up 0
eth_up 1
eth_up 2
eth_up 3
gateway_up
wlan0_up # Calls for my configuration
esac
# End of /etc/rc.d/rc.inet1
Now for the question though. While that works now for what I want done, is there a easier way to really configure wlan0? I don't believe I can just edit
rc.wireless or any other scripts since I do need to set wlan0's address and gateway or else I have no connection to my router.
Thanks for the help.