Wireless profiles for different locations?Forum: Networking Topic: Wireless profiles for different locations? started by: yangmusa Posted by yangmusa on Aug. 22 2007,21:38
I got wifi configured without too much trouble, thanks to this group.However, I move my laptop between home and my office. And so far, I can't work out any other way than running wlcardconfig each time I move, which takes time and really shouldn't be necessary. My mac stores all my locations, so I can just choose from a drop down menu, and I'm sure even Windoze can do this. Is there some way to pass options to wlcardconfig from the command line? That way, I guess I could set up a script to do this.. That is, unless you know of a better way? thanks, Magnus Posted by roberts on Aug. 22 2007,21:45
If you use one of the stock configuration tools, iwconfig, prism2, ndiswrapper, it creates a script for you. Renaming such and you have it. In v4.0 I just double click the appropriate icon depending on location.
Posted by yangmusa on Aug. 22 2007,22:09
Could you go into a little more detail? I'm afraid I'm still wet behind the ears, and everything I know about linux and wifi comes from this forum. Specifically what I do is (as root): ifconfig ath0 up # activate the card iwlist ath0 scan # scan for active networks (unless I'm in a known location) wlcardconfig # if changing locations pump -i ath0 # acquire ip address through DHCP. DSL recognizes my Netgear card as ath0 out of the box, so I don't need ndiswrapper or prism2, right? Before I found instructions to the above, I tried running iwconfig, but I don't really know what it does and it never seems to save any of the settings I put in. thanks, Magnus Posted by roberts on Aug. 22 2007,22:24
I use iwconfig with my ath0 device, enter ath0 instead of the default eth0.Your lucky your card can scan, many of the older ones (ones I have) cannot. Enter your network name in the sid field and enter your wep, if any, as colon separated pairs, e.g., 11:22:33:44. Using "" in the sid field usually connects to the strongest (local unencrypted) signal. Upon a sucessful connection you get a myiwconfig script created, in v3.x it is in /opt, with v4.0 it is in home with a nice icon. Since you are using manual commands it would probably be just as easy to enter them into your own script. Posted by yangmusa on Aug. 22 2007,22:50
ok, so I ran sudo ifconfig ath0 up Then I ran iwconfig instead of wlcardconfig (I assume it _IS_ instead of, since they seem to do the same thing?). This seemed to work the first time - the lights on the card starting blinking together as if it was connected. Then it dropped back to them blinking out of sync. I tried running "sudo pump -i ath0" but that failed, and attempts to browse the web failed. Even though I didn't get connected, iwconfig did generate a script in /opt - it looked fairly sensible to me, so I've saved it to include in my script. At least I will once I get it working properly.. I don't know if this is due to the SID and WEP key for my office network, which contains several words with spaces in between? I'll try again at home, which has an easier name/wep. BTW - I enter the password using 's:' followed by the password in ascii. If that is likely to be the problem, how would I change the password to HEX? thanks, Magnus Posted by curaga on Aug. 23 2007,09:53
You could just check what wlcardconfig does in each location, and then make a script of those..
Posted by yangmusa on Aug. 23 2007,15:58
I never managed to get connected at the office, using wlcardconfig or iwconfig.. So I "cheat" and plug into the nearest cable I can find. I talked to the admin, and he's always thought it was odd that the name and key consist of multiple words - but isn't sure he wants to deal with a week of people complaining that the network is down because they didn't read the email about changed key
Posted by roberts on Aug. 24 2007,14:45
Sounds like it might be using WPA.
Posted by yangmusa on Aug. 24 2007,15:37
No, it's definitely WEP, I've asked the admin and it works fine on my mac. A unix-literate friend of mine suggested I should try escaping the spaces in between the words in the ESSID and pass-phrase. I'll give that a try today. PS - I added the script from iwconfig to my other script, and now have a nice script that seems to work every time to get my home connection up. Thanks Posted by roberts on Aug. 24 2007,16:44
The above is from < http://linux-net.osdl.org/index.php/802.11 > |