General Question: What is the best way to do wifi in linux? Opinions wanted!
Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
Notices
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
General Question: What is the best way to do wifi in linux? Opinions wanted!
Recently I installed SuSE 10.0 w/ KDE (first time using Linux) and thanks to the help of rshaw & others I managed to get it to connect at home after about 8-10 hours of messing around. Not too bad for a complete novice. Using kwifimanager, I quickly realized that it would be a real chore every time I tried to add a new AP with different settings & apparently if the settings were different enough I would have to make changes that meant I would have to change them back to again use my original AP.
In Windows XP, when I detect a hotspot, I simply double-click it & enter the key if necessary to connect. Is there a comperable way to do this in Linux? I would like to use Linux on my laptop & may even be able to live without Photoshop, but I refuse to spend more than 30-60 seconds to connect to a new network & I want it to Just Work (tm) when I use my home/work/friend's network (second and subsequent times).
So, what software/distro have you used? I'm definately not married to SuSE; it was handy. I'm pretty new but I want to learn & I want to end my Microsoft dependency.
Yeah, wifi on Linux needs work. But the real issue is that most cards use proprietary chipsets for which the Linux drivers are incomplete or non existant.
Anyhow, I use Madwifi. Works well for me. I get pretty good speeds and I've never had a dropout. The only problem I have is that our cordless phone also operates within the 2.4GHz range and occasionally interferes with the signal, but that is no fault of the software.
Yeah, wifi on Linux needs work. But the real issue is that most cards use proprietary chipsets for which the Linux drivers are incomplete or non existant.
Anyhow, I use Madwifi. Works well for me. I get pretty good speeds and I've never had a dropout. The only problem I have is that our cordless phone also operates within the 2.4GHz range and occasionally interferes with the signal, but that is no fault of the software.
I'm less concerned with drivers than I am user-friendliness once installed. It wasn't easy (for a noob ) to set it up, but once I did the frustrating part was that unlike my Windows experience I had to make a buncha changes per network (and then I never did get it to work at work, not sure what security settings they use (just know the key).
not sure what security settings they use (just know the key)
It has to be either WPA or WEP. I don't know about WEP, but WPA is supported under Linux by a package called wpa_supplicant. It supports most of the Linux wifi drivers that I'm aware of.
I see that you're using Suse 10.0. It's surprising that you had so much difficulty. I tried Suse 10.0 when it came out and it autoprobed my wifi card, installed the driver and found my access point. All I had to do was enter the WPA passphrase. My wifi NIC is a Netgear with Atheros chipset.
I use madwifi, and coming from previously using ndiswrapper, madwifi is a god-send. It's simple to use and setup, and works like a charm. Much better than Windows IMHO. This is on two D-Link DWL-G520 cards with the Atheros chipset.
Distribution: K/Ubuntu 18.04-14.04, Scientific Linux 6.3-6.4, Android-x86, Pretty much all distros at one point...
Posts: 1,802
Rep:
Quote:
Originally Posted by rkelsen
It has to be either WPA or WEP. I don't know about WEP, but WPA is supported under Linux by a package called wpa_supplicant. It supports most of the Linux wifi drivers that I'm aware of.
I see that you're using Suse 10.0. It's surprising that you had so much difficulty. I tried Suse 10.0 when it came out and it autoprobed my wifi card, installed the driver and found my access point. All I had to do was enter the WPA passphrase. My wifi NIC is a Netgear with Atheros chipset.
I had nowhere near this level of ease of use with SuSE 10.0 (Community, not commercial). Even with Mandrake (sorry,... Mandriva [rolls eyes]), I have trouble setting up newtwork compatibility wuth WPA and WEP encryption. WPA_Supplicant does not auto-install (I installed it manually), and although my PCMCIA wifi card is supported by madwifi drivers, I still cannot (easily or at all right now) set up my laptop to talk to my wifi router.
I have no trouble accessing un-encrypted networks though... and my Palm LifeDrive connects easily, as do friends computers using WPA encryption...
WPA_Supplicant does not auto-install (I installed it manually), and although my PCMCIA wifi card is supported by madwifi drivers, I still cannot (easily or at all right now) set up my laptop to talk to my wifi router.
I'm not 100% sure which version of Suse 10.0 I got, but it was in the form of 5 iso files that I downloaded for free from an official mirror. I think it may have been the commercial version.
Anyhow, it automatically installed wpa_supplicant and madwifi for me. As I said, all I had to do was enter my router's passphrase for access. It was all downhill from there. I never thought I'd see anything like it.
I'm not 100% sure which version of Suse 10.0 I got, but it was in the form of 5 iso files that I downloaded for free from an official mirror. I think it may have been the commercial version.
Anyhow, it automatically installed wpa_supplicant and madwifi for me. As I said, all I had to do was enter my router's passphrase for access. It was all downhill from there. I never thought I'd see anything like it.
Unfortunately I have a crappy broadcomm card that came (built in) with my laptop. I am currently researching alternative cards, Atheros chipset is mentioned a lot by happy people . . . it may be time to watch the sales
The broadcom card really shouldn't be an obstacle since ndiswrapper and wpa_supplicant work together. If I remember correctly, if you know the config and keys for your various networks, you can enter them into your wpa_supplicant configuration file and it will automatically scan for those and use the strongest signal. As you move between those known networks, wpa_supplicant is capable of switching between them. I don't know how/if it can pick up unkown networks though.
Personally, I just wrote a perl script that scans for any available network and then presents me with a list to choose from. I hard coded in the three secured networks I routinely use and can just pick them from the list. I've posted the script a few times here, but if you want, I can post it again.
The broadcom card really shouldn't be an obstacle since ndiswrapper and wpa_supplicant work together...
Quote:
Originally Posted by Hangdog42
...Personally, I just wrote a perl script that scans for any available network and then presents me with a list to choose from. I hard coded in the three secured networks I routinely use and can just pick them from the list. I've posted the script a few times here, but if you want, I can post it again.
I've never used wpa_supplicant, I will have to look into it. I actually don't know that I even have ndiswrapper installed ATM, as I am using a different installation than I was when I got it working before . . .
. . . I'm afraid I would also need instruction as to what to do with the perl script. Though the forum won't give away my secret after 1 more post, I am still a
#!/usr/bin/perl
$Interface = "wlan0";
$HomeESSID = "HomeSSID";
$WEP = "HexWEPKey";
$Mode = "Managed";
$IWCONFIG = "/sbin/iwconfig";
$DHCP = "/sbin/dhcpcd -t 10 -d -N";
@APList = ();
#First load the ndiswrapper module
print("Loading ndiswrapper\n");
system("/sbin/modprobe ndiswrapper");
print("Scanning for wireless access points\n");
@ScanList = qx/iwlist wlan0 scan/;
push(@APList, 'Exit');
push(@APList, 'Home');
push(@APList, 'Work');
foreach $a (@ScanList){
if($a =~m/No scan results/){
print("No networks detected, enabling home network\n");
&homeNet;
}
if($a =~ m/$HomeESSID/){
print("Home network detected\n");
&homeNet;
}
if ($a =~m/ESSID/){
@Temp = split(/"/,$a);
push(@APList,$Temp[1]);
}
}
&selectFrom;
sub homeNet{
print("Setting up wlan0\n");
system("$IWCONFIG $Interface essid $HomeESSID");
system("$IWCONFIG $Interface mode $Mode");
system ("/sbin/iwconfig wlan0 key $WEP");
print("Requesting IP from $HomeESSID\n");
system("$DHCP $Interface");
system ("ifconfig $Interface up");
print("Configuration done\n");
exit;
}
sub selectFrom{
print("Select one of the following AP points\n");
for($x=0;$x<=$#APList;$x++){
print("$x - $APList[$x]\n");
}
print("Select by number: ");
$SelectAP = <STDIN>;
if((0 <= $SelectAP) and ($SelectAP<=$#APList)){
if($SelectAP ==0){
print("No AP Selected, exiting program\n");
exit;
}
if($SelectAP==1){
print("Configuring Home Network\n");
&homeNet;
exit;
}
if($SelectAP==2){
print("Configuring work Network\n");
system("/etc/rc.d/rc.work");
exit;
else{
print("Using $APList[$SelectAP]\n");
system("$IWCONFIG $Interface essid $APList[$SelectAP]");
print("Requesting IP from $APList[$SelectAP]\n");
system("$DHCP $Interface");
system("ifconfig $Interface up");
exit;
}
}
else{
print("Please select an acceptable number\n");
&selectFrom;
}
exit;
}
It is a console program and basically you need to edit the top portion to contain the relevant info for your "home" network. You also may need to change teh dhcpcd call to get an IP address. Slackware uses dhcpcd, but I'm not sure that ubuntu does. Also notice the work section calls to an outside script. I've found that having a separate bash script containing the appropriate iwconfig commands for each network I usually use works well, so I just call those from this program.
SUSE 10.0 has a relatively painless way of setting up or editing WiFi settings. I am not sure regarding managing multiple access points, though. Anyway, here is a link that goes through the process step-by-step. You have to scroll down to the sections entitled "Setting up a wireless card" and "Adding encryption to a wireless network connection."
Linux is not quite the double click that windows is to connect to an access point. I have not had much success with any GUI apps in linux (although im sure they probably exist)... You will find that you can connect to any access point that you have the key for using the 'wireless tools'.. at a glance it looks a little horrible as it is from the console - however it really is quite easy.
for example: if i want to connect to my home network i type--
#ifconfig eth1 up
#iwconfig eth1 essid MyHomeNetwork
#iwconfig eth1 key s: MySecretKey
#dhcpcd eth1 (to ask router for IP address)
I know it looks a bit much but it does wok very well.
( you can type #iwconfig or #ifconfig to see the name of your adaptor)
you can setup scripts to connect to your preferred network as well - unsure what they are in your distro but im sure they exist and you should be able to enter the name/key etc in here and it should work whenever you are in range.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.