Grinding Wheel

My lab prior to all of this had been through a couple of iterations but has now arrived at:

Networking Lab Requirements

  1. Two full VMs with an install of BGP routing software
  2. Able to connect with essentially a software defined network cable
  3. Totally isolated from the rest of my home networking
  4. Able to support multi other private bridged networks

The process for getting this setup wasn't the most complicated, what makes it more complicated than it probably could be is that virt-manager and QEMU don't provide the ability to define "veth" interfaces.

A "veth" interface is the requirement if you want two VMs, on the same host to commuicate directly over what is essentially a physical cable, no switching/bridging happens on the host. The routing systems will maintain their own ARP table.

On the Fedora machines

The following will create two veth interfaces in a peer configuration sudo ip link add bgp1-veth type veth peer name bgp2

Then to set them to an up state

sudo ip link set bgp1-veth up 
        
sudo ip link set bgp2-veth up 
        

Now you could have created the VMs before or afte this, it does not matter. Currently for the creation of resources in QEMU, I'm preferring the graphical virt-manager interface. Aside on this later. For the linking of the veth interfaces created to the VMs you are creating, virt-manager will not work. It doesn't have the support for what a veth is.

So you will need to in whatever interface you are using, add a NIC and edit the XMl directly for it like:

        
<interface type='direct'>
  <mac address='52:54:00:f2:aa:76'/>
  <source dev='bgp1-veth' mode='private'/>
  <target dev='macvtap1'/>
  <model type='virtio'/>
  <alias name='net1'/>
</interface>
        
        

You will need the macvtap target there as QEMU doesn't natively support a backend for veth but can link this against a macvtap interface, which works

Now you need a second.

        
<interface type='direct'>
  <mac address='52:54:00:1d:7e:37'/>
  <source dev='bgp2-veth' mode='private'/>
  <target dev='macvtap2'/>
  <model type='virtio'/>
  <alias name='net1'/>
</interface>
        
        

That's the hairy XML bits, your second NIC on both VMs can be on a bridge (I choose isolated also) network)

The real last part is just the OS installation. OpenBSD provides a good QEMU image for that, and I went the route of performing the install over a Serial connection which also worked without issue

After the install of the OS, all that's needed for the system to system communication is to give each virtio veth device an IP, go with a small subnet as it'll make things easier.

Set the state to up on both and you should have communication.