How to change a network interface name on CentOS/RHEL 7
Linux network interfaces are commonly named eth0, eth1, … ethx. These names do not describe the interface hardware, so they do not tell us what kind of hardware eth0 or eth1 is. Network interface naming rules were introduced to assign names based on firmware, topology, and location information. CentOS/RHEL 6 introduced these naming rules but did not enable them by default. CentOS/RHEL 7 enables them by default, so we see unfamiliar interface names instead of eth0, eth1, and so on. The new naming rules are:
-
The first two characters indicate the interface type.
en -- ethernet sl -- serial line IP (slip) wl -- wlan ww -- wwan -
The remaining characters have the following meanings:
b<number> -- BCMA bus core number ccw<name> -- CCW bus group name o<index> -- on-board device index number s<slot>[f<function>][d<dev_port>] -- hotplug slot index number x<MAC> -- MAC address [P<domain>]p<bus>s<slot>[f<function>][d<dev_port>] -- PCI geographical location [P<domain>]p<bus>s<slot>[f<function>][u<port>][..]1[i<interface>] -- USB port number chain
Example network interface name: eno16777736 means onboard Ethernet whose device index provided by firmware (BIOS/EFI) is 16777736. View more information about the network interface:
udevadm info --name=/dev/eno16777736 --attribute-walk
To change network interface names back to ethx:
Method 1 Edit /etc/default/grub and add:
net.ifnames=0
Method 2 Disable the naming rules by creating a symbolic link to /dev/null.
ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules