Linux

Grub configuration to disable consistent network device naming in OEL 7

Preamble

Starting with Red Hat Enterprise Linux 7 and so Oracle Enterprise Linux 7 (and maybe on many other linux distributions, at least Centos 7 for sure) the network interface names have been moved to something a little bit different from traditional eth[0,1,2,..]:

[root@server3 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> 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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:47:54:07 brd ff:ff:ff:ff:ff:ff
    inet 192.168.56.102/24 brd 192.168.56.255 scope global enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe47:5407/64 scope link
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:fc:21:55 brd ff:ff:ff:ff:ff:ff
    inet 10.70.101.94/24 brd 10.70.101.255 scope global dynamic enp0s8
       valid_lft 3572sec preferred_lft 3572sec
    inet6 fe80::a00:27ff:fefc:2155/64 scope link
       valid_lft forever preferred_lft forever

The reason for this is clear from Red Hat official documentation:

In Red Hat Enterprise Linux 7, udev supports a number of different naming schemes. The default is to assign fixed names based on firmware, topology, and location information. This has the advantage that the names are fully automatic, fully predictable, that they stay fixed even if hardware is added or removed (no re-enumeration takes place), and that broken hardware can be replaced seamlessly. The disadvantage is that they are sometimes harder to read than the eth0 or wlan0 names traditionally used. For example: enp5s0.

How to come back to legacy situation ? You might want to do this not only because bad habits die hard but simply because you are configuring a cluster of servers (RAC, NoSQL, …) and want to be sure that the interconnect interface is called eth0 on all your nodes…

Continue reading