Solve the problem that CentOS does not recognize the network card

When Lenovo computer installed CentOS 6.9 system, there was a problem of not being able to access the Internet, so I recorded the pits along the way.

During CentOS installation, there is a Configure Network button under the step of setting the hostname , but this button is invalid at this time. After entering the system, it is found that there is no network connection.

  • Enter the command in the terminal and find that only one loopback network interface ifconfigcan be seen , and there is no network card. At this time, according to the online tutorial, manually create a file and write the network configuration information. It is found that the problem cannot be solved, and the network card device cannot be found. After analysis, it is determined that there is no corresponding network card driver.loeth0ifcfg-eth0

  • By lspci | grep -i ethernetfinding your own network card driver (Ethernet controller), and then finding the corresponding driver on the Internet, download the source code.

  • The source code is written in C, and the system does not have a gcccompiler at this time, and it cannot be downloaded from the Internet. At this time, you need to use the iso image used in the installation of CentOS, and there is gcc in the installation image. One method is packageto extract the packages required for gcc installation from the folder of the mirror file rpm, and then install them one by one in a certain order through the rpm command, so as to successfully install gcc; the other is to use the iso image to make a local yumsource and use the yum installinstallation.

  • In addition to the compiler, you also need to install the kernel source code, rpm -qa | grep kernelview it through the command, and download it if not. Enter the downloaded driver directory and install the driver through the makeand make installcommand. Different network card drivers will have some different operations. Just read the corresponding documents or tutorials. After installing the driver, restart the network service, and ifconfigyou can see eth0that the problem is solved.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325935430&siteId=291194637