Using NdisWrapper with SuSE 9.1/9.2/9.3/10.0
Sunday, October 3rd, 2004Yet another popular choice to get wireless networking to work is the open source solution NdisWrapper.
If you happen to have a wireless card with the popular chip sets RTL8180 [2] or ADM8221 [3] you will have not much choice when it comes to drivers to get them to work. In a previous article I described the setup of the Linuxant driver, here I will shortly describe how to get NdisWrapper to work.
Setting up NdisWrapper
First things first, install the NdisWrapper files via Yast from SuSE. It won’t be the latest version, but you save the compiling. The source code is available at NdisWrapper’s website [1]. Also make sure you have the wireless tools installed.
After the installation you need to set up the NdisWrapper. Check with ‘lsmod’ if the driver is loaded. If it isn’t load it as root via ‘modprobe ndiswrapper’.
Now install the wlan driver information. If you didn’t do it already, download the WinXP drivers from resource [2] or [3]. Unpack it somewhere in your home directory and install them. Run ‘ndiswrapper -i /path/to/*.inf’ In case of the RTL8180 driver the file is named net8180.inf.
After you’re done run ‘ndiswrapper -l’. If everything went well you should see a message like this one:
Installed ndis drivers:
net8180 present
Let’s Network
Run ‘iwconfig’ to see if there is a wireless interface. On my Laptop it is wlan0.
wlan0 IEEE 802.11b ESSID:”sjmk” Nickname:”luna”
Mode:Managed Frequency:2.437 GHz Access Point: C0:EC:31:27:64:76
Bit Rate=11 Mb/s Tx-Power:20 dBm Sensitivity=0/3
RTS thr=2432 B Fragment thr=2432 B
Encryption key:off
Power Management:off
Link Quality:100/100 Signal level:-67 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
If you don’t see your wireless interface you might have to restart your machine. When Linux is back up try again. If you see some output like shown above, see if your network interface wlan0 is up and running.
If the module (ndiswrapper) does not load during startup it might have to be added to the following file: ‘/etc/modprobe.conf.local’. Add the following line: ‘alias wlan0 ndiswrapper’. That should take care of things. I had to do this under SuSE 9.1. Now using 10.0 it is not necessary (wasn’t necessary since 9.2). You can also run ‘ndiswrapper -m’ which will write the correct entry into the above file.
Run ‘ifconfig’. wlan0 should be in the output:
wlan0 Link encap:Ethernet HWaddr 00:0C:41:72:8E:7E
inet addr:192.168.1.106 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fc70::71f:41cf:ee34:8d5c/64 Scope:Link
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:409 errors:0 dropped:0 overruns:0 frame:0
TX packets:423 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:168382 (164.4 Kb) TX bytes:59354 (57.9 Kb)
Interrupt:11 Memory:20800000-208000ff
Set Up Your Card
Now you can set up your card via Yast. Fill out all the information. Just check all the options. Make sure that you set your device type to be wireless and that it is a PCMCIA device. Under Advanced – Detailed Settings set ‘Device Activation’ to ‘When Hotplugged’. There will also be an option to set up your wireless network settings and WEP keys.
Tweak The File
While using SuSE 9.1 I did the following: Open the file ifcfg-wlan-whatever in /etc/sysconfig/network and add the following two lines at the bottom (this is not necessary with 9.2, 9.3 and 10.0, and maybe it was not necessary with 9.1 either):
POST_UP_SCRIPT=’/path/to/wlan0′
POST_DOWN_SCRIPT=’/path/to/wlan0d’
These two script are as follows:
wlan0:
#!/bin/sh
route add default gw 192.168.1.1 wlan0
sleep 1
ifconfig wlan0 up
route del default gw 192.168.1.1 eth0
ifconfig eth0 down
wlan0d:
#!/bin/sh
route add default gw 192.168.1.1 eth0
sleep 1
ifconfig eth0 up
route del default gw 192.168.1.1 wlan0
ifconfig wlan0 down
My router has the IP address 192.68.1.1, yours might be different, so you have to adjust this. As I said, I am not using this since SUSE 9.2 anymore.
Ping Away
Now all is good so far. Try and ping your router and if that works ping some remote server. If you can ping your router but not a remote machine, it could simply be that your resolv.conf file is not set up yet, resolv.conf resides in ‘/etc’. This can happen when your wlan card is the first interface you set up. If you already went online via your eth0 interface, things a probably dandy. It helps of course to have a backup of a resolv.conf file. Check you ISP for the correct data. You can add these data (name server IP addresses of your online provider) via the YAST network tool. Once your resolv.conf file has the proper information you should be able to surf the web.
Another reason can be there is no default route set up for the wlan card. To make this happen, add the following two lines to your ifcfg-wlan-xxx file:
DHCLIENT_SET_DEFAULT_ROUTE=’yes’
DHCLIENT_MODIFY_RESOLV_CONF=’yes’
To tell your system to also enable your wlan card to modify resolf.conf add the follwoing line:
DHCLIENT_PRIMARY_DEVICE=’yes’
The wlan interface should now have its default route and you should be able to surf the web.
KwifiManager
You also can use KwifiManager [4] to control your wlan card, but you don’t have to. You can install it via SuSE’s Yast.
Load KwifiManager and go to ‘Config Menu – Configuration Editor’. In order to apply changes you need to provide the root password . The Configuration Manager lets you set all the parameters that are important for iwconfig: your network name (SSID), WEP keys, power management etc. If you check to load a default configuration during KDE start, everything will work on it’s own, quite convenient. The nice thing about KwifiManager is, that you can have up to 4 different profiles.
Related Links and Resources
[1] Ndiswrapper
[2] RTL8180L Download
[3] ADM8221 Download
[4] KWiFiManager – the wireless LAN client manager for KDE3


