CentOS 7 disable predictable network interface names during install

9,068

You may use the bootloader section in the kickstart file to suppress predictable network interface names. Adding net.ifnames=0 and [if needed] biosdevname=0 to the --append should do what you're asking.

bootloader --location=mbr --append="net.ifnames=0 biosdevname=0"

Note that I've excluded the defaults rhgb quiet crashkernel=auto from the --append, it will work with or without them. You may also exclude the biosdevname package from install and use only net.ifnames=0 in the above.

bootloader --location=mbr --append="net.ifnames=0"
...
%packages --nobase
@core --nodefaults
-biosdevname
%end
Share:
9,068

Related videos on Youtube

Dru
Author by

Dru

Updated on September 18, 2022

Comments

  • Dru
    Dru over 1 year

    I know I can use net.ifnames=0 biosdevname=0, with grub, to disable predictable network interface names. This names the first interface as eth0 instead of enp0s3, or whatever. How do I specify this at install time using a kickstart file?

    • Michael Hampton
      Michael Hampton almost 9 years
      If possible you should avoid doing this entirely. Predictable network device names have many advantages over the old system, especially for administrators.
    • Dru
      Dru almost 9 years
      @MichaelHampton Right but currently the consistent naming is far from consistent. There's some interesting discussion here but I couldn't find my specific answer on this thread: access.redhat.com/discussions/644133
    • Michael Hampton
      Michael Hampton almost 9 years
      All of those comments applied (1) to the beta, and (2) to virtual machines. They have long since been fixed.
    • Dru
      Dru almost 9 years
      @MichaelHampton I'm still getting enp0s3, enp0s8, enp0s9, enp0s11 using vagrant/virtual box as of CentOS 7.1 (1503).
    • Michael Hampton
      Michael Hampton almost 9 years
      Well, you can't expect VirtualBox to be consistent. It's not like that's a serious virtualization platform.
    • Hai Nguyen
      Hai Nguyen about 8 years
      Maybe you could try with my the answer at: stackoverflow.com/questions/25671396/…
  • Dru
    Dru almost 9 years
    Are the rhgb quiet crashkernel... parameters necessary or can I just do --append="net.ifnames=0"?
  • jscott
    jscott almost 9 years
    I have not tested it without rhgb quiet crashkernel, as they were defaults, but none of them should be required to have a booting install.
  • Dru
    Dru almost 9 years
    Worked with just --append="net.ifnames=0" and -biosdevname under packages.
  • mvillar
    mvillar almost 9 years
    @jscott rhgb provides splash screen. quiet provides you a "silent" boot, if you remove it from bootloader, boot will be more verbose. crashkernel is used by kdump, you can remove it if you have kdump disabled or uninstalled.