Since the latest major version release of CentOS/RHEL 7, it seem that we wen’t a bit crazy about the whole systemd thing…
Seriously, having a network interface named “eno16780032” isn’t that great! Fortunately, there is a a way of getting back the old naming convention by following these steps :
1. Edit the Grub configuration file :
1 |
/etc/default/grub |
2. Locate the line “GRUB_CMDLINE_LINUX=” and append the following parameter :
1 |
net.ifnames=0 biosdevname=0 |
Example :
1 |
GRUB_CMDLINE_LINUX="crashkernel=auto net.ifnames=0 biosdevname=0" |
3. Rebuild the Grub configuration :
For BIOS:
1 |
grub2-mkconfig -o /boot/grub2/grub.cfg |
For EFI:
1 |
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg |
4. Copy the network configuration file, matching the new interface name :
1 |
cp -p /etc/sysconfig/network-scripts/ifcfg-<ifname> /etc/sysconfig/network-scripts/ifcfg-<new-ifname> |
Example, assuming your interface name is “ens192” and the new interface name “eth0” :
1 |
cp -p /etc/sysconfig/network-scripts/ifcfg-ens192 /etc/sysconfig/network-scripts/ifcfg-eth0 |
5. Edit the net interface configuration :
1 |
/etc/sysconfig/network-scripts/ifcfg-eth0 |
Change the following values from the old to the new interface name :
1 2 |
NAME= DEVICE= |
You may now reboot your system.