In Linux, how does one change the network adapter eth1 to eth0?
Normally, eth0 and eth1. Sometimes, when we use the VM cloning technology, the NIC information changes, and the name of the new VM Nic may change to eth1. no matter how we modify it, this has plagued us with the use of N virtual machines for the HA-heartbeat experiment.
This is because an Eni has been identified as eth0 in/etc/udev/rules. d/70-persistent-net.rules and eth1 in the virtual machine.
Solution:
1. edit/etc/udev/rules. d/70-persistent-net.rules, find the same line of MAC as ifconfig-a (NAME = 'eth1'), and change it to "NAME = eth0 ", delete the above line (NAME = 'eth0.
Vim/etc/udev/rules. d/70-persistent-net.rules
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: bb: 41: 2b ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0"
2. edit/etc/sysconfig/network-script/ifcfg-eth0, change MAC to correct, delete UUID.
3. edit/etc/sysconf/network and change the hostname.
4. the restart takes effect!
This article permanently updates the link address: