There is a possibility to setup VLANs in VMware Workstation.
If you're user of VMware Workstation, you usually use one of the 3 basics networking types provided. Bridget, NAT or Host Only. I just stumbled through this KB explaining how to setup VLANs inside of VMware Workstation environment, and especially if you're running several VMs on different hosts as long as the hosts stays connected.
The downside is that you have to add a second physical NIC to each host where you want to use VLANs…
Here are the steps:
01. Power off all virtual machines on your host first.
02. Now you must add a secondary NIC to the host.
03. You now create a virtual switch on the host, by adding a vmnet to the secondary network card.
04. Launch VMware Workstation and go to Edit > Virtual Network Editor.
05. Click vmnet0 and set it to Host Only. (just temporarily)
06. Select vmnet2 or any unused, unresevered vmnet.
07. Set vmnet2 to Bridged To and from the dropdown menu, select the secondary network card that you just added on this host, and click Apply.
08. Click vmnet0, set it to Bridged To, and from the dropdown menu, select Automatic. ( now the secondary NIC is now dedicated to vmnet2, so you don't see it anymore.) Click Apply and OK
09. Add the chosen vmnet to your virtual machine.
10. In Workstation, edit the settings for the virtual machine which you want to isolate.
11. In the Hardware tab, click Network Adapter and in the right pane, you must select Custom: Specific Virtual Network and from the dropdown menu, select the vmnet adapter that is mapped to the secondary network card. In our example, it is vmnet2. OK.
12. Power on the virtual machine and assign an IP address within the IP range that you would use for this VLAN. Note: To avoid conflicts and confusions, ensure that this IP range is different from your network's existing DHCP scope.
The virtual machines are now on the same VLAN. To aid connectivity between the machines, you may want to assign them all to the same workgroup or join/bind them to the same domain.
Also related to this setup:
Using the Virtual Network Editor in VMware Workstation (1018697).
Understanding networking types in hosted products (1006480).
Source: KB Article: 1020480
You could also use a feature available with teams called Team Segments and use isolated networks segments for testing and running VMs in isolated environments too. You can see more about Teams and Workstation in my articles below:
https://www.vladan.fr/vmware-workstation-teams-in-video/
https://www.vladan.fr/vmware-workstation-with-teams-functionality-is-a-really-flexible-and-usefull/
https://www.vladan.fr/why-i-did-not-start-using-teams-earlier/
With team segments you can:
– Isolate a team completely from the host network. A team LAN segment is undetectable and inaccessible from any other network.
– Create a virtual DMZ or proxy server to securely bridge the team members to the outside network.
– Allow specific network bandwidth and packet loss to each virtual machine on the team.
– Connect all team members fully to host resources
Sam says
This might have been helpful if it had anything whatsoever to do with VLANs instead of just creating a second bridged vmnet
Dan No says
Yes, this is just different IP subnet. Nothing about VLAN-tagging on existing subnet.
Aruna says
Please Anyone help me
I am having Vmware workstation running in Windows 7 and guest Debian 8.8 is running in Vmware
I have created multiple Vlan inside guest (Debian 8.8) using the below settings in /etc/network/interfaces
auto eth10g
iface eth10g inet static
auto eth1g
iface eth1g inet static
address 172.17.3.2
netmask 255.255.0.0
post-up ip rule add from 172.17.3.2 lookup rt1g priority 100
post-up ip route add 172.17.0.0/16 dev eth1g table rt1g
auto vlan10
iface vlan10 inet manual
address 172.17.3.160
netmask 255.255.0.0
vlan-raw-device eth10g
auto vlan20
iface vlan20 inet manual
address 172.29.55.160
netmask 255.255.255.0
vlan-raw-device eth10g
auto vlan21
iface vlan21 inet manual
address 172.16.32.1
netmask 255.255.255.0
vlan-raw-device eth10g
auto br-sec
iface br-sec inet static
address 172.17.3.1
netmask 255.255.0.0
bridge_ports eth10g vlan10
bridge_stp off
bridge_maxwait 0
bridge_fd 0
auto br-gx0
iface br-gx0 inet static
address 172.29.55.160
netmask 255.255.255.0
bridge_ports vlan20
bridge_stp off
bridge_maxwait 0
bridge_fd 0
auto br-gx1
iface br-gx1 inet static
address 172.16.32.1
netmask 255.255.255.0
bridge_ports vlan21
bridge_stp off
bridge_maxwait 0
bridge_fd 0
I am unable to ping vlan20 and vlan21 from Windows. Can anyone help me with this