3

I have a lab in which I have three computers connected to a switch.
two of the switch's ports are mirrored to a third port so that all the communication between the two computers is mirrored to the third computer.

I would like to create a similar lab setup but with virtual machines. I have no problem setting such virtual lab with only the computers (not the switch) (using vagrant and private network), but is there something I can use to replace the switch part?

I read about Open vSwitch but how would one go about connecting it to the other virtual machines so it acts as a switch?

kroiz
  • 41

4 Answers4

3

"...but is there something I can use to replace the switch part?"

Yes. You could change the network adapter of the third virtual machine (the one that was the destination of the mirroring) to be in promiscuous mode. Now all the traffic of all the virtual machine will be passing through your third vm.
virtualbox configuration

Hagai
  • 246
1

Sure there is. Mikrotik CHR for example can work nicely as a switch. Do not expect switch performance, where the CPU dues the work of an ASIC, though - but then you likely run a low traffic scenario anyway.

TomTom
  • 52,109
  • 7
  • 59
  • 142
1

If you're running on a Linux-based platform there's built-in kernel bridging. For just three VMs I wouldn't really suggest anything else, particularly as most - if not all - VM implementions on Linux already support it.

Port mirroring isn't native to the bridge, but using a Queuing Discipline you can add this functionality quite straightforwardly.

Chris Davies
  • 1,751
0

Don't forget that you still need VLAN aware switch (in between) if you use more than one hardware node!

Just search Amazon for VLAN switch.

SamTzu
  • 33