Change Network Device Name Permanently – RedHat
Device Naming
Device name management is handled by udev system. When Linux kernel discovers a new device (e.g., a network interface card) added to the system, it notifies udev daemon of the device event. The udev daemon will then match various device attributes against a set of rules to identify the device, name it, and store its information in udev database.
In case of network devices, udev relies on MAC addresses to assign persistent names to the devices. The MAC address based naming rules are stored in “/etc/udev/rules.d/70-persistent-net.rules”.
How can change it?
You need to edit or create “/etc/udev/rules.d/70-persistent-net.rules” file for network device naming.
run the below command:
vi /etc/udev/rules.d/70-persistent-net.rules
The file is like the below:
# This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key. # PCI device 0x15ad:0x07b0 (vmxnet3) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3b:a1:70", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x10fb (ixgbe) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:ac:38:84", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
Change device name to another name, like this:
# This file was automatically generated by the /lib/udev/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key. # PCI device 0x15ad:0x07b0 (vmxnet3) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3b:a1:70", ATTR{type}=="1", KERNEL=="eth*", NAME="eth20" # PCI device 0x8086:0x10fb (ixgbe) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="90:e2:ba:ac:38:84", ATTR{type}=="1", KERNEL=="eth*", NAME="eth21"
Then, rename your interfaces configuration files in “/etc/sysconfig/network-script/”.
Also you need to update MAC addresses in the configuration files.