Problem recovery:
Enter the ifconfig command in the terminal and find that only one lo loopback network interface can be seen, and there is no eth0 network card. After analysis, it was determined that there is no corresponding network card driver.
Solution:
1. Execute the following command to find your own network card driver (Ethernet controller), then find the corresponding driver online and download the source code.
lspci | grep -i ethernet
The source code is written in C. At this time, the system does not have a gcc compiler, and it cannot be downloaded online. At this time, you need to use the iso image used during CentOS installation. The installation image contains gcc. .
2. One method is to extract the rpm packages required for gcc installation from the package folder of the image file, and then install them one by one in a certain order through the rpm command, thereby successfully installing gcc; the other is Use the iso image to create a local yum source and use the yum install command to install it.
3. In addition to the compiler, you also need to install the kernel source code. Check it through the following command. If not, you need to download it.
rpm -qa | grep kernel
Enter the downloaded driver directory and use the make and make install commands to install the driver.
After installing the driver and restarting the network service, you can see that eth0 appears through the ifconfig command, and the problem is solved.
Recommended tutorial: centos tutorial
The above is the detailed content of What should I do if centos does not recognize the network card?. For more information, please follow other related articles on the PHP Chinese website!