[SOLVED] Linux bridge - Allowed vlan on trunk interface to VMs

francescogalli

New Member
Jan 15, 2021
3
0
1
26
Hi to all,
i've set my vm config file in /etc/pve/qemu-server/<vm-id>.conf allowed vlan on trunk as below

JSON:
bootdisk: scsi0
cores: 1
memory: 1024
name: test-vlan
net0: virtio=1A:D5:5B:3E:11:3F,bridge=vmbr0,trunks=100-200
numa: 0
ostype: l26
scsi0: DATASTORE:vm-113-disk-0,size=30G
scsihw: virtio-scsi-pci
smbios1: uuid=4b17d65f-1a05-4de3-956e-0836716b28af
sockets: 1
vmgenid: 66d62149-51c0-4121-8bad-22c96b91d0fe

But what if i would like to allow certain non contigous vlans, for example 100 and 200 but not from 100 to 200, without using range (-) ?
i've seen that by put colon (,) doesn't works
using bridge vlan del and bridge vlan add vid xx works but not permanently

Any suggestions ?
Regards
 
Last edited:
I would probably assign different network devices with only one VLAN tag each.
Or is this not what you want to achieve?
 
I would probably assign different network devices with only one VLAN tag each.
Or is this not what you want to achieve?
That is a valid option, but the result that i would like to achieve is doing classing switching on the linux bridge since it should be capable of
linux bridge with vlan awareness should be able to allow certain vlan on a port.
with bridge vlan command it actually works as i want cause i can add all the vlan i want even if they're not contigous
but by editing vm config file i can't filter vlan if they're not contigous
hope the explaination is clear
Regards
 
The VLAN tag on the VM NIC is the default VLAN which will be assigned to traffic leaving that VM, if you want the VM to communicate with other VLANs you should create another virtual NIC for your VM tagged with the other VLAN - you define the 'allowed' VLAN(s) on the physical switch port.
 
  • Like
Reactions: francescogalli