In daily work or experiment, we often need to clone or migrate the virtual machine. After the migration, we must first set the virtual machine's network card to connect the virtual machine to the virtual machine. After migrating a Linux virtual machine, you will find that there is no more eth0 under the system, but it becomes eth1. After you restart the network service, you will be prompted to find the startup scripts for devices eth0 and eth1. Therefore, how to modify the network card after migrating the Linux virtual machine is very important.
First, why the network card name changes after migration
1.1. After you clone or migrate the Linux virtual machine, use ifconfig –a to view the network card information, you will find that only eth1, no eth0. Many Linux distributions use udev to dynamically manage device files and persist them based on device information. Udev will identify the network card during the system boot process, and record the mac address and the network card name in the udb rule script. For a new virtual machine, VMware will automatically generate a MAC address for the virtual machine's network card. When you clone or reinstall the virtual machine software, because you are using the information of the previous system virtual hard disk, and the system already has eth0 Information, for this new network card, udev will automatically name it eth1 (the principle of accumulation), so after your system starts, the network card you see using ifconfig is named eth1.
Second, how to modify the network card to obtain the network normally
2.1. View the network connection mode adopted by the virtual machine and the IP network segment allocated by the mode 2.2. Enter the directory /etc/sysconfig/network-scripts, you will find that Ifcfg-eth0 configuration file, if you directly modify the IP of the network segment, and then restart the network service, you will be prompted to report an error, eth0 the network card does not exist 2.3. Use ifconfig – a command to view, only eth1 network card information, then You can directly change eth0 to eth1, and change the MAC address to the MAC address of eth1. Then restart the network service eth1 to obtain the IP
. 3. How to change eth1 back to the original eth0
3.1. Modify the eth0 configuration file first. The MAC address is eth1's MAC address 3.2. Then enter the /etc/udev/rule.d/directory, open the 70-persistent-net.rules file, delete the eth0 information, and rename eth1 to eth0 3.3. Restart the computer
After using the ifconfig command to view eth0 correctly get the address, you can also connect normally through CRT
Engaged in two years WindowsClient development, what multi-threading, multi-process development, ha
Microsoft announced the extension of the Windows Vista and Windows 7 lifecycle. The life cycle of W
When a person is operating under Linux, they may encounter that the file they are doing is accident
The Linux command line is useful, efficient, and fun, but sometimes dangerous, especially if you are
Linux server timer processing to pay attention to the problem
How to open telnet function in Linux?
How to do disk space shortage, linux disk cleaning method
10 important Linux ps commands are actually
Cygwin supports Chinese configuration
Play World of Warcraft with Wine under Ubuntu Linux
The correct way to execute PHP programs with crontab under Linux
Linux ends with a keyword process (batch kill process method)
Windows 8.1 separately adjusts support for split screen resolution
Windows 8 Build 7955 new features summary
Let Win XP system "return to life" coup
Windows system slows down the reason
Win7 system how to close the upgrade win10 prompt message
What can I do if I can't use Alipay under windows10?
How to set up win10 Notepad automatically wrap? Win10 Notepad set the method of automatic line break
Win8.1 system prompts error 651 how to do
The most important 70 tips and tricks for Windows 7 (4)
How to adjust the mouse sensitivity of win7 Ultimate computer