Network config missing on packer created templates

aseques

New Member
Jun 9, 2025
2
1
3
Hi, I'been trying to get packer to create working templates for ubuntu 24.04 all day and I'm mostly there but I still have an issue with the networking. I am following the guide here.
At this point I can create a booting template, but when new VMs are created using the template they boot with the interface ens18 without link.
1749484450006.png
If I do:
ip link set ens18 up
dhcpd
Then interface gets the IP address as expected from the dhcp
So the problem must be somewhere either on packer configuration or the cloud-init

On the user data I added without much effect
network:
version: 2
ethernets:
ens18:
dhcp4: true
Attached are the logs that mention ethernet on the cloud-init.log, there's this line that looks suspicious but I don't know if it's relevant though
network connectivity determined unnecessary for cloud-init's network stage. Reason: user data: cloud-config does not contain network requiring elements, vendor data: no configuration found, vendor data2: no configuration found

Any ideas? I am coming from vmware where I have a setup similar to this and at this point I am a bit lost.
 

Attachments