Ethernet Naming Convention

You can change network interface naming conventions for RHEL, Oracle Linux, and Suse Linux systems.

Procedure

  1. Open the grub file:

    $ vi /etc/default/grub
  2. Save the file and exit.

  3. Check to ensure the changes you made are correct:

    $ grub2-mkconfig
  4. If changes are correct, update the grub configuration:

    $ grub2-mkconfig -o /boot/grub2/grub.cfg

    If VM uses UEFI boot, update the grub configuration:

    grub2-mkconfig -o /boot/efi/EFI/{version}/grub.cfg

    where:

    • For ubuntu, {version} = ubuntu

    • For RHEL & Oracle Linux, {version} = redhat

  5. Change directory to network-scripts folder:

    $ cd /etc/sysconfig/network-scripts
  6. Copy the interface file name from the original name ens192 to eth0:

    $ cp ifcfg-ens192 ifcfg-eth0
  7. Open the ifcfg-eth0 file and change the NAME and DEVICE variables inside the file (that reflect the names of the interface) to eth0.

    This parameter should be set in ifcfg-eth0:

    ONBOOT=yes

    Sample output:

    Type=Ethernet
    PROXY_METHOD=none
    BROWSER_ONLY=no
    BOOTPROTO=dhcp
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=no
    IPV6INIT=yes
    IPV6_AUTOCONF=yes
    IPV6_DEFROUTE=yes
    IPV6_FAILURE_FATAL=no
    NAME=ens192
    UUID=9a8547cd-4d40-4d51-bdfc-e213dl8828a6
    DEVICE=ens192
    ONBOOT=yes
    IPV6_PRIVACY=no

Loading...