0. previous words: problems that have been plagued for a long time often occur before this problem, but because we cannot find a solution, we can only try to reinstall a new operating system, it is a waste of time, but it is barely solved. But it is always not good to solve the problem. after various searches and inquiries, I found the following very good solution. after testing, this method can perfectly solve this problem.
0. Previous words: long-standing problems
These problems often occur before, but because we cannot find a solution, we can only try to install a new operating system by ourselves, although it is a waste of time, but it cannot be solved.
However, it is always difficult to solve the problem. after various searches and inquiries, I found the following very good solution. after testing, this solution can solve the problem perfectly.
1. cause: the Nic cannot be configured after Centos is cloned.
Multiple Linux operating systems are often used in the experiment environment. to avoid the waiting time for re-installation, we generally clone the operating system, however, the cloned operating system cannot start the NIC, as shown in the following figure:
If the Nic cannot be started, network connection becomes a problem, but the Linux operating system without network connection is very troublesome for O & M testing. What should I do?
2. Problem Analysis: Why the Nic cannot be started
The problem lies in/etc/udev/rules. the file d/70-persistent-net.rules is bound to the NIC and mac address. that is to say, the cloned operating system is the same as the original operating system, however, the cloned operating system changes the MAC address of the NIC because of the NIC. in this case,The NIC and MAC address of our operating system are different from those bound in/etc/udev/rules. d/70-persistent-net.rules.So the Nic cannot be started.
3. Solution: delete the file bound to the NIC
Since the above mentioned file is bound with the previous Nic and MAC address, and cannot match the current NIC and MAC address, the NIC cannot be started, we can delete this file:
1 |
[root@xpleaf ~]# rm /etc/udev/rules.d/ 70 -persistent-net.rules |
After deletion, restart the system. The system will automatically generate a new configuration file bound to the current NIC and MAC address. in this way, our Nic can be started.
Of course, you can also manually modify the above file by yourself in addition to the method that seems to be a little extreme when using the delete method. However, it is much more troublesome than the delete method!