[SOLVED] Cloud-Init and DHCP for network

Hello everyone,

I have a script that cron runs once a day to check if there are updates for the debian 12 cloud image and if so then remove the outdated template and replace it with the new up-to-date image.

Now every time the script deletes the old template and create a new one, cloud-init changes the IP settings back to static with no IP configured.
I need it to be DHCP for IPv4 so that it can get a internal IP address from proxmox VE SDN so that it uses the IP it shares with the host.
But I cannot find how I can change the cloud-init network settings via command-line. (It can be done easy via the GUI but I do not want to change the settings back to DHCP every time the template gets updated by my script.)

Does anyone know how I can do this via the command-line?

Thanks in advance.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!