How to Set up a wireless NIC Driver in Linux

Source: Internet
Author: User

Recently, I went to Zhongguancun to buy a laptop. I am used to using Linux, but the built-in PCI wireless Nic has no driver in Linux, so it is essentially a virtual machine. This makes me very embarrassed, so I studied how to set up a wireless NIC Driver in Linux. After reading this article, you will learn to set up a wireless NIC Driver in Linux.

I found the NdisWrapper Software Project (http://ndiswrapper.sourceforge.net) online ). This project does not write a Linux driver, but uses a kernel module to call the Ndis driver in Windows, which cleverly solves the problem that these wireless NICs do not have a Linux driver. The project currently supports Wireless network adapters including Admtek 8211, Atheros AR5004, Broadcom 4301, Broadcom 4309, Broadcom 94306, InProcomm IPN2120, and Intel PRO/Wireless Lan 2100.
The author's network adapter is Intel PRO/Wireless Lan 2100. the Linux installation version is SuSE 9.0 Professional and the kernel version is 2.4.21-166, use NdisWrapper of version 0.3 (the current version of the software is version 0.4 and requires Kernel support of version 2.6 or later ). Although the software provides a very detailed document, the complete installation instructions are provided here because of some problems in the installation process. The following commands are executed as root.

1. To http://prdownloads.sourceforge.net/ndiswrapper/ndiswrapper-0.3.tar.gz? Downloaddownload the ndiswrapper-0.3.tar.gz file.

2. decompress the file. The ndiswrapper directory is generated in the current directory. The command is as follows:
# Tar zxvf ndiswrapper-0.3.tar.gz

3. Go to the ndiswrapper directory, edit the driver/Makefile file, and add the following statement:
CFLAGS + = $ (shell [-f/lib/modules/$ (shell uname-r)/build/include/linux/modversions. h] & echo-DEXPORT_SYMTAB-DMODVERSIONS-include/lib/modules/$ (shell uname-r)/build/include/linux/modversions. h)
If the preceding statement is not added, the following error occurs when you run the "depmod-a" command:
Depmod: *** Unresolved symbols in/lib/modules/2.4.21-166-default/misc/ndiswrapper. o

4. Use the "make" command to compile ndiswrapper.

5. To begin.

6. Create the/usr/local/share/ndiswrapper directory and copy the. sys and. inf files to the new directory. The command is as follows:
# Mkdir/usr/local/share/ndiswrapper
# Cp w70n51. sys w70n51. inf/usr/local/share/ndiswrapper

7. Find the Vendor ID and Device ID of the wireless network adapter. The procedure is as follows:
(1) run the "lspci | grep 2100" command. The result is as follows. 0: 02. 0 indicates the pci id of the wireless network adapter:
. 0 Network controller: Intel Corp. PRO/Wireless LAN 2100 3B Mini PCI Adapter (rev 04)
(2) run the "lspci-n | grep. 0" command based on the pci id to find the Vendor ID and Device ID of the wireless network adapter. The result is as follows:
. 0 Class 0280: 8086: 1043 (rev 04)
We can see from the above that the Vendor ID corresponding to the wireless network card is 8086, and the Device ID is 1043.

8. Use the "insmod driver/ndiswrapper. o" command to call the kernel module.

9. Call the Windows Driver of the wireless network card. The command is as follows:
# Utils/loaddriver
In the above Code, it is the Vendor ID of the wireless network adapter, the Device ID, the full path of the sys file in the Windows Driver, and the full path of the inf file. Run the following command. If no error occurs, the wireless network card light will be on:
# Utils/loaddriver 8086 2043/usr/local/share/ndiswrapper/w70n51. sys/usr/local/share/ndiswrapper/w70n51. inf

10. To set up a wireless network, follow these steps:

(1) run the "iwconfig" command to display information about the wireless network adapter (eth0, eth1, or eth2. In the following steps, use ethX to indicate the name of the wireless network adapter.
(2) set the operation mode of the wireless network card to Managed. The command is as follows:
# Iwconfig ethX mode Managed
(3) If WEP encryption is used, you need to set the WEP password. The command is as follows:
# Iwconfig ethX key password
Encrypt 40-bit and 128-bit passwords with 6-bit and 10-bit hexadecimal numbers.
(4) set the SSID, where ESSID is the SSID of Access Point. The command is as follows:
# Iwconfig ethX essid ESSID
(5) Create the/etc/sysconfig/network/ifcfg-ethX file so that the wireless network adapter automatically obtains the IP address each time the machine starts. The file content is as follows:
BOOTPROTO = 'dhcp'
MTU =''
REMOTE_IPADDR =''
STARTMODE = 'onboot'
UNIQUE =''

11. Run the following command to start the wireless network adapter:
# Ifconfig ethX up

12. Finally, automate the above configuration to enable the wireless Nic automatically upon startup. Perform the following steps:
(1) Use the following command to copy the ndiswrapper. o file to the kernel module directory of the system:
# Cp driver/ndiswrapper. * o/lib/modules/$ (uname-r)/misc
(2) run the "depmod-a" command to update the module information of the system.
(3) copy the loaddriver file to a directory (for example,/usr/local/bin. The command is as follows:
# Cp utils/loaddriver/usr/local/bin
(4) copy the inf and sys files to a directory (for example,/usr/local/share/ndiswrapper. Command: # cp bcmwl5.sys bcmwl5.inf/usr/local/share/ndiswrapper
(5) use the following command to create an alias for the wireless network card:
# Alias ethX = ndiswrapper
(6) modify the/etc/modprobe. conf file and add the following statement to automatically call NdisWrapper at startup:
Post-install ethX/usr/local/bin/loaddriver 8086 1043/usr/local/share/ndiswrapper/*. sys/usr/local/share/ndiswrapper/*. inf

So far, the entire configuration is complete. Each time you enter Linux, the wireless network card will be activated and the IP address will be automatically obtained. In this way, you can set the Windows driver for the wireless network card in Linux to freely use the wireless network of the Centrino notebook. I hope this article will help you learn how to set up a wireless NIC Driver in Linux.

  1. Details about Suse YaST
  2. Good migration and bad migration on the Open Suse Linux platform
  3. Operation notes: suse faq modify XWindows resolution
  4. DWL and G122 driver modules for wireless NICs in Suse
  5. Do not hesitate: Suse Linux Enterprise Server 10

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.