HowTo: Madwifi or Ndiswrapper Wireless Network Drivers in openSUSE 10, 11.0

This tutorial has been largely obsoleted by tech advances. It will be deleted when openSUSE 12 is released.

↑↑↑↑Is your card/prospective card supported? DON'T assume a card is likely to work in Linux without checking. If you like a card, check it out before you buy it. This can save lots of frustration and perhaps $100 from being wasted. Here are some resources for checking cards:

Note: Madwifi does not support USB devices.

Use the Device ID: The device ID is a 16-bit label specific to that device series. E.g. the device ID for my D-Link DWL G520 PCI card is 168c:0013. You can search-engine search on the device's ID plus the word Linux and discover much about installing and configuring the device in Linux. You should take note of your device ID and use it in the Hardware Compatibility, Madwifi and Ndiswrapper lists to confirm that any particular advice you are reading is for your device and not some similar model/release. It's a powerful thing for tracking support for your interface. Command line discovery of the device ID is discussed in the segment on diagnostics at the end of this page.

↑↑↑↑Getting Started with Madwifi or Ndiswrapper: Which driver, Linux native, Ndiswrapper, Madwifi? Sheesh! If you find a very good rap for one type over another for your device, well that speaks for itself. Mostly, you won't have multiple choice, but generally speaking (for me) there's not much to choose between them, so I would recommend in this order: Linux Native, Madwifi, Ndiswrapper. Remember, they're all very good so don't spend a lot of time worrying about it.

Discover your Kernel Keyword for Madwifi or Ndiswrapper: Before you install either Madwifi or Ndiswrapper you must discover you kernel keyword. Open a console and enter this command: uname -r. Here's an example from my computer:

frednurk@suse110:~> uname -r
2.6.25.11-0.1-pae
frednurk@suse110:~>

That tells me that I have the pae kernel installed. My kernel keyword is pae. Yours may well be quite different. You'll need the kernel keyword to install the correct RPM for Madwifi or for Ndiswrapper.

↑↑↑↑Installing Madwifi: [Note: Madwifi does not support USB devices.] You install either Madwifi or Ndiswrapper, not both. If you already have Ndiswrapper installed and you want to install Madwifi, remove Ndiswrapper first. Madwifi maintain an RPM repository for openSUSE. Drill down on the link to your version and add the version location to your repository list in Yast. For 10.0 use the install DVD, no RPM repository is available. For 10.1 and 10.2 add it via Yast --> Software --> Installation Source --> Add --> Specify URL. For 10.3 and 11.0 add it via Yast --> Software --> Software Repositories --> Add --> Specify URL.

After you've added the repository, open Yast --> Software Management and use the search facility on the LHS with the word madwifi. Select from the results two RPMs: madwifi and also the rpm madwifi_kpm_keyword. In my case the keyword was pae as discussed earlier, so for me the second RPM was madwifi-kpm-pae. Remember, yours may well differ in the keyword. Once you've installed those two RPMs, that's it for Madwifi. You skip over the Ndiswrapper segment and configure the wireless device in Yast.

↑↑↑↑Installing Ndiswrapper: You install either Madwifi or Ndiswrapper, not both. If you already have Madwifi installed and you want to install Ndiswrapper, remove Madwifi first. Be sure you know your kernel keyword as discussed above. Then open Yast --> Software Management and use the search facility on the LHS with the word ndiswrapper. Select from the results two RPMs: ndiswrapper and also the rpm ndiswrapper_kpm_keyword. In my case the keyword was pae as discussed earlier, so for me the second RPM was ndiswrapper-kpm-pae. Remember, yours may well differ in the keyword. Install those two RPMs and you can then proceed to install your Windows drivers into openSUSE.

Installing Ndiswrapper Drivers: Locate the XP drivers on the install CD that came with the device or if you don't have it, download them from the manufacturer's site. Copy the whole contents of the directory containing the XP .inf file to a directory anywhere in your Suse filesystem, e.g in the directory "ndiswrapper" located at /path_to/ndiswrapper. For illustration, suppose the .inf is abcde.inf, now located at /path_to/ndiswrapper/abcde.inf. Open a console and first enter su to get rootly powers. Then enter the command ndiswrapper -i /path_to/ndiswrapper/abcde.inf. Here's the dialogue:

frednurk@suse110:~> su
Password:
suse110 # ndiswrapper -i /path_to/abcde.inf

All being well you can enter the diagnostic command ndiswrapper -l and receive a positive response something like this:

frednurk@suse110:~> su
Password:
suse110 # ndiswrapper -l
  abcde : driver installed
  device (2001:3A03) present
suse110 #

If you receive a message like device (2001:3A03) present (alternate driver <driver name>), then you have a possible conflict with a Linux native driver and will need to add the name of the Linux driver into the blacklist file located at /etc/modprobe.d/blacklist.

To check whether the kernel module is present, execute the modprobe command as root:

frednurk@suse110:~> su
Password:
suse110 # modprobe ndiswrapper
suse110 #

In this case, no response means success. If you get an error message like "Module ndiswrapper not found", you have a problem.

Ndiswrapper should load at boot time. For some it doesn't. If you find that it doesn't, just add the command modprobe ndiswrapper into the bottom of the file boot.ini located at /etc/init.d/boot.ini, and it will load at boot time.

frednurk@suse110:~> su
Password:
suse110 # ndiswrapper -m
adding "alias wlan0 ndiswrapper" to /etc/modprobe.d/ndiswrapper ...
suse110 #

Should you need to uninstall ndiswrapper at some time, please follow the examples given on the archived Ndiswrapper Wiki. All being well, you can now proceed to configure the wireless device in Yast for Internet and LAN access.

↑↑↑↑Precursors to Configuring the Wireless Interface: This Tutorial uses a simple scenario: A SOHO LAN with automatic IP addressing by DHCP server, simple WEP encryption, a static single-wireless environment like a home. When you get these basics going, you will have the strong basis for adding fancy expansions later. First a few housekeeping items before you activate Yast's GUI for networking the wireless device.

Wired Ethernet Cards: You can't have two interfaces with IP addresses on the same subnet activated simultaneously in the one PC. You can check for active cards by opening a console and entering this command: /sbin/ifconfig. So if you have an active wired network interface, you must reconfigure it as a reserve connection. In Yast --> Network Devices you can "edit" the wired card and under the "general" tab you can set it to activate "on cable connect". This way when the wireless interface is "down", you can restore your internet connection by connecting the wired network.

IMAGE: error cannot display

Workgroup Name: In Vista the workgroup name is found as follows: Open Control Panel --> Classic View --> System --> Advanced System Settings. The workgroup name is listed there under "Computer Name". XP has a similar recipe. Frequent Microsoft choices are MSHOME and WORKGROUP. The default for recent versions of openSUSE is WORKGROUP, which is found in the Samba configuration file at /etc/samba/smb.conf. You can change it if you like but it must be the same on all workstations. So whatever you decide, make a note of it.

Checking the Router: The router is configured from any HTTP browser like Firefox. Simply enter the IP address of the router into the browser. In this Tutorial it's http://192.168.3.1. Supply username and password and you'll see a configuration interface like mine in Pic#2

IMAGE: error cannot display

Pic#2, just to the left, shows the view of a Netgear router on IP address http://192.168.3.1 in Firefox.

I set the passphrase fredandethel as the lazy way to generate reproducible hexadecimal keys. I arbitrarily selected to use the first key offered by the hex calculator in the router, namely 4032393ECD. This is 10 alphanumerics long because I have opted for 16-bit Hex encryption.

I've really simply selected the defaults except for the passphrase fredandethel and the wireless network's Service Set IDentifier (SSID).

The SSID is a code that attaches to all information packets belonging to the same wireless network. The SSID allows differentiation from the neighbouring networks that are also detected at the antennae of your wireless devices. Sometimes you'll see this expressed as ESSID - effectively the same thing as SSID.

You can of course stray from these factory defaults but you must ensure that the options you select when configuring your network card are the same as those in the router as displayed on your screen equivalents of Pic#2.

↑↑↑↑Configure the Wireless Card Using Yast

This pictorial is from Yast, for stationary networks where a Network Manger is inappropriate. If you must switch networks frequently, then use a Network Manager to configure the card rather than Yast.

I'll use the method of automatic assignment of DHCP addresses via a DHCP server for configuring the Network Interface. That's the openSUSE default. There are two other common options: DHCP addressing plus hand-coding of Name Servers and the Gateway, and last the common setup for servers where the IP address, the Name Servers and the Gateway are all hand coded. These options are fully covered in a related Tutorial on this site.

Open Yast and select Network Devices --> Network Card. The Network Settings panel will open with the Overview Tab activated:

IMAGE: error cannot display

Usually your computer will have a wired ethernet port as reflected in Pic#3. Don't' forget to set it so both it and the wireless interface don't have an IP address on the same subnet concurrently. Highlight the wired interface in Pic#3 and select "Edit" it. Pic#4 will open up.

IMAGE: error cannot display

Here I set my wired card to activate "On Cable Connection" so I can control it with the cable. Then click "Next" and lock that setting for eth0 in. The screen will return to Pic#3.

Either you'll see the wireless card recognised in Pic#3 or not. If it's there then highlight it and select to "Edit" it. If it's not the select to "add" it and proceed to configure it.

IMAGE: error cannot display

Pic#5 will present if you "add" the wireless interface. Set Device Type to wireless and leave the zero default (for one card) in Configuration Name. Leave the USB and PCMCIA options empty. Then click Next to proceed to Pic#6.

IMAGE: error cannot display IMAGE: error cannot display

The screenshots tell the story here. Set the radio button for DHCP addressing to active under the Address Tab

Assign the interface to the external zone under the General Tab. I see advice on the internet to assign it to the internal zone. That simply renders the firewall ineffective. So stay with the "external zone" if you want to be protected.

The final Tab in the trio Pic#6/Pic#7, the Hardware Tab, is usually a non event in the current context, so I haven't shown it. But just check that the module name is present (e.g. ndiswrapper etc). When finished with these three Tabs, click Next and the panel to set wireless encryption will open as illustrated below:

IMAGE: error cannot display

This illustrates simple Open-WEP encryption. I enter the SSID and Hexadecimal key from my router (refer Pic#2). You can use quite different configurations but I suggest that you experiment with those once a working wireless network has been established.

At this point you select Next in lower RHS corner and the configuration of the network interface will end. You'll be returned to the panel for configuring th e broad network as in Pic#3, EXCEPT now you'll see the wireless card added in with your wired interface: See Pic#9 & cf Pic#3

IMAGE: error cannot display

Notice that now the wireless interface is recognised and named in thetop space and also its details regarding name (here wlan0), activation (here boot), IP address (DHCP) and Mac address are given in the lower space. These data confirm the correct recognition of the card and its configuration in the system.

That concludes the configuration of the card with Suse's default of automatic DHCP addressing. I'll show two more panels, mostly so you can have the full pictorial suite for checking settings if something goes wrong.

IMAGE: error cannot display IMAGE: error cannot display

Pic#10 and Pic#11 are included for completeness. They show the correct openSUSE settings under the tabs "Hostname/DNS" and "Global Options" for automatic IP addressing by DHCP. There's noting under the "Routing" tab when using DHCP. End of Story.

↑↑↑↑Diagnostic Tools and Testing: I'm including a list of diagnostic tools to help you check/diagnose your wireless network. They are powerful tools for figuring out more about your card and what's wrong if the card doesn't respond correctly.

Discover the Device ID: The device ID, a double 4-digit affair like 168c:0013, is extremely useful. You can search-engine search on the device's ID plus the word Linux and discover much about installing and configuring the device in Linux. Discovery is different for USB and PCI interfaces. For PCI wireless interfaces it's a two or three step process. First you issue the command lspci in a root terminal/shell. Here's the result for my D-Link DWL G520 card:

00:08.0 Ethernet controller: Atheros Communications, Inc. AR5212 802.11abg NIC (rev 01)

Next issue the command lspci -n for the remaining information (including the device ID). Here's the result of that for my D-Link DWL G520 card:

00:08.0 Class 0200: 168c:0013 (rev 01)

And if you want the verbose version use lspci -nv.

The procedure's simpler for USB wireless interfaces. Issue the command lsusb and you'll receive information like this (e.g. my D-Link DWL-G132 USB NIC):

Bus 001 Device 007: ID 2001:3a03 D-Link Corp. [hex]

And of course lsusb -v will get you the "verbose" version.

ndiswrapper -l: If you've used Ndiswrapper then this command in a root terminal will display the driver that you installed:

Password:
dragasuse:~ # ndiswrapper -l
neta3ab : driver installed
device (168C:0013) present
dragasuse:~ #

The session states that driver neta3ab has been installed, which you would expect for this card. Also if you search for 168C:0013 on the net you'll quickly find that it's for the D-Link wireless PCI card.

ifconfig: this command will display network information for all network interfaces. I've edit the results down to just those for the wireless interface to reduce confusion:

dragasuse:~ # ifconfig

wlan0 Link encap:Ethernet HWaddr 00:17:9A:75:CA:A6
inet addr:192.168.3.23 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63445 errors:0 dropped:0 overruns:0 frame:0
TX packets:52889 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:54471173 (51.9 Mb) TX bytes:7371293 (7.0 Mb)
Interrupt:177 Memory:dffe0000-dfff0000

dragasuse:~ #

The data revealed for wlan0 (or ath0 for Madwifi) by ifconfig are: Mac address of the card (00:17:9A:75:CA:A6), its IP address (192.168.3.23/255.255.255.0), MTU (1500), packet transmissions and irq/mem addressing. These all have diagnostic significance.

iwconfig: This is analogous to ifconfig but it has a focus on wireless parameters:

dragasuse:~ # iwconfig

wlan0 IEEE 802.11g ESSID:"gertrude" Nickname:"dragasuse"
Mode:Managed Frequency:2.452 GHz Access Point: 00:14:6C:3D:81:8A
Bit Rate=108 Mb/s
Encryption key:4032-393E-CD Security mode:open
Power Management:off
Link Quality:98/100 Signal level:-33 dBm Noise level:-96 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

dragasuse:~ #

You'll recognise here the essid (gertrude), hostname (dragasuse), MAC address of the access point (in this case the router), a bit rate that cannot be trusted, encryption parameters, link quality in this case of 98% and a signal to noise ratio of 63dB. These all paint a picture of whether the interface is working correctly.

route will display the routing table:

dragasuse:~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.3.0 * 255.255.255.0 U 0 0 0 wlan0
link-local * 255.255.0.0 U 0 0 0 wlan0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.3.1 0.0.0.0 UG 0 0 0 wlan0
dragasuse:~ #

In short this shows that wlan0 is routing to the internet through the gateway at 192.168.3.1 in the router

resolv.conf defines the nameservers:

dragasuse:~> cat /etc/resolv.conf
nameserver 61.9.211.1
nameserver 61.9.194.49
search swerdna
dragasuse:~>

This shows the IP addresses of the primary and secondary nameservers. If these are wrong or are missing you can edit the file directly (advanced) or alter them in Yast (GUI lovers: see Pic#7).

Finally you could try for yourself the command ifstatus wlan0 (or ath0) which also gives important diagnostic information.

Now a final afterthought about a rather useful systray icon:

KWifiManager (AKA Kwifi): I use the app KWifiManager for visual confirmation of whether my wireless link is active. Note that I do not recommend Kwifimanager as a network manager. Better tools for that are Gnome-nm and wifi-radar for KDE. I simply like Kwifi as a nice visual display of whether I'm currently connected to my LAN while I'm using the "ifup configuration". Kwifi resides in the system tray as a green icon displaying signal quality - a nice visual check.

IMAGE: error cannot display

If you click the systray icon the display in Pic#11 opens. You can check that you're connected to the right network from the alphanuneric address of the access point displayed on Pic#11. Here it's 00:14:6C:3D:81:8A - you should see this address on e.g. http://192.168.3.1 as the mac address of the router. Further check the working of wlan0 by checking the frequency of the link displayed here (2.452GHz on channel 9) against the router data on http://192.168.3.1. You can also examine the wlan0 IP address 192.168.3.23 and see that it is consistent with addresses served up by a DHCP server on address 192.168.3.1 (in the router). Finally, if you click Scan for Networks you should see a list of locally detected networks listed by essid, including in this example the network named gertrude (see Box#2 & Pic#9).

↑↑↑↑Appendix: Some Cards that I've used (FYI):

Card Chipset Ndiswrapper Madwifi ID and Version
D-Link DWL G520 PCI Atheros Yes Yes 168c:0013
HWv:B4 FWv:4.30
D-Link DWL-G132 USB Atheros Yes No 2001:3a03
HWv:A3 FWv:1.21
Netgear WG511T PCMCIA Atheros AR5212 Yes Yes (Thanks Doog) Netgear=1385:4b00
Atheros=168c:0013
Netgear WPN111 USB Not supported No No N/A

My D-Link DWL G520 (March 07) is HW v B4. HW version B3 is reported to work in Suse. Versions A and C are reported not to work in Suse. Don't confuse this card with a DWL-G520+, also reported not to work in Suse

If using a Netgear WG511T, work with Atheros ID: 168c:0013.

Take it easy.

Swerdna: 03 April 2007, last updated 12 August 2008