Skip to contentSkip to conversation

QEMU - macaddr= does not work - HELP

Qemu-devel Albert Graham 1 participant 2 messages Nov 11, 2007

lore
Share & tools
lore
#0 lore raw

I'm trying to get the macaddr= parameter to work (with -net tap), but it does not seem to pass the specified MAC address to the underlying virtual NIC (in my case ne2000 pci using)

This would not normally be required for a single instance if QEMU, but I want multiple instances per server as well as across multiple machines. Ths MAC is what the DHCP server keys off and I want to control the IP address of the guests via DHCP.

I'm using Fedora Core 6 as a HOST and Fedora 8 as guests.

The guest ifcfg-eth0 looks like this:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

Note, the HWADDR= parameter is removed.

I've tested this with 0.8.2 (latest version for Fedora 6) x86

I also compiled the 0.9.0 source and that had the same results - i.e. it did not work.

The problem is that whatever MAC address is used via the macaddr= parameter, it is ignore and using "info network" via the QEMU monitor (CTRL+ALT+2) shows the original hard coded "52:54:00:12:34:56" instead of the one that I specified.

You should note that I am only using a single virtual NIC per guest, and I imagine that using multiple NICs in a guest DOES allow you to set the MAC address, but I have not tested this.

I'm pretty sure this is a BUG in the code.

How can I solve this problem ?

Thanks in Advance.

Albert.

ps. Also, the latest kernel-kqemu panics Fedora 8 - just after compressing kernel.. (and as such I do not use kqemu).

#1 lore raw

Sorry, I found the problem, I was appending the "macaddr=" parameter to the "-net tap" options instead of the "-net nic" options as documented :(

e.g.

qemu -boot c -hda /hd1 -m 1024 -localtime -net nic -net tap,macaddr1=52:54:00:12:34:01

instead of

qemu -boot c -hda /hd1 -m 1024 -localtime -net nic,macaddr1=52:54:00:12:34:01 -net tap

Thanks.

Albert.

Quoted 39 lines · Albert Graham

I'm trying to get the macaddr= parameter to work (with -net tap), but it does not seem to pass the specified MAC address to the underlying virtual NIC (in my case ne2000 pci using)

This would not normally be required for a single instance if QEMU, but I want multiple instances per server as well as across multiple machines. Ths MAC is what the DHCP server keys off and I want to control the IP address of the guests via DHCP.

I'm using Fedora Core 6 as a HOST and Fedora 8 as guests.

The guest ifcfg-eth0 looks like this:

DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes

Note, the HWADDR= parameter is removed.

I've tested this with 0.8.2 (latest version for Fedora 6) x86

I also compiled the 0.9.0 source and that had the same results - i.e. it did not work.

The problem is that whatever MAC address is used via the macaddr= parameter, it is ignore and using "info network" via the QEMU monitor (CTRL+ALT+2) shows the original hard coded "52:54:00:12:34:56" instead of the one that I specified.

You should note that I am only using a single virtual NIC per guest, and I imagine that using multiple NICs in a guest DOES allow you to set the MAC address, but I have not tested this.

I'm pretty sure this is a BUG in the code.

How can I solve this problem ?

Thanks in Advance.

Albert.

ps. Also, the latest kernel-kqemu panics Fedora 8 - just after compressing kernel.. (and as such I do not use kqemu).