quick command line wpa with wpa_supplicant. Some older devices (like my iBook) are not real supported using gui WPA connection methods. But I can usually get the command line going.
install wpa_supplicant based on the preferred method of your distribution. Note, below you will need to substitute eth1 with your interface device. It could be eth0 or wlan0 or whatever.
nano /bin/location1.sc
paste in the following
rm /var/run/wpa_supplicant/eth1
wpa_supplicant -ieth1 -Dwext -clocation1.conf &
sleep 5
dhclient eth1
back in terminal
chmod + x /bin/location1.sc
nano /bin/location1.conf
paste in the following
ap_scan=1
ctrl_interface=/var/run/wpa_supplicant
network={
ssid="MYESSID"
scan_ssid=0
proto=WPA
key_mgmt=WPA-PSK
psk="MYPASSKEY"
pairwise=TKIP
group=TKIP
}
Now when you want to connect to this location you open a terminal, and as root type ‘location1.sc’. You can create as many locations as you want. I have a location home.sc with its home.conf and a work.sc with its work.conf.
Advanced Fun
Create 2 locations by following the instructions above. You can make the computer find the location and automatically connect using the following little script.
As root
nano /bin/on.sc
Paste in the following
ifconfig eth1 down
ifconfig eth1 up
iwlist scanning | grep MyESSID1 && /bin/location1.sc
iwlist scanning | grep MyESSID2 && /bin/location2.sc
/bin/mnt.sc
Then back at a prompt, as root
on.sc
The script will scan for your network, locations and finding the ESSID it will go ahead and execute your other script and jump on it. If it doesn’t find location1, it will try location2 (and more if you add them). Notice that last line /bin/mnt.sc? Well that is the next fun part.
More fun
This script attempts to connect to a samba server, but only if that server is ping’able on the network.
nano /bin/mnt.sc
paste in the following
But substitute your samba server’s name (or IP) and share name as well as winpass and winname. You could connect to multiple servers by repeating this section multiple times, incrementing the Pinged1 (in both locations) to Pinged2 etc.You could include all of the servers on your network(s) so one script scans for available networks, connects to them, and then mounts your shares for you.
Pinged1()
{
Successfully Pinged1!!!
mkdir /mnt/share
mount -t cifs //{servername}/share /mnt/share -o user=winuser,pass=winpass
ls /mnt/share
}
ping -c 1 {servername} && Pinged1
I love automation

Tried location1.conf and location1.sc with my iBook G3. My machine recognizes my ESSID and pass. KWiFi shows green, connected ti my wireless network — up and running, but local IP is unavailable(?) I think the problem is that it won’t associate an DHCP address with my wireless. Any ideas? Thanks -CP
yeah, i see an error in my script. The following line…
wpa_supplicant -ieth1 -Dwext -clocation1.conf
Should have an & at the end like…
wpa_supplicant -ieth1 -Dwext -clocation1.conf &
Without the &, the script hangs at that line waiting for it to complete. Which it will only complete when wpa is disconnected. When it is disconnected, you can’t get an IP. the & puts that line into a background process. It then waits 5 seconds with the sleep command, and then gets an IP with the dhclient command.
I’ll correct the post now. Thanks for catching this. Make that change and try it again.
Hey cpv70: Not to discourage your slackintosh, but if you got the RAM, or can afford the $30.00 to upgrade the RAM, I’ve got to recommend debian on the iBook G3 as described in my other blog post. It is what i settled on. You may not choose to do the mint stuff, but debian on my 800mhz with 640Mb of RAM is snappy and very enjoyable. The slack does, just work. But it isn’t as easy to run.
I changed the code to reflect your change by adding the ‘&’ I finally got DHCPDISCOVER ON ETH1 but still no IP association.
New message says:
Invalid EAPOL-Key Mic -dropping packet
Invalid EAPOL-Key Mic when using TPTK – ignoring TPTK
Should the psk=”MYPASSKEY” be enetered in HEX?
Thanks,
C
No it should not be hex. I can think of a few things that may cause this issue. 1> the ibook only works on WPA1 Personal. Not WPA2 or Enterprise. Be sure your access point is configured for WPA1with TKIP. Did I not mention this anywhere? IDK if that is a hardware or driver limitation. It is just my experience with the iBook. 2> network-manager sometimes gets in the way of wpa_supplicant. Try killing the network-manager processes by typing “killall network-manager” as root, and then run the script. 3> for the iBook and suspend; you have to load and unload your airport module by “typing modprobe -r airport && modprobe -r orinoco” as root before suspend and “modprobe airport” as root after a suspend. I thought I covered this in my slack post, but apparently not. If you check out the ubuntu or debian on the ibook posts it is covered. And I do detail some automation of this process. Sorry for the confusion.