diff --git a/lib/build-vms.nix b/lib/build-vms.nix index efd1ce3b8d3..2c867a0985b 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -108,7 +108,7 @@ rec { virtualisation.qemu.options = lib.flip lib.concatMapStrings interfacesNumbered - ({ first, second }: qemuNICFlags second first ); + ({ first, second }: qemuNICFlags second first m.second); }; } ) diff --git a/lib/qemu-flags.nix b/lib/qemu-flags.nix index 05edc1d2cc6..7831c8f149a 100644 --- a/lib/qemu-flags.nix +++ b/lib/qemu-flags.nix @@ -2,8 +2,8 @@ { - qemuNICFlags = nic: net: - "-net nic,vlan=${toString nic},model=virtio " + + qemuNICFlags = nic: net: machine: + "-net nic,vlan=${toString nic},macaddr=52:54:00:12:${toString net}:${toString machine},model=virtio " + # Use 232.0.1. as the multicast address to connect VMs on # the same vlan, but allow it to be overriden using the # $QEMU_MCAST_ADDR_ environment variable. The test driver