1

The aim is to standardize the Ethernet adapter type on all production servers. One of these servers disposes an em1, rather than eth0.

Today, an attempt has been done to change it, without success. Before executing a second attempt, this conversion will be tested first.

A Vagrant box has been created and eth0 is the current adapter.

To mimic the production setting, the eth0 needs to be changed to em1. Biosdevname has been installed (sudo yum install biosdevname -y), 70-persistent-net.rules removed (sudo rm /etc/udev/rules.d/70-persistent-net.rules), biosdevname=1 executed and added to /etc/grub.conf as follows:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Scientific Linux (2.6.32-431.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-431.el6.x86_64.img

biosdevname=1

However, once the system has been rebooted and ifconfig has been executed the eth0 adapter persists.

How to change eth0 to em1?

  • Is it possible to Update your Kernel, and then enable Predictable Network Interface Names? – eyoung100 Sep 11 '14 at 18:04
  • 1
    em1 is belong to FreeBSD OS, are you sure your working with Linux? eth0 is belong to linux. – PersianGulf Sep 11 '14 at 19:51
  • @MohsenPahlevanzadeh Yes, the OS is Scientific Linux – 030 Sep 12 '14 at 17:32
1

Changing em* to eth*

NOTE: em0 and em1 are also used by RHEL & CentOS, and therefore Scientific Linux as well. They're typically used for embedded NICs that are built into the system's motherboard.

I found this blog post titled: Solved: Renaming em1 to eth0 on Red Hat Enterprise Linux 6 which suggested adding the following to your /etc/grub.conf, biosdevname=0.

excerpt
  1. I've been burned enough times to do this out of habit: make a backup of /etc/grub.conf, retaining SELinux info:

    $ sudo cp --preserve=context /etc/grub.conf /etc/grub.bak
    
  2. Add biosdevname=0 to the kernel boot arguments in /etc/grub.conf.

  3. Rename /etc/sysconfig/network-scripts/ifcfg-em1 to /etc/sysconfig/network-scripts/ifcfg-eth0, changing the line:

    DEVICE="em1"
    

    to

    DEVICE="eth0"
    
  4. Delete /etc/udev/rules.d/70-persistent-net.rules

  5. Reboot.

Changing eth* to em*

If on the other hand you're attempting to change eth0 to em1, then I believe you need to move the biosdevname=1 from that standalonne line in your grub.conf file so that it's an actual parameter to the kernel line above.

For example:

    kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet biosdevname=1

References

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.