Debian cloud-init image trunk vlan config with and `qm create --net[n] trunks=x;y`

discourseur

New Member
Mar 27, 2023
1
0
1
Hi! First post here. I did a lot of research before asking.

I have a single node Proxmox host using a vlan aware bridge. The switches are properly configured.

I can install Debian using the ISO and configure a single virtual interface linked to vmbr0 on the host and manage multiple vlan on the single vif of the VM. That works well.

But, I am unable to do the same using the Debian cloud-image.

I use the `qm` CLI tool.

First, I create the network interface with `qm create --net0 virtio,bridge=vmbr0,trunks=10;20`.

Then, how am I supposed to configure the different VLANs on the net0 interface? I tried `qm set --ipconfig0 ip=dhcp`, but that doesn't work.

Is there a way to do the equivalent of `qm set --ipconfig0.10...` and `qm set --ipconfig0.20`?

Is it best practice to create one virtual interface per vlan?

Thanks !
 
cloud-init may not be the right tool for this situation.

cloud-init is for initialization of "simple" VMs with one or two NICs and no complicated network setup.

Maybe you can work something out with ccustom JSON data in cloud-init and a custom script in the VM template.
 

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!