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, you can help support this site and get something for yourself by signing up for any of the services listed below through the provided links.

The following links are part of affiliate programs, and I will receive a referral payment from any of the services you sign-up for.

  • Get Faster Shipping: Perhaps you're about to order some stuff on 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.
  • Start Investing Now: Are you looking to start investing some of your disposable saved income? Get started by opening an account with Webull, where upon sign-up and opening a brokerage account with an initial deposit of at least $100 you will receive 1 stock valued (subject to change based on normal market movement) between $8 and $1600.

Thanks for reading and take care.