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
ifconfig
can 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.lo
eth0
ifcfg-eth0
By
lspci | grep -i ethernet
finding 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
gcc
compiler 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 ispackage
to extract the packages required for gcc installation from the folder of the mirror filerpm
, 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 localyum
source and use theyum install
installation.In addition to the compiler, you also need to install the kernel source code,
rpm -qa | grep kernel
view it through the command, and download it if not. Enter the downloaded driver directory and install the driver through themake
andmake install
command. Different network card drivers will have some different operations. Just read the corresponding documents or tutorials. After installing the driver, restart the network service, andifconfig
you can seeeth0
that the problem is solved.