Getting Wireless the NDISwrapper Way

 in
How to make NDISwrapper work with different wireless devices.

which shows that the device was recognized and the driver was installed. Now, it's time to let Linux know more about the new device. Because I use OpenSUSE, I opened YaST and went to Network Devices→Network Card→Add, and selected the following:

  • Device type: wireless.

  • Configuration name: 0 (so the device will be known as wlan0).

  • Hardware configuration name: static-2 (whatever).

  • Module name: ndiswrapper (most important).

Do not choose PCMCIA or BUS. Then, go through the next screens (pick either DHCP or an IP, specify your DNS servers and so on), until you come to the Wireless Device Settings form. There, you probably will have to set the following:

  • Operating mode: managed (ad hoc would work for a peer-to-peer network).

  • Network name: Guiamovil (the name of the network to which I wanted to connect).

  • Authentication mode: WPA-PSK (open would work for an unrestricted, unprotected, passwordless network).

  • Key input type and encryption key: whatever the network administrator tells you to use. (Of course, you don't need this for an “open” network.)

You can leave all these changes out, however, if you don't know to what network you will be connecting. Simply exit the program, save all the changes, and you will have device wlan0 available. We are almost there!

How Do I Connect?

If you made it this far, you can use the wireless tools, which include iwconfig and iwlist, to configure your device and search for available networks. (Of course, there are many similar tools, some even have graphic interfaces; look around if you so desire.) In my situation, I already knew the network to which I wanted to connect, but in other cases (Wi-Fi hot areas at airports, for example), you would need to look around to find one.

You can scan for networks with iwlist wlan0, and you'll get something like this:

wlan0  Scan completed :
       Cell 01 - Address: 00:16:B6:DB:10:93
                 ESSID:"linksys"
                 Protocol:IEEE 802.11g
                 Mode:Managed
                 Frequency:2.437 GHz (Channel 6)
                 Quality:0/100 Signal level:-84 dBm Noise level:-256 dBm
                 Encryption key:off
                 Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                          24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
                          12 Mb/s; 48 Mb/s
                 Extra:bcn_int=100
                 Extra:atim=0
       Cell 02 - Address: 00:4F:67:00:C1:AA
                 ESSID:"Guiamovil"
                 Protocol:IEEE 802.11g
                 Mode:Managed
                 Frequency:2.437 GHz (Channel 6)
                 Quality:0/100 Signal level:-67 dBm Noise level:-256 dBm
                 Encryption key:on
                 Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                           9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                           48 Mb/s; 54 Mb/s
                 Extra:bcn_int=200
                 Extra:atim=0
                 IE: WPA Version 1
                     Group Cipher : WEP-40
                     Pairwise Ciphers (1) : WEP-40
                     Authentication Suites (1) : PSK

Great, the connection I wanted is there (the second one, Guiamovil), and also another open, unprotected one called Linksys. (The unchanged name is a giveaway that the wireless router was installed without any specific configuration.)

If you would rather use the command line, iwconfig allows configuring the wireless device. Try iwconfig --help or man iwconfig to learn more about this. For example, I could get the same results that I did with YaST by typing:

iwconfig wlan0 essid "Guiamovil" mode managed key 
"s:THESECRETPASSWORD" commit

Now, you simply can ping any site to check how the device is working or connect to the Web and surf along.

Second Experiment: the PCMCIA Method

A friend of mine loaned me a PCMCIA card, so I could test a different kind of device. I first thought about removing the USB driver and setup and then installing his card, but that would have been sort of lame. Anyway, just to make sure the card worked, I tried it, starting with:

ndiswrapper -r atiwu
rm /etc/modprobe.d/ndiswrapper
cd /path.where.you.downloaded.ndiswrapper
make uninstall
make clear
make
make install

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Blacklisting existing drivers

Paul Schmidt's picture

This is an excellent article for a problem that perplexes many Linux users.

You are incorrect on the status of Linux drivers for some chipsets. There is a Linux native driver for Broadcom wireless chipsets. The bcm43xx driver, or the newer b43 driver, are included in many newer distros by default. Many consider them to be inferior to the NDISwrapper method, and use NDISwrapper instead.

If there is an existing driver being loaded for your card, you must first remove them. You must then prevent them from loading by adding them to the /etc/modprobe.d/blacklist file.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix