Networking in Linux KVM

codingfreak asked:

I want to know if there is any way other than using linux bridges to interconnect interfaces from two virtual machines ?

Since I am trying to run private spanning tree implementation in virtual machines … underlying linux bridge which connects both the virtual machines is dropping the BPDUs.

VirtualBox solves the issue by providing internal-network option.

Is there any similar option if I use KVM ?

Update-01: Enabling STP would end up creating a topology containing 3 bridges (2VMs and 1 Linux bridge connecting both the VMs) instead of 2 bridges (2VMs).

My answer:

The people suggesting a TAP device were on the right track, but you need something else as well:

First, create a veth pair. This is a pair of virtual interfaces, each of which simply passes any traffic it receives to the other.

Next, attach one of your two VMs via macvtap to one of the veth interfaces in the pair, and attach the other VM to the other veth interface.

Finally, send some traffic.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.