How to enable tagged vlan1 for VM by default?

cpw

New Member
Oct 7, 2024
2
0
1
Hi
So I'm trying to replicate my current physical networking setup using a proxmox VM. Something I've encountered is that I seem to be unable to fully provision a VM with a completely tagged vlan trunk network (which would be necessary for my existing OPNsense solution, for example).

I have a vlan-aware bridge, and I can tag every vlan except vlan 1. To enable tagging of vlan 1, I have to run this command: bridge vlan add vid 1 dev tap101i0 once the virtual machine is up. This changes the bridge from this:
Code:
tap101i0          1 PVID Egress Untagged
                  2-4094

to this
Code:
tap101i0          1-4094

This fixes it and vlan1 is tagged and passed through to the VM correctly at that point.

I would like to automate doing this during VM startup, either with a script, configuration, or something similar. I know vlan 1 is supposed to be special, but I don't want to rejigger 15 years of network design to accommodate this bizarre restriction, and would rather actually just make it work the way it should.
 
Use another VLAN ID as PVID for that bridge. We use 4063 for that purpose:

Code:
auto vmbr0
iface vmbr0 inet static
    bridge-ports bond0
    bridge-stp off
    bridge-fd 0
    bridge-vlan-aware yes
    bridge-vids 1-3 5-99 101-4094
    bridge-pvid 4063
Ah, does it somehow inherit the PVID from the bridge configuration. I'll give that a try.
 

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!