CentOS Wired connection failure Solution
By: Ailson Jack
Date: 2014.04.21
Note: This article references relevant online materials and has passed my own attempts.
If your computer cannot access the Internet through wired connection after CentOS is installed, run the following command:
Lspci|Grep-I eth
My terminal displays the following results:. 0 Ethernet controller: Qualcomm Atheros AR8161 Gigabit Ethernet (rev 08)
Run the following command:Ifconfg
The connection displayed on the terminal does not contain eth0 or ethx (x represents 1 ~......) Related information,
If your computer terminal displays a similar appeal, you don't have to worry about it. This is because the NIC driver is not installed. Well, let me share my solution:
Note: The NIC of my computer is Atheros AR8161. Maybe your computer is not. Please download the driver related to you, but the installation methods are similar!
I am here to install Atheros AR8161.
First, you must prepare the NIC Driver related to your computer.
1. Download The Atheros AR8161 driver. The URL below is
Http://pan.baidu.com/s/1gd3hNvd
After the download, extract, decompress the Directory: alx-linux-v2.0.0.6
2. By default, gcc is not installed on CentOS. You can execute:Gcc
If the terminal displays:Bash: gcc: comman not found
So it indicates that your computer has not installed gcc. At this time, execute the following command to install gcc
Run the following command:Yum install gcc
Wait until the gcc installation is complete.
3. Install kernel-headers and kernel-devel:
Run the following command on the terminal:
Yum install kernel-headers-$ (uname-r) kernel-devel-$ (uname-r)-y
4. Switch the path under the terminal to the decompressed file, and switch the path to the folder.Alx-linux-v2.0.0.6Inside
Run the following command:Cd./src/
Run the following command:MakeIn this case, an alx. ko file is generated in the src folder.
Run the following command:Mkdir/lib/modules/2.6.32-358.6.2.el6.x86 _ 64/kernel/net/wiredYou do not need to press the "complete" button. You only need to find your own kernel directory. This step only creates a wired directory. Therefore, you can use the "TAB" key to complete the configuration, it is very important to find your own directory.
5. Copy alx. ko to the folder created in the previous step.
Run the following command:Vi/lib/modules/2.6.32-358.6.2.el6.x86 _ 64/modules. networkingYou do not need to press the "complete" button. You only need to find your own kernel directory. It is very important to find your own directory.
Add alx. ko to the first line of modules. networking, for example:
6. Run the following command:Vi/etc/sysconfig/modules/alx. modules
Add the following content to alx. modules:
#! /Bin/sh
If [! -C/dev/input/alx. ko]; then
Exec/sbin/modprobe alx>/dev/null 2> & 1
Fi
7. Execute other commands:
First, run the following command:Depmod-
Run the following command:Modprobe alx
Now, the NIC driver installation is complete. Check whether your network is connected. What if my network is connected? ^_^
Note: Please indicate the source for reprinting. Thank you! Pai_^