Advice on Virtual LAN (VLAN) approaches

Discussions related to using VirtualBox on Linux hosts.
Post Reply
ChuckZ
Posts: 2
Joined: 17. Feb 2011, 16:51
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Singularity,Windows,Ubuntu

Advice on Virtual LAN (VLAN) approaches

Post by ChuckZ »

Host: Ubuntu 16.04 with one physical NIC
Guests: Ubuntu 16.04

I have two guest VMs that each will talk to a different external device. These external devices expect to see their VM server at a specific IP address (say 10.60.55.55/16 for sake of this example). I have a network switch that supports VLANs. So, I will use VLAN tagging so that the two VMs do not collide.
Guest VM 1 will tag its traffic with VLAN 101
Guest VM 2 will tag its traffic with VLAN 102

I see two ways to solve this problem. Both use Linux VLAN support as desribed here: https://wiki.ubuntu.com/vlan
On Host
Create a pair of adapters on the host. One tagged at VLAN 101, the other at 102.
In my two Guest VMs, associate each with the appropriate VLAN set up on the host (bridged adapter)

On Guest
Host does not do the VLANs. Instead, each guest VM will create a tagged network adapter.

Question
Which is the best supported way on VirtualBox.
Will the second way work or will VirtualBox strip the VLAN ids?
Post Reply