Jump to content

How I Got Wireless Working with ndiswrapper


beesea
 Share

Recommended Posts

Intro

I had a terrible experience finding info on how to set up ndiswrapper to work with my WMP54G card, but after a few days I finally figured it out and decided to post about it. Hopefully someone will find this useful. YMMV, but it should work with any card supported by ndiswrapper

 

Procedure

You're going to need to add two lines to /etc/modprobe.conf. Here are the lines I added:

alias wlan0 ndiswrapper
install ndiswrapper /sbin/modprobe --ignore-install ndiswrapper && { loadndisdriver 14e4 4320 /etc/ndiswrapper/bcmwl5.sys /etc/ndiswrapper/bcmwl5.inf; }

The part that gave me the most headaches is the area between the curly braces. As you can see loadndisdriver takes four arguments:

# loadndisdriver --help
Usage: loadndisdriver [OPTIONS] pci_vendor pci_device windowsdriver.sys windowsdriver.inf

Here's how I got the arguments:

  • First, you'll need the windows driver for your card so grab the .sys and the .inf files from your card's CD (or where ever the drivers are). For my card they were called bcmwl5.sys and bcmwl5.inf. It doesn't really matter where you put these files. I put them in /etc/ndiswrapper. These are the last two arguments to loadndisdriver.
  • To find pci_vendor and pci_device you need to run the lspci command. Here's what mine looks like:
    # lspci
    00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 02)
    00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 02)
    00:07.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)
    00:07.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01)
    00:07.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01)
    00:07.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)
    00:0d.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX [Cyclone] (rev 24)
    00:0e.0 Multimedia video controller: Zoran Corporation ZR36120 (rev 03)
    00:0f.0 Network controller: Broadcom Corporation BCM94306 802.11g (rev 03) <=== My wireless card
    00:10.0 Multimedia audio controller: Aureal Semiconductor Vortex 1 (rev 02)
    01:00.0 VGA compatible controller: nVidia Corporation NV5M64 [RIVA TNT2 Model 64/Model 64 Pro] (rev 15)


    Notice the numbers at the beginning of the line for your card (00:0f.0 for mine), and then run lspci -n:

    # lspci -n
    00:00.0 Class 0600: 8086:7190 (rev 02)
    00:01.0 Class 0604: 8086:7191 (rev 02)
    00:07.0 Class 0601: 8086:7110 (rev 02)
    00:07.1 Class 0101: 8086:7111 (rev 01)
    00:07.2 Class 0c03: 8086:7112 (rev 01)
    00:07.3 Class 0680: 8086:7113 (rev 02)
    00:0d.0 Class 0200: 10b7:9055 (rev 24)
    00:0e.0 Class 0400: 11de:6120 (rev 03)
    00:0f.0 Class 0280: 14e4:4320 (rev 03)  <=== My wireless card
    00:10.0 Class 0401: 12eb:0001 (rev 02)
    01:00.0 Class 0300: 10de:002d (rev 15)


    Match up the numbers you found earlier to locate your card. The numbers i'm looking for in my example are 14e4:4320. 14e4 is pci_vendor argument of loadndisdriver and 4320 is the pci_device argument

To test this out install the ndiswrapper module:

# modprobe ndiswrapper

If there were no error messages, so far so good. If the command "iwconfig" (part of the wireless-tools package) recognizes wlan0 and doesn't say "no wireless extensions" then everything installed correctly. Now you can use iwconfig to setup the access point, essid, etc. See the man page for iwconfig for more info. Here's how I would start my internet manually:

iwconfig wlan0 mode Managed
iwconfig wlan0 key restricted XXXXXXXX
iwconfig wlan0 essid ZZZZ
dhcpcd wlan0

Just replace the X's with your key if you use WEP (you do use WEP, right? :D) and replace the Z's with the name of your access point.

 

Now you're probably going to want to start all this up automatically. You need to create a file called /etc/sysconfig/network-scripts/ifcfg-wlan0 and put this in it:

DEVICE=wlan0
BOOTPROTO=dhcp
ONBOOT=yes
ESSID=YOUR_ESSID
MODE=Managed
KEY="YOUR_KEY"

Have a look at the /etc/sysconfig/network-scripts/ifup-wireless script to see what variables you can put in this file. Now all you have to do is reboot and see if your internet comes up.

 

Conclusion

I hope that someone can find this useful. Of course is anything here is wrong or if there's an easier way, then by all means do tell!

Link to comment
Share on other sites

  • Replies 78
  • Created
  • Last Reply

Top Posters In This Topic

According to the HOWTO above, that command would be run as root. Are you trying it as root? If you're not sure how:

 

Open a terminal (Konsole, Gnome-Terminal)

type su <enter>

<enter your root password and press enter>

 

Then try the loadndisdriver command

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
Guest rutty

I'm so glad I found this thread! I'm trying to install ndiswrapper too and this has been the best info I've found on it yet, however I still can't get it to work. It looks like it should, but it doesn't.

 

I can see the Network Connection in the control panel, but it's doing nothing and shows "not connected". I'm not using WEP (yet ;) ) to keep it simple and my card (a D-Link DWL-510) works fine under XP, which is how I'm able to get on line at all.

 

I'm using Mandrake 10.0 Community straight from the discs and can't update until I can connect it via my wireless card - cable modem is two floors up. Are there any dependencies that I need to install to make it work? I noticed that both Wireless Tools and the DHCP daemon were absent, but am I likely to be missing anything else?

 

I also noticed a deliberate mistake with the first bit of code - it should look like this:

 

alias wlan0 ndiswrapper
install ndiswrapper /sbin/modprobe --ignore-install ndiswrapper && { loadndisdriver 14e4:4320 /etc/ndiswrapper/bcmwl5.sys /etc/ndiswrapper/bcmwl5.inf; }

 

The modprobe wouldn't work until I put a colon between the two numbers that came up for me. Other than that the walkthrough was bloody brilliant - I just need to get it finished off! Any pointers?

Link to comment
Share on other sites

Guest rutty
also when i type iwconfig it says command not found, did you have this same problem?

I had the same problem with that. Mandrake doesn't seem to install the Wireless tools on install. I searched for "wireless" within the Software Install screen (in descriptions) and found that application. Unless it's installed you won't be able to run iwconfig.

 

No idea about WEP I'm afraid

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share


×
×
  • Create New...