cloudinit: how to get nameservers and other networking settings via DHCP

udotirol

Well-Known Member
Mar 9, 2018
61
20
48
53
I'm in the process of migrating our infrastructure to a more declarative, GitOps/terraform style. As a part of this, a lot of VMs will be created using customized cloud-init images (debian, fwiw).

Now the only thing missing for my little puzzle is to get networking right. When creating VMs manually, they get a lot of networking settings via DHCP (MTU, nameservers, VLAN ids, routing etc.). So far, I was unable to get the same up and running with cloud-init.

https://pve.proxmox.com/wiki/Cloud-Init_Support#_cloud_init_specific_options says that when I omit the ipconfig[n] options, ip configuration will be performed via DHCP. This works indeed, the VMs created via cloud-init get their IP addresses via DHCP, but that's all. Any other settings coming from DHCP are ignored, for example the nameservers. The nameservers are simply copied from the proxmox host to the created VM, which is pretty useless given the proxmox host is living in an entirely different network segment.

Any ideas how to get a cloud-init configured VM taking network settings via DHCP?
 

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!