Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have managed to successfully get wireless working on my laptop using ndiswrapper on a Linksys WPC54G card. However, I am tired of typing in
and all the other commands needed to get my wireless up and running each time I log in. I am hesitant to make anything final because I access two wireless networks, one at home and one at school. I have been successful in connecting to both, but is it possible to simply select my desired network and connect, say, during startup?
I put all of my WiFi commands into a script that takes the parameter of where I currently am.
So for instance, I would do:
And it would load my settings for my home network. But that isn't really what you are looking for.
You might want to look into Wifi-radar, which will scan for APs and let you setup profiles for them. It will also automatically connect you up to the AP with the best signal at boot time, if you set it up to do so.
But, as far as I know though it doesn't give you the ability to chose the AP at boot.
I have thought about writing some shell scripts such as those you have suggested, but I have a couple other questions (wich may be the questions I should have asked all along):
First of all, I am tired of loading ndiswrapper each time I log in. I know that I can use the
command and it will create the module, which I can then specify to be loaded during bootup. But does doing this include a default access point, or does it just load the drivers for my wireless card?
Secondly, to run any ndiswrapper or iwconfig commands, I need to be logged in as root. My understanding is then that to run these shell scripts (which would include some iwconfig commands) I would have to be root, which I would prefer not to do. I have heard of the sudo command, but get an error each time I try using it. How do you have yours running?
Adding the ndiswrapper only loads the drivers, it doesn't setup the card.
I'm not using ndiswrapper currently, but I did use it with these same scripts before, so I did have to handle the problem of loading the module.
You could do a number of things.
1. Add the "modprobe ndiswrapper" line to your startup scripts, this works fine, but you would get errors when booting without the card, and won't help if you want to load the drivers after boot.
2. Add the modprobe line to the scripts you are going to create to setup the WiFi card. Simply put the modprobe line as the first part of the script, maybe have it wait a second or two, and setup the card. This works fine, and is (if I recall correctly) how I did it when I was still using ndiswrapper.
3. Setup an alias for the module. This may or may not work with ndiswrapper, I don't know for sure, but I use it now with my WLAN card (though it has proper drivers). Essentially, you set it up so when you call the wlan0 device, it loads the modules for the card. This is probably the best way, if you can get it to work.
As for running the script, yes, you must do it as root, I don't think there is any way around that. I used to log in as root, run the script, then log out. This obviously is not ideal, so now I just use sudo.
If I had to guess, I would say sudo is giving you errors because you didn't setup allowed users/groups in the sudoers file. I don't know what the defaults are in Debian, but in Slackware it defaults to not letting anyone use sudo, so that would cause a problem.
Just add the user or group you want to be able to use sudo, and you should be fine. The file should contain examples, so it will be a pretty easy change to make.
Okay, I like that idea. Thanks for the help on ndiswrapper.
Regarding sudo, I have looked and I am not in the sudoers group. For that matter, the group didn't exist, so I created one by that name (I hope that's the way to go) and added myself to it. When I run the groups command, I sudoers is listed as one of my groups, but when I try to run anything using sudo I am told that I am not in the sudoers file (and the incident will be reported). How do I add myself to the sudoers file?