Consistent network interface naming on el8 systems

Hi,

I know this issue has come up for some Foreman users, but I want to see if there is a clear direction or solution. Here’s the problem:

On el8 systems (Rocky 8, CentOS 8, AlmaLinux, etc.) a new naming convention is in place, dubbed “Consistent Network Interface Naming” by RH. Here’s a link to a doc explaining how it works:

In my envirionment, I’ve found that, after provisioning with Foreman 2.5, the net interface names are INCONSISTENT, from my perspective as system administrator. Here are some examples:

  1. A KVM virtual machine, hosted on a CenOS 7 bare-metal server, gets the name ‘ens5’ for it’s first NIC.
  2. A KVM virtual machine, hosted on a Rocky 8 bare-metal server, gets the name ‘ens13’ for it’s first NIC.
  3. A VMware Fusion virtual machine, hosted on a MacOS Mojave workstation, gets the name ‘ens33’ for it’s first NIC.

Questions:

  1. Is there a safe way to ensure a predictable net interface name for my VM’s that are provisioned by Foreman? I’d be OK if they all started out with ‘ens1’ or ‘ens5’. I am not stuck on the old ‘eth0’.

  2. Would it be OK to simply disable consistent naming, resulting in an old eth name? What are the implications? Again, my VM’s don’t change their system config much throughout their lifespans.

  3. Could the Foreman provisioning templates accomplish this, by setting “net.ifnames=0” perhaps? Or, by running “nmcli connection modify…” post install? I use the “Kickstart default” and “Kickstart default PXELinux” templates.

Thanks.