Pass VLAN on host to VM as adapter?

patrick999

New Member
Apr 16, 2024
4
1
3
I'm considering migrating my home lab to a Proxmox VE hypervisor. Currently I'm using Truenas SCALE as my hypervisor, but due to changes in Truenas Fangtooth, which just came out, I am considering switching to Proxmox VE.

Here is my question. I have VLANS on my network that I would like to define in Proxmox VE and pass them to guest VMs as adapters. That's how I currently do it in Truenas, but I don't see a way to do it Proxmox. In particular, is there a way to pass a VLAN on a Proxmox VE host to a VM as an adapter, so that the guest VM sees it as as an adapter? The only ways that I have found to assign adapters to VMs in Proxmox VE so far, based on the test box I have set up, are either: (a) passing it a bridge (although maybe I can bridge the VLAN?), or PCIE pass-through.
 
I'm considering migrating my home lab to a Proxmox VE hypervisor. Currently I'm using Truenas SCALE as my hypervisor, but due to changes in Truenas Fangtooth, which just came out, I am considering switching to Proxmox VE.

Here is my question. I have VLANS on my network that I would like to define in Proxmox VE and pass them to guest VMs as adapters. That's how I currently do it in Truenas, but I don't see a way to do it Proxmox. In particular, is there a way to pass a VLAN on a Proxmox VE host to a VM as an adapter, so that the guest VM sees it as as an adapter? The only ways that I have found to assign adapters to VMs in Proxmox VE so far, based on the test box I have set up, are either: (a) passing it a bridge (although maybe I can bridge the VLAN?), or PCIE pass-through.
I may have answered my own question. I experimented with creating a bridge in Proxmox VE with the VLAN as the only port, and passing that bridge to the VM. That seems to work, although I didn't test it extensively. If anyone can confirm that this is the correct approach, I'd appreciate it.
 
  • Like
Reactions: patrick999
Why not post the output of cat /etc/network/interfaces (in[code]...[/code] tags please)?

Simple bridges with a defined VLAN are given as an example here: https://pve.proxmox.com/wiki/Network_Configuration#sysadmin_network_vlan
I'm just testing Proxmox VE in a VM running on Truenas Scale currently and have not set up ssh yet so have not worked at the CLI. However, the link you posted seems to answer my question, if I'm understanding it, when it says "VLAN awareness on the Linux bridge: In this case, each guest’s virtual network card is assigned to a VLAN tag, which is transparently supported by the Linux bridge."

I believe this is what I'm looking for.
 
  • Like
Reactions: UdoB