Change default network name to old “eth0″ on RHEL 7 / Fedora 19 above

Red Hat Enterprise 7 is based on fedora 19 and upstream of kernel 3.10

Ever wanted to change back to the default network device name like “ethX” This is based on VMware installation i have the default nic name as”en01677736″

[root@eSuareznotes01 ~]# ip addr show
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eno16777736: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:92:78:40 brd ff:ff:ff:ff:ff:ff
inet XX.X.XX.XX/24 brd 10.0.10.255 scope global dynamic eno16777736
valid_lft 85931sec preferred_lft 85931sec
inet6 fe80::20c:29ff:fe92:7840/64 scope link
valid_lft forever preferred_lft forever

[root@eSuareznotes01 ~]# vi /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=”console”
GRUB_CMDLINE_LINUX=”rd.lvm.lv=rootvg/usrlv rd.lvm.lv=rootvg/swaplv crashkernel=auto vconsole.keymap=us rd.lvm.lv=rootvg/rootlv vconsole.font=latarcyrheb-sun16 rhgb quiet”
GRUB_DISABLE_RECOVERY=”true”

Look for this line “GRUB_CMDLINE_LINUX” and add the following: “net.ifnames=0 biosdevname=0″

Should look like this:
GRUB_CMDLINE_LINUX=”rd.lvm.lv=rootvg/usrlv rd.lvm.lv=rootvg/swaplv crashkernel=auto vconsole.keymap=us rd.lvm.lv=rootvg/rootlv vconsole.font=latarcyrheb-sun16 rhgb quiet net.ifnames=0 biosdevname=0

[root@eSuareznotes01 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file …
Found linux image: /boot/vmlinuz-3.10.0-121.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-121.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-df30d92ad3eb414583d85bb471003eb4
Found initrd image: /boot/initramfs-0-rescue-df30d92ad3eb414583d85bb471003eb4.img
done

If you didn’t put any names during the installation, you will need to rename the interface files by renaming the file /etc/sysconfig/network-scripts/ifcfg-*.

[root@eSuareznotes01 ~]# mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0
[root@eSuareznotes01 ~]# shutdown -r now

After system reboot

[root@eSuareznotes01 ~]# ip addr show
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:92:78:40 brd ff:ff:ff:ff:ff:ff
inet 10.0.10.77/24 brd 10.0.10.255 scope global dynamic eth0
valid_lft 86141sec preferred_lft 86141sec
inet6 fe80::20c:29ff:fe92:7840/64 scope link
valid_lft forever preferred_lft forever

Source: http://esuareznotes.wordpress.com/2014/07/11/change-default-network-name-to-old-eth0-on-rhel-7-fedora-19-above/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s