LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Cannot set mac address with qemu (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/cannot-set-mac-address-with-qemu-4175490716/)

insectiod 01-09-2014 11:24 AM

Cannot set mac address with qemu
 
According to the qemu documentation, I should be able to set the mac address for at network card by adding macaddr=MACADDR to the device option.

So I do this:
Code:

>>>qemu-system-i386 -netdev tap,ifname=tap0,id=mynet0,script=no -device i82559c,netdev=mynet0,macaddr=00:00:00:11:11:11 -m 1024 slack.vmdk
qemu-system-i386: -device i82559c,netdev=mynet0,macaddr=00:00:00:11:11:11: Property '.macaddr' not found
/etc/qemu-ifdown: could not launch network script

Maybe it's not possible to set mac when you're using tap as network backend? I seem to get the same mac address without specifying. But I would like to know if it's possible to set it.

I'm using qemu 1.7.0

smallpond 01-09-2014 12:17 PM

When I run:
Code:

qemu-system-x86_64 -net nic,model=help
qemu: Supported NIC models: ne2k_pci,i82551,i82557b,i82559er,rtl8139,e1000,pcnet,virtio

I don't see i82559c, maybe you have a different set. I use e1000.

insectiod 01-09-2014 12:27 PM

Thanks, I tried e1000 and had the same problem.

Edit:
I don't see the device with the command you gave either, but I see it if I run this, and look for Network devices.
Code:

qemu-system-i386 -device \?

insectiod 01-12-2014 10:07 PM

It seems the macaddr property changed name to mac so this works
Code:

qemu-system-i386 -netdev tap,ifname=tap0,id=mynet0,script=no -device i82559c,netdev=mynet0,mac=00:00:00:11:11:11 -m 1024 slack.vmdk


All times are GMT -5. The time now is 12:39 AM.