This method is used to solve the problem where the new Nic is changed to eth1 and the source Nic name is eth0, which cannot be used by the new Nic. It can also be used to rename a nic.
After the nic mac address is changed, find the NIC in Linux. The new NIC will be identified as eth1 or written to/etc/udev/rules. in the D/70-persistent-net.rules file, modify/etc/udev/rules. in the D/70-persistent-net.rules file, modify the MAC address of eth0 to the changed address.
First back up the file
/Etc/udev/rules. d/70-persistent-net.rules
1 cp /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistent-net.rules_backup
Then modify the file
1 gedit /etc/udev/rules.d/70-persistent-net.rules
# This file maintains persistent names for network interfaces.
# See udev (7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# File; however you are also free to add your own entries.
# PCI device 0x14e4: 0x1713 (tg3)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 1E: EC: 0f: 79: F
6 ", ATTR {type }==" 1 ", kernel =" ETH * ", name =" eth0"
# PCI device 0x8086: 0x4222 (iwl3945)
Subsystem = "Net", Action = "add", drivers = "? * ", ATTR {address} =" 00: 1f: 3C: 48: 70: B
1 ", ATTR {type }==" 1 ", kernel =" WLAN * ", name =" wlan0"
Change eth0 to eth1. If you need to delete unused Nic devices. Save and restart the system.