5

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?

jscott
  • 24,484
  • 8
  • 79
  • 100
Grug
  • 221
  • 3
  • 12
  • If possible you should avoid doing this entirely. Predictable network device names have many advantages over the old system, especially for administrators. – Michael Hampton May 19 '15 at 00:46
  • @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: https://access.redhat.com/discussions/644133 – Grug May 19 '15 at 00:49
  • All of those comments applied (1) to the beta, and (2) to virtual machines. They have long since been fixed. – Michael Hampton May 19 '15 at 01:11
  • @MichaelHampton I'm still getting enp0s3, enp0s8, enp0s9, enp0s11 using vagrant/virtual box as of CentOS 7.1 (1503). – Grug May 19 '15 at 01:14
  • Well, you can't expect VirtualBox to be consistent. It's not like that's a serious virtualization platform. – Michael Hampton May 19 '15 at 01:17
  • Maybe you could try with my the answer at: http://stackoverflow.com/questions/25671396/what-does-eno-stand-for-in-network-device-name-eno16777736-on-centos-7-or-rh/36503043#36503043 – Hai Nguyen Apr 08 '16 at 15:08

1 Answers1

6

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
jscott
  • 24,484
  • 8
  • 79
  • 100
  • Are the `rhgb quiet crashkernel...` parameters necessary or can I just do `--append="net.ifnames=0"`? – Grug May 19 '15 at 00:56
  • 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. – jscott May 19 '15 at 01:00
  • Worked with just `--append="net.ifnames=0"` and `-biosdevname` under packages. – Grug May 19 '15 at 01:24
  • @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. – mvillar May 19 '15 at 06:27