Disabling consistent network device naming
To disable The consistent network device naming feature and create your own manual ma,ing scheme ,for example eth0,internet0 or lan0. Follow the below steps so that all network device names will be eth followed by an integer.
- Log in as root, or as a user with superuser privileges.
- Edit the GRUB 2 general settings file.
- Determine whether the host is configured for UEFI or legacy boot mode..
# find /boot -maxdepth 1 -type d
- If the output includes /boot/efi, the host is configured for UEFI boot mode.
- If the output does not include /boot/efi, the host is configured for legacy boot mode.
- Recreate the GRUB 2 boot configuration file.
For UEFI boot mode:
# grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
For legacy boot mode:
# grub2-mkconfig -o /boot/grub2/grub.cfg
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-09377eb6cd424f3e802d04d64a5da531
Found initrd image: /boot/initramfs-0-rescue-09377eb6cd424f3e802d04d64a5da531.img
done
- Change network device configurations.
# vi ifcfg-eth0 TYPE=Ethernet BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no NAME=enp0s3 ---> change to eth0 UUID=54828c5b-65be-42b1-8b4e-07627c67487f DEVICE=enp0s3 ---> change to eth0 ONBOOT=yes IPADDR=192.168.78.51 PREFIX=24 DNS1=192.168.78.51 DNS2=192.168.78.52 DOMAIN=evilcorp.com IPV6_PEERDNS=yes IPV6_PEERROUTES=yes IPV6_PRIVACY=no
- Reboot the host.
You can confirme the configuration by runing network manager user interface (nmtui) or
the following commands :# nmcli dev DEVICE TYPE STATE CONNECTION eth0 ethernet connected eth0 eth1 ethernet connected eth1 eth2 ethernet connected eth2 lo loopback unmanaged -- # nmcli con NAME UUID TYPE DEVICE eth0 54828c5b-65be-42b1-8b4e-07627c67487f 802-3-ethernet eth0 eth2 04583597-c715-4ac5-954e-13dc748991a9 802-3-ethernet eth2 eth1 2418c04d-4291-48e6-95d1-3de63cd58d6a 802-3-ethernet eth1