Install wireless NICs in Centos for wireless Internet access

Source: Internet
Author: User

Why wireless networks?

Because wireless networks are easy to use, we don't have to use messy Network cables to access the Internet. Now wireless networks are widely used, especially in areas where cabling is not convenient (mountainous areas, rivers, airports, cross-road areas, airports, factory workshops, etc.), it is even more prevalent.

I recently installed my computer into a linux operating system to play with linux. Because I didn't do my homework before, after I installed the system, I was crying, I found that my computer could not use wireless Internet access from our dormitory. After searching for the Internet for a long time, I found that the wireless network card integrated with my computer did not support linux drivers. But I didn't want to switch back to the original system, so I bought a usb wireless NIC (I bought it with a linux driver ). Then I can't wait to try to install the driver. After several attempts, I finally succeeded. Here I will share with you some tips.

My Wireless Network Card model is: Realtek 8176

The linux driver package is RTL8192xC_USB_linux_v3.4.4_4749.20121105.

Of course, if you do not know the type of your usb wireless network card, you can insert it into your linux host. After the system recognizes it, you can view the model of your wireless network card through lsusb, you can find the corresponding driver online based on the model. Is this command very useful!


The following is the detailed installation process. You can check it carefully!

To install the driver, you have to get the driver package to your computer. Needless to say, the big guy knows it is not:


Next, use unzip to decompress the driver package to the current directory. After decompression, enter the decompressed directory:


First, install the driver and go to the driver directory:


We found that all these are source code. We need to disassemble them into the/usr/local/src directory:

Tar-zxvf rtl8188C_8192C_usb_linux_v3.4.4_4749.20121105.tar.gz-C/usr/local/src/

Then go to the decompressed directory:


Make and make install to generate the linux module (note that all drivers in linux exist in the form of modules)


Generally, the Linux kernel automatically loads the newly installed modules. I found that the modules are not loaded. Why? The reason is that, after the system re-installs the driver module, the system usually loads it after the restart. If it cannot be loaded, run the following command: you do not need to specify the path for insmod + specific paths and modules or directly using modprobe.

After restarting, let's see if the system can automatically load modules:


However, to complete the correspondence between the nic and the module, we must modify the/etc/modprobe. conf file. Otherwise, the NIC cannot obtain the IP address:


Once the module is loaded, the NIC is driven. We can use ifconfig to check whether wlan0 is displayed:

Use ifconfig-a to view the information:

Why? Ifconfig is used to view all activated NICs and ifconfig-a. In this case, you only need to activate wlan 0:

However, at this time, wlan 0 still cannot get the IP address, because it also needs to scan the wireless network and connect to the wireless network tool, we enter the wireless_tools directory under the RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105 directory:

We split the package to the/usr/local/src directory again.

Tar-zxvf wireless_tools.30.rtl.tar.gz-C/usr/local/src:

Then execute make and make install:

Go to the/usr/local/sbin directory:

Then we use iwlist to list the surrounding wireless networks:


Of course, it is useless to search for wireless networks. Because these wireless networks are encrypted, we must use a verification tool to verify the key. Next we will go to the wpa_supplicant_hostapd directory of tracing:

We use unzipto decompress wpa_supplicant-0.6.9_wps_patch_20100201_1.zip to the current directory:

Go to the wpa_supplicant-0.6.9/wpa_supplicant directory:


Run make and make install

Go to the/usr/local/sbin directory:

Now, we can connect to our wireless network:

To ensure security, we need to delete the plaintext Password


Now, our driver modules and key files have been formed, and now we are connected to the wireless network:

Wpa_supplicant-I wlan0-c/etc/wpa_supplicant/wpa_supplicant.conf-D wext-B

Meaning of each parameter:-I indicates the connected Nic

-C indicates the storage location of the key file

-D indicates that the driver type is General

-B is run in the background.

We use iwconfig to view the connection status of the wireless network adapter:


To enable wlan0 to dynamically obtain the ip address, we need to enter the location where the/etc/sysconfig/network-scripts/NIC file is stored to generate the wlan0 Nic file (ifcfg-wlan0 ):

Restart the network service.


Let's see if wlan0 can successfully obtain the IP Address:


However, this step is not enough, because as long as our machine restarts, We have to re-Execute

Wpa_supplicant-I wlan0-c/etc/wpa_supplicant/wpa_supplicant.conf-D wext-B

And the service network restart commands are very troublesome! But what is the solution? When I was troubleshooting the system kernel, I also told you about the system boot process. When the system is started, we need to initialize the system and execute the initialization script, the initialization script is/etc/rc. d/rc. local. To meet our requirements, we can execute the above two commands during system initialization:

Next, let's see if our environment variables are added to the/usr/local/sbin directory. Otherwise, the system will not be able to identify our wpa_supplicant command. Echo "$ PATH ":

Now we can easily use wireless Internet access!

This article from the "night wind" blog, please be sure to keep this source http://jiangkun08.blog.51cto.com/6266992/1284327

Related Article

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.