2

Until I updated my OS, I could launch VMs with the following network configuration:

-net nic,vlan=0,model=virtio,macaddr=${MAC1} -net bridge,vlan=0,br=${BRIDGE1} \
-net nic,vlan=1,model=virtio,macaddr=${MAC2} -net bridge,vlan=1,br=${BRIDGE2} 

In the host OS I'm using two bridges that operate in two separate Dot1q VLANs. The VLANs have absolutely nothing to do with the ones I specified above. The only reason I added "vlan=0" and "vlan=1" was to prevent an internal loop in the QEMU's virtual HUB.

The vlan option has been removed. If I simply omit it in the mentioned network configuration, a network loop occurs. According to QEMU, I'm supposed to use the -netdev option now. My question: is it possible to set up the network in the same way I did before without any external scripts like if-up.sh? I can't figure out how to recreate the config with using -netdev.

user3125731
  • 347
  • 5
  • 9

1 Answers1

0

I've figured it out:

-device virtio-net-pci,mac=${MAC1},netdev=${BRIDGE1} \
-netdev bridge,br=${BRIDGE1},id=${BRIDGE1} \
-device virtio-net-pci,mac=${MAC2},netdev=${BRIDGE2}  \
-netdev bridge,br=${BRIDGE2},id=${BRIDGE2}

The above configuration has the same effect as the one I posted in the question and there's no loop.

user3125731
  • 347
  • 5
  • 9