Configure wireless support in Mandriva Linux with ndiswrapper

If there is one area in Linux that still persists in falling under the category of "black magic," it's wireless networking. Due to the differences in wireless network cards, rebranding, slightly changed specs, security differences between WEP, WPA, WPA2, and so forth, it can be very difficult to get wireless networking set up quickly and can often be an exercise in frustration. Are there available Linux drivers? Windows drivers wrapped in a Linux driver? 32-bit or 64-bit drivers? The combinations in configuration can be daunting.

Set up wireless via the Mandriva Control Center

Many distributions provide their own tools to configure wireless networking, and all work with varying degrees of success. The tool provided in Mandriva Linux 2007.1 Spring is the same as previous versions but with added support for more devices. The tool, drakconnect, works very well and supports the configuration of most wireless network cards thrown at it.

If you have installed Mandriva Linux 2007.1 and did not set up wireless during the install, it can easily be done by taking a trip to the Mandriva Control Center (MCC).

To get to the MCC, go to the Applications menu (or Start menu) and navigate to System | Configuration | Configure Your Computer. You will need to provide the root user's password to start the program. Once inside the MCC, select the Network & Internet tab and then select the Set Up A New Network Interface option. Choose the Wireless Connection option, then MCC will prompt you for what to configure. This is where things can become interesting.

If there are Linux drivers for your wireless interface, they will be listed here, and you would configure them as usual. With some network interfaces, notably the Broadcom chipsets, you may need to provide the firmware for the card in order to use the native bcm43xx driver.

Using ndiswrapper in Mandriva

While using a native driver may be preferable, it can also be more complicated. I've found that using ndiswrapper, which is a kernel module that wraps around a Windows driver, is much simpler.

At this stage, MCC will give you the option of using ndiswrapper as well. In order to proceed, MCC will ask for the Windows driver (.INF file). If this is a dual-boot system, simply navigate to where the Windows partition is mounted and search there. For instance, a likely path for a wireless driver may be /mnt/windows/WINDOWS/system32/; of course, this depends on which version of Windows is installed.

The best way to find the driver is to boot into Windows and determine the name of the driver by visiting the Device Manager from the System option in the Windows Control Panel. From there, open the properties of the wireless network device, click the Driver tab, and then view Driver Details. This will give you the name of the Windows driver, although this is not the file you want to use (you will see something like BCMWL6.SYS, and while this file is important, it is not what you need for ndiswrapper; instead, the file to use with ndiswrapper would be BCMWL6.INF).

Once you have this information, reboot back into Linux and execute on the command line:

$ find /mnt/windows -name 'bcm*.inf'

and then point MCC to any results that come up.

Driver tips and configuration

If you do not have Windows currently installed, you will need to obtain the Windows driver online, via the wireless network card manufacturer's Web site or the manufacturer of the computer.

Once you've provided MCC with the network card driver, it will install any required software (such as the ndiswrapper package itself), bring the interface up, and start scanning for any wireless networks in range. At this point, you simply need to select the wireless network and provide any authentication credentials required to connect.

There is one caveat with ndiswrapper, however. If you are using a 64-bit Linux distribution, you will have to provide a 64-bit Windows driver. Likewise, a 32-bit Linux distribution will require a 32-bit Windows driver to work with ndiswrapper. If you cannot find a 64-bit driver, you may have to install the 32-bit version of your Linux distribution if you wish to use the wireless network card.

You can verify the installation via the ndiswrapper command-line tool:

# ndiswrapper -l
Installed drivers:
bcmwl6          driver installed, hardware present

You can also perform the installation of the driver completely via ndiswrapper, which may be useful for distributions that don't have the nice management interface that Mandriva does. For instance, to install the driver and then to write the appropriate module information for modprobe, use:

# ndiswrapper -i /mnt/windows/Program Files/Broadcom/Broadcom 802.11/Driver/bcmwl6.inf
# ndiswrapper -m

This will get ndiswrapper to install the driver. Now all that needs to be done is to configure the wireless interface. However, using a GUI tool for this -- such as the MCC, YaST in SUSE, or similar tools in other distributions -- is likely preferable to lengthy and cryptic command-line arguments to the various wireless tool programs.

If you wish to remove the Windows driver from the system, use ndiswrapper to remove it:

# ndiswrapper -e bcmwl6

This will remove the bcmwl6 driver.

Some of the command-line tools used to configure the wireless interfaces, while somewhat brutal for the uninitiated, remain good informational tools. For instance, the iwconfig program, when invoked with no arguments, will provide information on any wireless network cards and their present configuration. If you provide a network interface, such as wlan0, it will provide information on just that device:

# iwconfig wlan0
wlan0     IEEE 802.11g  ESSID:"WIRELESS"  Nickname:""
          Mode:Managed  Frequency:2.442 GHz  Access Point: 00:1B:62:2A:65:4D  
          Bit Rate=54 Mb/s   Tx-Power:32 dBm  
          RTS thr=2347 B   Fragment thr=2346 B  
          Encryption key:C95F-7C26-5EA7-D34C-BF7E-D623-4BAF-640C   Security mode:open
          Power Management:off
          Link Quality:100/100  Signal level:-29 dBm  Noise level:-256 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Here you can obtain information on which wireless network you're connected to, the type of encryption, the speed, link quality, and so forth.

If finding drivers for the wireless network card in your computer is problematic, look on the ndiswrapper home page (click on Documents/Wiki and then see List Of Cards Known To Work). On this site, you'll also find more documentation and information on using and configuring ndiswrapper.

While some wireless network devices come with Linux drivers, the majority do not. As a result, ndiswrapper is often the only way to get wireless working on many laptops or computers with wireless support. Ndiswrapper is a great tool that has been around for quite a while and does the job admirably; in some cases even better than native drivers.

Related resources on TechRepublic

Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!


Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.


Here's a twist on the wireless deal. Anybody have any clue on getting a Sprint wireless BB USB device to work with Linux, Linspire ?


"[i]If there is one area in Linux that still persists in falling under the category of ???black magic,??? it???s wireless networking. Due to the differences in wireless network cards, rebranding, slightly changed specs, security differences between WEP, WPA, WPA2, and so forth, it can be very difficult to get wireless networking set up quickly and can often be an exercise in frustration.[/i]" Reminders of the sorts of problems that arise with other OSes always makes me feel a bit better about my current choice in primary OS: FreeBSD. One of the things that, in retrospect, most annoys me about Linux networking is the split between ifconfig and iwconfig. One of the positive consequences of the more unified, integrated approach of FreeBSD development is that the common utilities tend to be more generally functional and consistent. The relevant examples here are ifconfig and core driver support. The ifconfig utility in FreeBSD does all the work that in Linux is split between ifconfig and iwconfig. Direct driver support for wireless is far more smoothly integrated with the system, as well -- about as simple as core non-wireless network driver support in Linux. Of course, ndiswrapper fills in some gaps for FreeBSD as well. Nothing's perfect.


Does it matter what version of Windows the WiFi driver comes from, e.g., XP, Vista, etc.? Thanks, -kevin


Klaus Knopper says if something doesn't work with Linux out of the box, take it back to the store and tell them this is why you are returning it. Anyone wanting simple and reliable wifi with Linux needs two things: 1. A card with the atheros chipset 2. Mandriva Linux (2007.1, or 2008 beta 2 even better) I researched the matter before buying a PCMCIA wifi card, and saw the atheros is supported in the Linux kernel right out of the box. It's a no-brainer. (vote Linux with your $$$) As for Mandriva, it lives on my systems side-by-side with my absolute favorite, Slax. Mandriva spring '07 is the first and ONLY distro I have ever seen pick up a WPA encrypted wifi network on boot. There's a lot more good reason to use Mandriva, recent corporate shakeups notwithstanding. The purists have their haughty Ubuntu, SuSE, etc. But to all doubters I say EAT THIS: urpmi The industry standard, no YAST, slapt-get or other comes close. Not even Fedora, from which RPM comes in the first place. Mandriva's MCC is also the best all around tool for recent converts to Linux to get comfortable with the differences. It works great on anything it touches, (which is a lot) and it's quite educational in the process. Then when you graduate, get Slax and really enjoy the power. Slax, I like to point out, is the project of the very man who invented the concept of the live CD Linux distro in the first place; the Czech Republic's illustrious Tomas M. cat


if at all possible, I'd try going with the XP drivers. I don't know for sure whether or not vista drivers will work, but on my HP tablet, for the broadcom card in it, I did point ndiswrapper to the pre-installed drivers, which are Vista (the thing came with Vista), so I *suspect* any would work, but if you have the choice, I'd use the XP drivers.


"[i]But to all doubters I say EAT THIS: urpmi[/i]" I have two words for you, in increasing order of importance: 1. APT 2. portupgrade I find urpmi positively painful to use, in comparison. "[i]Then when you graduate, get Slax and really enjoy the power.[/i]" I can only assume you've never really encountered BSD Unix, if you think that's "the power".


There are certainly cases where you just need to sign in as root and stay there. In my experience, this is mostly with LiveCD OSes used for system recovery, audits, and similar one-shot deals where you're not actually exposing the system to risk by using root all the time. I got the impression you were talking about using root all the time, every time, with your primary OS. As for sudo . . . most of my systems don't even have sudo installed. I use a standard user account for almost everything, and on the rare occasion that I need to do something with root privileges, I use su to get there, then exit to get back to doing my everyday stuff. I find sudo just gets in the way without providing anything in return, most of the time. There are cases where I've configured sudo, but that's in instances where some user needed to perform some normally root-only functions, but should not be allowed full root access. It's really for that purpose that sudo was designed, and that's about the only place it should be used. Put to use in that manner, sudo is a security enhancement. The other ways I've seen it misused, it's a security detriment.


You'll just have to take my word there's a niche in which I dwell where Slax's root-only config is where it's at. I'm jumping in all over the place to deal with all manner of issues, liveCD with persistent /home (and a lot of apps) on a 4GB USB stick. Last audit of a LAN I did was 2/12 hours ago. I don't run Slax on any of my own machines, (home servers, this beauty, etc) with the exception of my old laptop, on which Slax is a dream. I know the drill vis root privileges, I taught this stuff for a time. I'm actually quite stingy with permissions for my Linux users. But with Slax, I'm the guy who walks in, does magic with a mini cd and thumb drive, makes the machine work again and disappears into the sunset. I do need Slax and no backtalk when I go to do things. Last thing you need is your own OS fighting agin' ya for the stuff I do. And bonus I can run email, tap my Yahoo groups, chat with Critter in Florida... PS per your # 2 above, if there's a compromise you are sure going to want to do something about it. I don't have to type "sudo" constantly. Slax is very dangerous, don't get me wrong. But then I like the challenge, keeps me on my toes. cat


I still don't know how that's supposed to make it so great. 1. You can log in as root with just about any Unix-like OS. 2. Being logged in as root all the time is a [b]bad[/b] idea, for security purposes. For instance, performing network tasks as root means that if any of the software used in those tasks is compromised remotely, the malicious security cracker who compromised your system now has full root access.


Funny you should mention BSD, loading OpenBSD as we speak. It'll be a second firewall and handle DHCP on the LAN. What I like about Slax is you are the full-on absolute dictator of the machine. It logs in as root and you have no problems doing anything. (quite the opposite of BSD) This is great for hardware troubleshooting on client's machines, rescuing files from inoperable Windows boxes, even (attempting at least) fixing problems such as with the registry. You can of course do serious damage, but I have yet to break anything with Slax. My favorite OS by far.

Editor's Picks