I have created a libvirt network on top of a OVS bridge (named vlan-br) which receives all VLAN tagged packets, i.e. connected to a trunk port. The definition xml is below.
What I want to achieve in the portgroup definition 'trunk-native-1221' is to allow 1221 as untagged/native but rest all VLAN as tagged. The following portgroup definition works, but I don't want to enumerate all the tagged VLANs in the portgroup definition.
I understand what libvirt does on the underlying OVS bridge, once a guest interface (say vNetX) is attached to the portgroup is to set the vnetX with tag=1221 and vlan_mode= native-untagged and it sets trunk = [1222,1221,1223,1224]. Now if I go and clear the trunk setting on the OVS bridge for that interface I am able to see both tagged and untagged (1221) packets on the guest.
This is exactly what I want to achieve in the libvirt network definition, i.e. have one untagged VLAN and allow all other VLANs without having to enumerate them in the portgroup definition, as that is hard to maintain.
<bridge name = 'vlan-br'/>
<forward mode = 'bridge'/>
<tag id='1221' nativeMode='untagged'/>