Help with VMs, I want to create VLANS

Hello dear OpenWrt community.

So I'm quite new to creating networks in general, let alone VLANs, and also VMs.

My goal is to simulate an office network, I have an Archer A7 router which is connected to my PC through an ethernet cable, and then I have created several Virtual Machines on this PC that are the virtual versions of the PCs of the office network.

I need to create 2 or 3 different VLANs of those VMs, they are connected through a bridged adapter, and are getting DHCP ip addresses from the router for now.

Is there a possibility of separate these VMs into different vlans? If so, how. I'll read through on the internet about this, but I felt like it might be easier to ask, someone might could help me.

Thanks in advance!

You need to be able to put the Ethernet adapter (to which you bridge the VM interfaces) into the promiscuous mode. That would be your #1 task.

What hypervisor are you running on your PC? What is the OS running on the PC? The easiest way to do this would be to run ESXi, as it can easily place the Ethernet port into the promiscuous mode and allow multiple VLANs through it.

You would have to configure the port on your OpenWRT box (to which the computer is connected) as 802.1q trunk. If it’s a routed port, you would create the VLANs by creating sub-interfaces like this: for VLAN10 eth1.10, for VLAN20 eth1.20, etc. Then, you would configure DHCP under each such interface. I don’t have a switch in my OpenWRT box, so I’m not sure how the switched ports are configured as trunks in OpenWRT. I’m thinking there should be a LuCI GUI plugin for it.

1 Like

Hey, thank you for helping!
Im using KVM on linux.
I wont be available for a while, I just got to bed now but I will be back tomorrow to talk more about it. Appriciate it

You’ll have to ask in Linux forums on how to do this in KVM. I’m sure it’s possible. I’ve only used KVM on a NAS, and my NAS has a GUI to do this in.

1 Like

Yes, this is possible, and there are multiple options.

Do you want the VMs to communicate only among each other, or additionally

  • with the KVM host
  • with other devices on your LAN and the Internet

Is the physical network for the office PCs also structured into VLANs?
Do you want to extend these VLANs to the VMs, or should they be isolated from each other (using separate VLANs).

1 Like

Hey mpa,

So I have this project at the university, where I have to make an office network via Openwrt, with user management, directories, file servers, printservers etc.
I only have a pc with 8gb ram which is not a lot of resource so I thought I will make these VMs, like 8-10 of them and not run them at the same time, like only 3 to make it possible.

I want them to be able to access the internet of course, and the servers i will create later, but I need to separate them into more divisions.

I dont have the resources to have psychical office PCs so all of this is in VMs.

Thank you!

What does OpenWRT have to do with it? Is your internet router OpenWRT currently? Does it have a switch in it? Do you have a separate managed Ethernet switch?

Im switching to Win10 and vSphere atm, I really need to make this work :confused:

Yes the router is openwrt, and it has a switch

Find out if you can enable a trunk (802.1q) on a switch port using LuCI. If you can, that’s where you would connect your computer.

You said you were using KVM. Now you are not using KVM anymore? What vSphere on Windows are you taking about? VMWare Workstation?

1 Like

Yeah, Im pretty much in panic mode right now, and had no clue how to use kvm, and also less info on the web for it.
Im installing the OS atm. Do u recommend esxi? It has a 2 month trial period, so I am planning to try it asap, and then try to set up the vlans.

I would go with ESXi on bare metal.

ESXi is free for personal use. At least it was free last time I used it.

1 Like