Ethernet Device Names in CentOS 7

By Paul Heinlein | Jan 7, 2015

I’ve got quite a few servers currently running CentOS 6 that will over the course of the coming months be upgraded to CentOS 7. One of the allures of Linux distributions in the Red Hat family—including CentOS and Fedora—is the kickstart feature, which allows you to automate highly customized installations.

One problem I’m encountering is the CentOS 7 default of using so-called predictable network interface names. No longer can you assume the presence of eth0; your first interface may be p5p1, eno1, or something wackier like enp4s0f0. This causes issues in kickstart files which refer to a specific interface.

If your system is already running CentOS 6, you’re in luck. The biosdevname utility (supplied by an RPM of the same name) will tell you how an ethernet device will be named in the new system.

[root ~]# biosdevname -i eth0
[root ~]# biosdevname -i eth1
[root ~]# biosdevname -i eth2
[root ~]# biosdevname -i eth3

In the case of the CentOS 6 system with those four ethernet devices, I used kickstart to configure eth2 with a static IPv4 address and jumbo frames. Now I have the information necessary to adjust the CentOS 7 kickstart file:

# configure storage network interface
cat <<__eof__ > /etc/sysconfig/network-scripts/ifcfg-p6p1