Thanx for posting to our site. I asked my expert and he came back with the following:
Below is my recommendation:
- User should tag frames with VLAN ID from within the VM.
User can add multiple VLAN IDs to a single interface in the VM. - User should not tag VF frames from the host OS. This will
ensure PF driver doesn’t strip VLAN information. - Below is the procedure to configure VLANs in a VM.
- Load 8021q kernel module if not already loaded.
- “lsmod | grep 8021q will show if the module is loaded.
- “modprobe 8021q On
Red Hat Linux or equivalent navigate to /etc/sysconfig/network-scripts/
- Assumption
– User is configuring eth1 device for VLAN 110. - Create
a file ifcfg-eth1.110 - Sample
file below:- # VLAN configuration
for my eth1 with VLAN ID - 110 # - DEVICE=eth1.110
- BOOTPROTO=none
- ONBOOT=yes
- IPADDR=x.x.x.x
- NETMASK=y.y.y.y
- USERCTL=no
- NETWORK=x.x.x.0
- VLAN=yes
- # VLAN configuration
- “service network restart”
- Load 8021q kernel module if not already loaded.
The above configuration will tag Ethernet frames with VLAN ID 110 from within the VM and will be passed on to the next hop with VLAN ID intact. PF driver will not strip the VLAN ID. On receive PF driver will pass the Ethernet frame to the VM with VLAN ID intact.