Ndiswrapper
Size: 19013
Comment: formatted couple lines
|
Size: 19129
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 12: | Line 12: |
* Before going any further, are you using a Live CD? If you are, give up now. This won't work. * If you are running ubuntu AMD64 bit, go to links section for instructions. |
<!> Before going any further, are you using a Live CD? If you are, give up now. This won't work. <!> If you are running ubuntu AMD64 bit, go to links section for instructions. |
Line 96: | Line 96: |
a. try a different driver such as the drivers for win2k or another driver matching the pciid on the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List ndiswrapper list] b. look for additional help at [http://www.ubuntuforums.org the Ubuntu Forums]. |
a. Try a different driver such as the drivers for win2k or another driver matching the pciid on the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List ndiswrapper list] a. There is a [#trouble troubleshooting] section, you can see if there is an answer there. a. Look for additional help at [http://www.ubuntuforums.org the Ubuntu Forums]. |
Line 128: | Line 129: |
[[Anchor(trouble)]] |
ContentsBRTableOfContents(3) |
1. Introduction
- If your wireless network card does not have a native linux driver for it you can use the windows drivers with ndiswrapper. Ndiswrapper is a module in linux that allows linux to use the windows driver for wireless cards (in most cases).
If you do not know what chipset your wifi card uses, issue the lspci command in a terminal. It should be listed there. In order to see if your chipset is known to work with the ndiswrapper module, find your card in the list [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List here]. That link might even provide you with useful tips to get your specific card to work, as well as providing a link to the working Windows drivers.
Before going any further, are you using a Live CD? If you are, give up now. This won't work.
If you are running ubuntu AMD64 bit, go to links section for instructions.
2. Install Repository Version
2.1. Install necessary packages
- Ubuntu comes with the necessary ndiswrapper module pre-installed but it needs the ndiswrapper-utils package to get it working. There is also a graphical interface to using ndiswrapper which you can use.
2.1.1. With internet access on ubuntu pc
If you have internet access via some other method while logged into ubuntu, you can install the apps from the repositories. If you don't know how to install apps then you can read [http://help.ubuntu.com/starterguide/C/ch02.html how to here]
You may have to add the multiverse and universe repositories which is explained in the link.
2.1.2. With internet access from another pc
- If you do not have internet access you can go to a pc that has internet access and download these two packages.
- For 5.04 Hoary Hedgehog
ndisgtk is not in hoary repositories,
not verified but you can try the breezy app to see if it works. See breezy section for link.
- For 5.10 Breezy Badger
- For 6.04 Dapper Drake
[http://packages.ubuntu.com/dapper/net/ndisgtk]
At time of writing this dapper was not released so links may change. You can look [http://packages.ubuntu.com/dapper/ here] and search for the packages.
Copy the appropriate files over to a directory on your ubuntu machine (a good location is /home/(user_name)/drivers) and install them in this order:
sudo dpkg -i ndiswrapper-utils_1.1-4ubuntu2_i386.deb
sudo dpkg -i ndisgtk_0.5-1ubuntu1_all.deb
The commands listed above are a general example on how to install a .deb package from the command line. You need to be in the directory where the files were copied to and you need to replace the end with the actual package name you are installing. If you are new to the terminal, I suggest reading the wiki:BasicCommands:BasicCommands page here on the wiki.
2.1.3. With no internet access
With out any access you can still install ndiswrapper-utils from the install cd but ndisgtk is not on the disk. Put the disk back in the drive, open up synaptic from System>Admin and search for ndis. If you do not know how to install apps, click on the lifepreserver on the top panel and read Ubuntu X.XX starter guide.
2.2. Set up and install drivers
attachment:IconsPage/IconWarning3.png
Important: Do NOT use drivers on your CD. They may work and you can try them, but you may experience kernel crashes etc., if the driver on your CD has not been tested. Instead, you need to download appropriate Windows XP driver for your card from the Wiki entry List. To identify the driver that you need, first identify the card you have with 'lspci' and note the first column such as 0000:00:0c.0 and then find out the PCI ID of the card that with 'lspci -n' corresponding to the first column of 'lspci' output. The PCI ID is third column or fourth in some distributions and of the form '104c:8400'. Now you need to get the Windows driver for this chipset. In the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/list list], find out an entry for the same PCI ID and download the driver corresponding to it (don't worry if the link is not under your exact card as many cards you the same chipsets). Unpack the Windows driver with unzip/cabextract/unshield tools and find the INF file (.INF or .inf extension) and the SYS file (.SYS or .sys extension). (this is important as some drivers have a connection with the .sys file which makes the driver work properly) If there are multiple INF/SYS files, you may look in the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/list List] if there are any hints about which of them should be used. Make sure the INF file, SYS file and any BIN files for example, TI drivers use BIN firmware files are all in one directory on your harddrive.
The above statement is pulled from the ndiswrapper wiki site. Your drivers from your cd may work and you can try them, it's not hard to remove and try a different driver. It might save you some time searching to find someone who has verified a driver and provide a download site.
2.2.1. ndisgtk instructions
If you chose the ndisgtk route, after install, click on System > Admin > Windows wireless drivers and follow through the prompts.
(assuming the driver is in a directory in your home folder called drivers)
attachment:IconsPage/IconExample48.png Try a different driver such as the drivers for win2k or another driver matching the pciid on the [http://ndiswrapper.sourceforge.net/mediawiki/index.php/List ndiswrapper list] Look for additional help at [http://www.ubuntuforums.org the Ubuntu Forums].
With no errors given you can go to the networking tool
and add the word ndiswrapper to the end of this file and save. This error is usually given when ndiswrapper is compiled and installed. You have a bad installation or you didn't remove the module that came with ubuntu. Need to uninstall ndiswrapper and make sure you remove the ndiswrapper module that came with ubuntu. Uninstall instructions can be found [http://ndiswrapper.sourceforge.net/mediawiki/index.php/Uninstall here]
Can't get driver.inf file to install - Sometimes ndiswrapper is used prematuerly. There may be a native driver that comes with Ubuntu that's taking the primary driver position and conflicting with ndiswrapper. For more about this go to the wiki:WirelessTroubleshootingGuide:WirelessTroubleshootingGuide and the step on device drivers.
This HOWTO is based on ndiswrapper [http://ndiswrapper.sourceforge.net/mediawiki/index.php/InstallDebian Wiki Page] This was copied from the forums, page found [http://ubuntuforums.org/showthread.php?p=601226 here]. You can discuss any problems or errors there.
You will find the current version of ndiswrapper [http://sourceforge.net/project/showfiles.php?group_id=93482 here].
Move to the file where you downloaded the file and run these commands. On the second command replace [current version] with the actual version of the file you downloaded.
You're comfortable editing files and working with badly-written HOWTOs.
attachment:IconsPage/IconExample48.png attachment:IconsPage/IconExample48.png attachment:IconsPage/IconExample48.png You also have to specify scan_ssid=1, which means this router does not broadcast. attachment:IconsPage/IconExample48.png Enjoy using your network securely
[http://ndiswrapper.sourceforge.net/mediawiki/index.php/Main_Page ndiswrapper wiki] [https://wiki.ubuntu.com/HowtoUseNdiswrapperOnAmd64Ubuntu?highlight=%28ndiswrapper%29 Ndiswrapper on amd64 box] wiki:WifiDocs/WifiDocs Some screen shots of ndisgtk can be found [http://lxer.com/module/newswire/view/46385/ here].
2.2.2. Command line instructions
2.2.2.1. Install the windows driver
sudo ndiswrapper -i ~/drivers/{driver}.inf
2.2.2.2. checking to make sure it installed correctly.
ndiswrapper -l
If this is installed correctly you should see: Installed ndis drivers:
{name of driver} driver present, hardware present
If you do NOT see this message. 2.2.2.3. loading the new module.
System > Administration > Networking and configure your device, or try the command ifconfig. Your wireless card should now appear with an interface name of wlan0. If it doesn't appear here then the driver is not working properly. sudo depmod -a
then: sudo modprobe ndiswrapper
2.2.3. automatically load at boot-time
sudo ndiswrapper -m
which will add the proper line to the /etc/modules file or you can add it manually by opening the file with this command: sudo gedit /etc/modules
3. Troubleshooting
3.1. Some common errors
file not found 4. Compile latest version of ndiswrapper
sudo modprobe -r ndiswrapper
sudo apt-get --purge remove ndiswrapper-utils
sudo rm -r /etc/ndiswrapper/
sudo rm -r /etc/modprobe.d/ndiswrapper
sudo rm /lib/modules/`uname -r`/kernel/drivers/net/ndiswrapper/ndiswrapper.ko
4.1. Install kernel headers:
sudo apt-get install linux-headers-$(uname -r)
and dependencies: sudo apt-get install dh-make fakeroot gcc-3.4 build-essential
4.2. Download the current version
4.3. Untar
tar xvfz ndiswrapper-[current version].tar.gz
cd ndiswrapper-[current version]
4.4. Build deb packages:
fakeroot debian/rules binary-modules
fakeroot debian/rules binary-utils
cd ..
4.5. Install
sudo dpkg -i ndiswrapper-modules-[your kernel]_[current version]-1_i386.deb ndiswrapper-utils_[current version]-1_i386.deb
Now go back to the [#install install] section to set up and use your newly installed ndiswrapper package. 5. WPA setup
5.1. Pre-amble
5.2. Assumptions
5.3. The procedure
sudo killall wpasupplicant
sudo dpkg --purge wpasupplicant
Now install a fresh copy: sudo apt-get install wpasupplicant
If you compiled and installed a newer version of ndiswrapper then it's possible you will need to compile and install a newer version of wpasupplicant.
sudo vi /etc/default/wpasupplicant
# /etc/default/wpasupplicant
# WARNING! Make sure you have a configuration file!
ENABLED=1
# Useful flags:
# -D <driver> Wireless Driver
# -i <ifname> Interface (required, unless specified in config)
# -c <config file> Configuration file
# -d Debugging (-dd for more)
# -w Wait for interface to come up
# OPTIONS="-w"
Save and exit. Next, you'll need to sort your pre-shared key out. My router allows me to input the passphrase that makes up the key itself; I originally tried putting this passphrase in as the wireless key, which failed to work altogether for fairly obvious reasons. Hindsight is wonderful like that. Take the passphrase that you used in your router or WAP and use wpa_passphrase to generate the key. You use this command in the following format: wpa_passphrase <ssid> <passphrase>
So the command I ran looks something like this: wpa_passphrase MyHomeWireless SuperSecretPassphrase
network={
ssid="MyHomeWireless"
#psk="SuperSecretPassphrase"
psk=e42ac2538ef03f906d37332a0df4446150e04cdcdd392e 309486075065a70a1f
}
Copy all that - we'll need in a moment. You now need to put that in to a configuration file for wpa_supplicant, which you first need to create. Given that you'll have the keys to your wireless access in this file, a little extra precaution is in order. Use the following commands to create and then open the file for editing: sudo touch /etc/wpa_supplicant.conf
sudo chmod 600 /etc/wpa_supplicant.conf
sudo vi /etc/wpa_supplicant.conf
network={
ssid="MyHomeWireless"
#psk="SuperSecretPassphrase"
psk=e42ac2538ef03f906d37332a0df4446150e04cdcdd392e 309486075065a70a1f
key_mgmt=WPA-PSK
proto=WPA
}
Save and exit. You should probably test this now - here's a good command to copy/paste to your cli (this will only work if you fulfill the assumptions of this HOWTO): sudo ifconfig wlan0 up && sudo /usr/sbin/wpa_supplicant -Bw -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf && sudo dhclient wlan0
If that doesn't get you to the point where you can ping other hosts on your network, something is most likely wrong with wpa_supplicant (I'm assuming that it hasn't got anything to do with DHCP). Run these two commands: sudo dhclient -r wlan0 && sudo ifconfig wlan0 down && sudo killall wpa_supplicant
sudo ifconfig wlan0 up && sudo /usr/sbin/wpa_supplicant -w -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf -dd
This will give you a bunch of debugging output, and someone who is much more skilled than I might be able to help you out. Sorry, but this HOWTO isn't going to help you much more, as it's beyond my ken completely. If you got lucky and you -are- able to ping hosts on your network, now is the time to automate it. It's actually really easy. Run this command first to bring the wireless link down cleanly: sudo dhclient -r wlan0 && sudo ifconfig wlan0 down && sudo killall wpa_supplicant
You need to tell your network interface configuration file how to deal with the wireless config nicely; here's what you need to put in for your wireless card (again, if you don't completely fulfill the assumptions of this HOWTO, you'll need to change a few things). Open up /etc/network/interfaces: sudo vi /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
pre-up /usr/sbin/wpa_supplicant -Bw -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant
Save and exit. We're all done! Wireless will now come up on boot (assuming that your computer already detects the card and loads the drivers for it already), and you can start/stop the wireless link with the following two commands: sudo ifup wlan0
sudo ifdown wlan0
5.4. If your router does not broadcast the SSID
ap_scan=2
This means, don't bother scanning (since it's not broadcasting anyway right), use the first network block. Since your router isn't broadcasting, you have to add some more detail about the encryption, in particular whether it's TKIP or CCMP(also known as AES). network={
ssid="myrouterssid"
scan_ssid=1
psk="topsecret"
key_mgmt=WPA-PSK
proto=WPA
auth_alg=OPEN
pairwise=TKIP
group=TKIP
}
6. links
WifiDocs/Driver/Ndiswrapper (last edited 2008-08-06 16:19:19 by localhost)