It turns out that we were constructing multiple qemu "vlans" which aren't actual 802.1q vlans but rather something akin to network hubs w.r.t to which devices see which packets.
A -netdev user,id=net00 and -device virtio-net-pci,netdev=net00 pairs a slirp/usernetwork backend with a virtio-net-pci device ,each one of those pairs runs it's own copy of slirp independent of each other. From qemu monitor the network setup looked like this:
This allowed the multi nic setup to DHCP on each nic and obtain the same IP address since the default user/slirp network config is the same (10.0.2.0/24, dhcpstart=10.0.2.15).
If we use -net user -net nic (legacy and depricated options) we can obtain a configuration with one slirp/user network services for a hub of devices but that means we lose some configuration ability in xkvm around use of -netdev and -device. Here is how we got the hub mode working though:
It turns out that we were constructing multiple qemu "vlans" which aren't actual 802.1q vlans but rather something akin to network hubs w.r.t to which devices see which packets.
A -netdev user,id=net00 and -device virtio- net-pci, netdev= net00 pairs a slirp/usernetwork backend with a virtio-net-pci device ,each one of those pairs runs it's own copy of slirp independent of each other. From qemu monitor the network setup looked like this:
info network type=nic, model=virtio- net-pci, macaddr= 52:54:00: 12:34:00 type=user, net=10. 0.2.0,restrict= off type=nic, model=virtio- net-pci, macaddr= 52:54:00: 12:34:02 type=user, net=10. 0.2.0,restrict= off type=nic, model=virtio- net-pci, macaddr= 52:54:00: 12:34:04 type=user, net=10. 0.2.0,restrict= off type=nic, model=virtio- net-pci, macaddr= 52:54:00: 12:34:06 type=user, net=10. 0.2.0,restrict= off type=nic, model=virtio- net-pci, macaddr= 52:54:00: 12:34:08 type=user, net=10. 0.2.0,restrict= off type=nic, model=virtio- net-pci, macaddr= 52:54:00: 12:34:0a type=user, net=10. 0.2.0,restrict= off
virtio-net-pci.0: index=0,
\ net00: index=0,
virtio-net-pci.1: index=0,
\ net01: index=0,
virtio-net-pci.2: index=0,
\ net02: index=0,
virtio-net-pci.3: index=0,
\ net03: index=0,
virtio-net-pci.4: index=0,
\ net04: index=0,
virtio-net-pci.5: index=0,
\ net05: index=0,
This allowed the multi nic setup to DHCP on each nic and obtain the same IP address since the default user/slirp network config is the same (10.0.2.0/24, dhcpstart= 10.0.2. 15).
If we use -net user -net nic (legacy and depricated options) we can obtain a configuration with one slirp/user network services for a hub of devices but that means we lose some configuration ability in xkvm around use of -netdev and -device. Here is how we got the hub mode working though:
-netdev hubport, id=hubport0, hubid=0 \ id=hubport1, hubid=0 \ net-pci, netdev= hubport0 \ net-pci, netdev= hubport1 \
-netdev hubport,
-device virtio-
-device virtio-
Produces a qemu network like this:
(qemu) info network type=user, net=10. 0.3.0,restrict= off type=nic, model=virtio- net-pci, macaddr= 52:54:00: 12:34:57 type=nic, model=virtio- net-pci, macaddr= 52:54:00: 12:34:56
hub 0
\ hub0port2: user.0: index=0,
\ hubport1: virtio-net-pci.1: index=0,
\ hubport0: virtio-net-pci.0: index=0,