-1

I am trying to create a VM on KVM using QEMU and wondering how to add multiple vNICs to it,

qemu-system-x86_64 -enable-kvm -cpu host,-xsave,-avx,-avx2,-bmi2 -m 4096
  -smp cores=2,sockets=1 -device virtio-scsi-pci,id=scsi
  -device scsi-hd,drive=hd -drive if=none,id=hd,file=/opt/xyz.img,format=raw
  -netdev tap,helper=/usr/lib/qemu-bridge-helper,id=hostnet1 -device virtio-net-pci,netdev=hostnet1,id=net1
  -serial pty  -boot d 

This works fine and comes up with 1 vNIC however just wondering how can I add multiple vNICs to vm and use same bridge on the host?

Thanks,

michas
  • 25,361
  • 15
  • 76
  • 121
user2547836
  • 89
  • 1
  • 7

1 Answers1

0

I just added another tap interface and device which just worked fine like

qemu-system-x86_64 -enable-kvm -cpu host,-xsave,-avx,-avx2,-bmi2 -m 4096
  -smp cores=2,sockets=1 -device virtio-scsi-pci,id=scsi
  -device scsi-hd,drive=hd -drive if=none,id=hd,file=/opt/xyz.img,format=raw
  -netdev tap,helper=/usr/lib/qemu-bridge-helper,id=hostnet1 -device virtio-net-pci,netdev=hostnet1,id=net1
  -netdev tap,helper=/usr/lib/qemu-bridge-helper,id=hostnet2 -device virtio-net-pci,netdev=hostnet2,id=net2
  -serial pty -boot d
michas
  • 25,361
  • 15
  • 76
  • 121
user2547836
  • 89
  • 1
  • 7