I have a small application which takes in kernel code, and spins up VMs. I've been using this for kernel development. It is helpful and very fast when I want to spin up VMs with different kernel codes.
The application uses qemu, and generates the qemu command on the fly based on the given options.
The problem I am facing is ever changing network interface names.
The initial setup was such, that the interface names were ens*
, and I had the following configuration in the /etc/network/interfaces
to configure them to dhcp
allow-hotplug ens3
iface ens3 inet dhcp
I had a number of them, to make sure if the names gets pushed from ens3
to ens7
(maybe due to added qcow as scsi devices), the network interface ens7
still gets configured.
It was working fine.
Now with the new Linux kernel 6.4-rc, I observe that the names of the interfaces are coming up as enp0s*. Now my /etc/network/interfaces
configuration is not working.
I can't keep changing the /etc/network/interfaces
file according to kernel, cause that defeats the purpose of simply changing kernel code path and spinning up VMs. Btw, this was working fine for 2 years, and for kernel ranging from 4.19 to 6.1 (havent tested 6.2 and 6.3)
My question is,
is there a default way to configure the network, such that any and all network interfaces come up with dhcp.
Basically, something like
allow-hotplug all
iface all inet dhcp