[libvirt] macvtap nt working on kvm

Hi all, My test environment Host os=rhel6.1 Guest os = rhel6.1 Libvirt=0.8.7 Kvm hypervisor I have made this entry in guest xml file <interface type='direct'> <source dev='eth0' mode='bridge'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> Now when I start the guest #virsh start guest Following macvtap0 is created on host and is shown below #ip link show macvtap0 51: macvtap0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 500 link/ether 52:54:00:55:AE:B5brd ff:ff:ff:ff:ff:ff but when the guest is up and I try to perform # ifup eth0 eth0 has same mac address as that of macvatap0 that is 52:54:00:55:AE:B5 due to this guest is not able to get dhcp address nor static ip address is working. Please let me know how macvtap work on kvm. DISCLAIMER: ----------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or NECHCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of NECHCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. . -----------------------------------------------------------------------------------------------------------------------

On 12/14/2011 07:40 AM, Amit Tewari wrote:
Hi all,
My test environment
Host os=rhel6.1
Guest os = rhel6.1
Libvirt=0.8.7
Kvm hypervisor
I have made this entry in guest xml file
<interface type='direct'>
<source dev='eth0' mode='bridge'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
Now when I start the guest
*#virsh start guest*
Following macvtap0 is created on host and is shown below
#*ip link show macvtap0*
51: macvtap0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 500
link/ether 52:54:00:55:AE:B5brd ff:ff:ff:ff:ff:ff
but when the guest is up and I try to perform
**
*# ifup eth0*
*eth0 has same mac address as that of macvatap0 that is 52:54:00:55:AE:B5*
**
*due to this guest is not able to get dhcp address nor static ip address is working*.
That is not the reason your guest is unable to get an IP address. It is normal behavior for eth0 on the guest to have the same MAC address as the macvtap device on the host.
Please let me know how macvtap work on kvm.
Have you opened a ticket with Red Hat support? I don't recall details, but know that there were at least problems with other modes of macvtap that were not working until 6.2.

On 12/14/2011 07:40 AM, Amit Tewari wrote:
Hi all,
My test environment
Host os=rhel6.1
Guest os = rhel6.1
Libvirt=0.8.7
Kvm hypervisor
I have made this entry in guest xml file
<interface type='direct'>
<source dev='eth0' mode='bridge'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
Now when I start the guest
*#virsh start guest*
Following macvtap0 is created on host and is shown below
#*ip link show macvtap0*
51: macvtap0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 500
link/ether 52:54:00:55:AE:B5brd ff:ff:ff:ff:ff:ff
but when the guest is up and I try to perform
**
*# ifup eth0*
*eth0 has same mac address as that of macvatap0 that is 52:54:00:55:AE:B5*
**
*due to this guest is not able to get dhcp address nor static ip address is working*.
Please let me know how macvtap work on kvm.
I have tried your setup on my machine with the following host configuration: # brctl show bridge name bridge id STP enabled interfaces br0 8000.001a64d00016 no eth0 virbr0 8000.000000000000 yes If I use the configuration as you have shown it doesn't work for me, either. However, if I use <source dev='br0' mode='bridge'/> then it works as expected. Do you happen to have a similar configuration on the host with the interface the macvtap device wants to use as 'source' being bridged? Stefan

On 12/14/2011 02:26 PM, Stefan Berger wrote:
On 12/14/2011 07:40 AM, Amit Tewari wrote:
Hi all,
My test environment
Host os=rhel6.1
Guest os = rhel6.1
Libvirt=0.8.7
Kvm hypervisor
I have made this entry in guest xml file
<interface type='direct'>
<source dev='eth0' mode='bridge'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
Now when I start the guest
*#virsh start guest*
Following macvtap0 is created on host and is shown below
#*ip link show macvtap0*
51: macvtap0@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 500
link/ether 52:54:00:55:AE:B5brd ff:ff:ff:ff:ff:ff
but when the guest is up and I try to perform
**
*# ifup eth0*
*eth0 has same mac address as that of macvatap0 that is 52:54:00:55:AE:B5*
**
*due to this guest is not able to get dhcp address nor static ip address is working*.
Please let me know how macvtap work on kvm.
I have tried your setup on my machine with the following host configuration:
# brctl show bridge name bridge id STP enabled interfaces br0 8000.001a64d00016 no eth0 virbr0 8000.000000000000 yes
If I use the configuration as you have shown it doesn't work for me, either. However, if I use
<source dev='br0' mode='bridge'/>
then it works as expected. Do you happen to have a similar configuration on the host with the interface the macvtap device wants to use as 'source' being bridged?
Interesting. So you're saying that once the physical device is attached to a bridge, a macvtap attached to that device no longer works? That's useful to know :-)
participants (3)
-
Amit Tewari
-
Laine Stump
-
Stefan Berger