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.

closed as off-topic by Ron Maupin Apr 12 '18 at 13:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "NE is a site for to ask and provide answers about professionally managed networks in a business environment. Your question falls outside the areas our community decided are on topic. Please visit the help center for more details. If you disagree with this closure, please ask on Network Engineering Meta." – Ron Maupin
If this question can be reworded to fit the rules in the help center, please edit the question.


You can use Open vSwitch. It has many enterprise grade features, including port mirroring.

You will find on this documentation page the following information:

Q: How do I configure a port as a SPAN port, that is, enable mirroring of all traffic to that port?

A. The following commands configure br0 with eth0 and tap0 as trunk ports. All traffic coming in or going out on eth0 or tap0 is also mirrored to tap1; any traffic arriving on tap1 is dropped:

$ ovs-vsctl add-br br0
$ ovs-vsctl add-port br0 eth0
$ ovs-vsctl add-port br0 tap0
$ ovs-vsctl add-port br0 tap1 \
    -- --id=@p get port tap1 \
    -- --id=@m create mirror name=m0 select-all=true output-port=@p \
    -- set bridge br0 mirrors=@m

To later disable mirroring, run:

$ ovs-vsctl clear bridge br0 mirrors

Not the answer you're looking for? Browse other questions tagged or ask your own question.