0

i am having a problem connecting VMs to the bridge interface. My VMs cannot connect to the host and LAN outside the host, when i ping it just say destination host unreachable. it seems that my VM is not connected to the br0 interface. I use redhat 5.6 on the host and centos 6 as VMs

i modify ifcfg-br0 interface with this:

DEVICE=br0 BOOTPROTO=none ONBOOT=yes USERCTL=no TYPE=Bridge GATEWAY=10.1.2.1 NETMASK=255.255.255.0 IPADDR=10.1.2.2 

my server connects to the outside network with bond0 interface, i modify ifcfg-bond0 like this:

DEVICE=bond0 BOOTPROTO=yes ONBOOT=yes USERCTL=no BONDING_OPTS="mode=4 miimon=50" BRIDGE=br0 NM_CONTROLLED=no 

i use bond0 as my KVM guest's network interface

here is ifcfg-eth0 configuration inside my CentOS KVM guest:

DEVICE=eth0 ONBOOT=yes GATEWAY=10.1.2.1 NETMASK=255.255.255.0 IPADDR=10.1.2.22 NAME=eth0 NM_CONTROLLED=no 

here is the output of brctl show:

bridge name bridge id STP enabled interfaces br0 8000.bc305be8c04f no bond0 

i've disable netfilter for bridge interface, restarting network service but no luck if anyone know where the problem is, please your help :'(

3
  • how do you start the VM? it should run the qemu-ifup script which creates the tap device and plugs it into the bridge. post the VM run command (ps -ef |grep qemu) and if you're using libvirt, the domxml contents (virsh dumpxml VMNAME) Commented Aug 26, 2013 at 3:57
  • here is the output of "ps -ef |grep qemu" /usr/libexec/qemu-kvm -hda /usr/kvm_disk/Clinic.disk.xm -cdrom /opt/iso/CentOS-6.4-x86_64-LiveCD.iso -net nic,vlan=0,macaddr=,model=pcnet -net tap,vlan=0,script=/etc/kvm/qemu-ifup-br0 -usb -boot c -m 1024 -no-acpi -vnc :20 -name Clinic -usbdevice tablet -uuid ea852d3d-7adb-6db2-c652-a39672a23d60 -smp 2 -monitor unix:/var/run/kvm/monitors/Clinic,server,nowait -pidfile /var/run/kvm/pids/Clinic -daemonize. i actually use convirture to manage my KVM [link]convirture.com/products_opensource.php[/link] i have the qemu-ifup script Commented Aug 26, 2013 at 7:55
  • when the VM is started, brctl show doesn't show it attached, right? And what does ifconfig -a show, with a running VM? Commented Aug 26, 2013 at 15:04

2 Answers 2

1

First, make sure your host network configuration is working correctly. In your Virtual machine configuration file, use "br0" as the networking interface.

<interface type='bridge'> <mac address='xx:xx:xx:xx:xx:xx'/> <source bridge='br0'/> <model type='virtio'/> </interface> 
1
  • i actually use convirture to manage(create and start) my KVM VMs. I check the convirture configuration for my VM, and i have line specifying the VM to use br0 bridge interface kernel = '/usr/lib/xen/boot/hvmloader' vif = ['mac=$AUTOGEN_MAC, bridge=br0,model=pcnet'] auto_start_vm = 1 extra = '' stdvga = 0 i have asked this problem on convirture forums but still don't get any clue Commented Aug 26, 2013 at 8:05
0
  1. Stop using pcnet, switch to virtio.
  2. -net nic,vlan=1,macaddr=00:1a:4a:01:00:0a,model=virtio -net tap,vlan=1,ifname=vnet0,script=/etc/kvm/qemu-ifup-br0 this is what it should look like normally. You are missing a MAC address in the first section.
2
  • thanks dyasny, i will try it, the problem is we want to use convirture to manage(including starting) VMs and i haven't found it's documentation about how it's vm configuration file affect the qemu-kvm command to start vm. You are right it seems the mac address is not generated and it doesn't add interface, will figure it out and get back here to post the result Commented Aug 28, 2013 at 0:34
  • well, if it's so bad, I'd switch to a system written by the KVM people - oVirt Commented Aug 28, 2013 at 3:09

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.