Wednesday, 20 February 2019

How to disable consistent network device naming in CentOS 7



Step 1: Insert the following line in grub configuration file /etc/default/grub:

[root@linuxcnf ~]# echo 'GRUB_CMDLINE_LINUX=" net.ifnames=0 biosdevname=0"' >>/etc/default/grub

Step 2: Rebuild the Grub configuration:

[root@linuxcnf ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-223dd08ba49a4f0f930dc92fb8fb4504
Found initrd image: /boot/initramfs-0-rescue-223dd08ba49a4f0f930dc92fb8fb4504.img
Done
[root@linuxcnf ~]#

Step 3: Copy the network configuration file with matching the new interface name:

[root@linuxcnf ~]# cp -p /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0

Step 4: Edit the network interface configuration and Change the values of NAME and  DEVICE from the old to the new interface name:

[root@linuxcnf ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
…………
NAME=eth0
DEVICE=eth0
…………

Step 5: save the changes and reboot the machine.

No comments:

Post a Comment