Home > Article > Operation and Maintenance > How to solve the problem of being unable to access the Internet after cloning a CentOS virtual machine
How to solve the problem of being unable to access the Internet after cloning a CentOS virtual machine?
1. Problem Description
After cloning the CentOS virtual machine, due to inconsistent network card information, the Internet cannot be accessed or the "sercice network restart" command fails
[root@linuxidc 桌面]# ifconfig //查看当前网卡信息 [root@linuxidc 桌面]# cd /etc/sysconfig/network-scripts //进入网卡配置文件目录[root@linuxidc network-scripts]# ls //查看网卡配置文件中的网卡信息
2. Cause analysis
Due to the cloned system, the system only modified the name and MAC of the virtual machine, etc., and in / A line of device name named eth1 is added to the etc/udev/rules.d/70-persistent-net.rules file
3. Solution
1. Modify the files /etc/udev/rules.d/70-persistent-net.rules and /etc/sysconfig/network-scripts/ifcfg-eth0
to make two The device name in the file corresponds to the MAC address
[root@linuxidc ~]# gedit /etc/udev/rules.d/70-persistent-net.rules /etc/sysconfig/network-scripts/ifcfg-eth0
2. Save after modification, then restart the virtual machine and check the network card information again , found to be normal
Related reference:centOS tutorial
The above is the detailed content of How to solve the problem of being unable to access the Internet after cloning a CentOS virtual machine. For more information, please follow other related articles on the PHP Chinese website!