ThorneLabs

Kickstart CentOS 7 with eth0 Instead of Predictable Network Interface Names

• Updated September 21, 2016


By default, CentOS 7 will kickstart and boot using predictable network interface names. This is useful when provisioning and using similar bare metal servers, but it isn’t very useful when provisioning and using disparate bare metal servers and virtual machines.

Predictable network interface names can be turned off relatively easily during the kickstart process. Doing so will keep it off once the system is installed, and it will remain off until you turn it back on.

biosdevname is the package responsible for implementing predictive network interface names and is not needed if you want to turn off this feature. To be sure it is not installed during the kickstart process, add -biosdevname to the %packages section of the Kickstart Profile. For example:

%packages
@core
-biosdevname
%end

The actual fix requires appending net.ifnames=0 to the GRUB boot line before system boot so the system kickstarts and boots using eth0 instead of a predictable network interface name. Ironically enough, if you don’t turn off this feature when provisioning a CentOS 7 virtual machine, it could boot with something completely unpredictable such as enp0s3 (that sort of network interface name occurs when using VirtualBox).

With net.ifnames=0 appended to the GRUB boot line, the system will also append the same parameter to line GRUB_CMDLINE_LINUX in /etc/default/grub after the system finishes kickstarting. At that point the system will always use eth0, eth1, etc.

References

If you found this post useful and would like to help support this site - and get something for yourself - sign up for any of the services listed below through the provided affiliate links. I will receive a referral payment from any of the services you sign-up for.

Get faster shipping and more with Amazon Prime: About to order something from Amazon but want to get more value out of the money you would normally pay for shipping? Sign-up for a free 30-day trial of Amazon Prime to get free two-day shipping, access to thousands of movies and TV shows, and more.

Thanks for reading and take care.