Open Source

Tech Tip: Set up wireless network cards in Linux with ndiswrapper

Learn how to get your Linux laptop to connect to a wireless network using the ndiswrapper program.

These days, almost every laptop available comes with built-in wireless functionality. But many of these cards don't have proper Linux drivers.

So unless the laptop is set to dual-boot, it's unlikely that Linux users can use the wireless card. Even then, unless Windows is running, it's doubtful that the laptop can connect to a wireless network.

However, a solution exists for many cards. A program called ndiswrapper is available that allows a Linux kernel module to load a Windows driver for certain wireless cards. This lets laptops use the wireless card in Linux even if no Linux-native drivers are available.

To begin, go to the Web site to find a copy of ndiswrapper. Download the latest version (currently 0.8), and install it, as shown below:

# tar xvzf ndiswrapper-0.8.tar.gz
# cd ndiswrapper-0.8
# make install

This installs the ndiswrapper tool and a kernel module built against the currently running kernel. You must have the kernel source code available. (On most RPM distributions, just install the "kernel-source" package.)

Next, you need to find a copy of the Windows driver for the card, whether from an existing Windows system (if dual-booting) or by downloading the driver. A list of supported cards is available from the Web site, which offers links to download Windows drivers.

To install the Windows driver, execute the following:

# ndiswrapper -i [inf_file]

The .inf file is the driver information file for Windows. This installs the appropriate files into /etc/ndiswrapper/[driver]. You can check to make sure ndiswrapper sees the driver by executing the following:

# ndiswrapper -l

The program should list the driver you just installed as present. At this point, load the ndiswrapper kernel module, as shown below:

# modprobe ndiswrapper

This loads the driver and makes it available to the system. You need the wireless tools package installed to configure the wireless interface. To determine if the system properly sees the card, simply type iwconfig, and it should show up as a network interface. (It's usually wlan0 if it's the only wireless card on the system.)

The next step is to use iwconfig or the distribution's configuration tools to set up the wireless card as you would any other network card, with the wireless-specific extensions, such as WEP key, mode, etc.

Editor's Picks

Free Newsletters, In your Inbox