Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Bridging with kvm and libvirt in 9.10

  1. #1
    Join Date
    Oct 2005
    Location
    San Francisco
    Beans
    228
    Distro
    Ubuntu 11.04 Natty Narwhal

    Bridging with kvm and libvirt in 9.10

    I've been messing with bridging for a couple of days now and I'm not getting any results.
    The host is 9.10 following the instructions at https://help.ubuntu.com/community/KVM/ on a clean upgraded amd64 server install.
    The bridge works fine and I can ping out from the host. When I create a new guest with python-vm-builder it works just fine using the default network interface, however as soon as I switch it over to bridged the guest can't get an address from dhcp. If I give it a static address the guest can ping the host, but nothing outside of the host (gateway, other lan machines, yahoo).

    I had this working in an 8.10 install on this machine so I know it can be done, I just don't understand what the problem might be. If I import known good guests from the previous install they do not work either so the problem must be on my host install.
    I can't find any relevant log entries anywhere so I don't even know where to start. At this point some validation that SOMEONE has successfully used bridged networking with Karmic, libvirt, and kvm would be a big help.

    Edit: I did a fresh 8.04 install and everything bridged and worked as expected.
    Last edited by uopjohnson; December 31st, 2009 at 08:13 AM.
    Jj
    Registered Linux user #401472

  2. #2
    Join Date
    May 2009
    Beans
    19

    Re: Bridging with kvm and libvirt in 9.10

    Please post the interface section of the VM's xml.

    Thanks.

  3. #3
    Join Date
    Oct 2005
    Location
    San Francisco
    Beans
    228
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Bridging with kvm and libvirt in 9.10

    Have you gotten this working? Because I don't think it is a configuration problem unless something has changed that was not reflected in the server guide or the wiki. But I hope I'm wrong because then I would have this fixed. Let me know if I need to provide anything else.

    On the host:
    Code:
    auto br0 
    iface br0 inet static
     address 10.10.1.51
     netmask 255.255.255.0
     network 10.10.1.0
     broadcast 10.10.1.255
     gateway 10.10.1.1
     bridge_ports eth0
     bridge_fd 9
     bridge_hello 2
     bridge_maxage 12
     bridge_stp off
    ubuntu.xml
    Code:
    <interface type='bridge'>
      <mac address='52:54:00:c1:46:23'/>
      <source bridge='br0'/>
      <model type='virtio'/>
    </interface>
    on the guest
    Code:
    auto br0 
    iface br0 inet static
     address 10.10.1.52
     netmask 255.255.255.0
     network 10.10.1.0
     broadcast 10.10.1.255
     gateway 10.10.1.1
    pinging host from guest
    Code:
    $ ping 10.10.1.51
    64 bytes from 10.10.1.51: icmp_seq=1 ttl=64 time=2.43 ms
    64 bytes from 10.10.1.51: icmp_seq=2 ttl=64 time=2.41 ms
    pinging gateway from guest
    Code:
    From 10.10.1.52 icmp_sql=1 Destination Host Unreachable
    From 10.10.1.52 icmp_sql=2 Destination Host Unreachable
    I also completely disabled the firewall (iptables -F; iptables -X) and shutdown apparmor on the host thinking maybe they were doing something hinky, but still doesn't work.
    Jj
    Registered Linux user #401472

  4. #4
    Join Date
    May 2009
    Beans
    19

    Re: Bridging with kvm and libvirt in 9.10

    Why run a bridge in the guest? There can be many reasons why, I have done so to run a LXC container, UML container, or openvz container on a KVM guest.

    On your guest's network configuration, the example interfaces file you posted does not indicate you are bridging the physical interface of the guest to the internal bridge of the guest.

    Two options exist:
    1. Do away with the bridge inside the guest unless it is needed for other reasons, and assign ip information to eth0 inside the guest
    2. Bridge eth0 to br0 inside the guest so the physical interface will be able to talk to the network

    Typically you would have the following configuration:
    guest eth0 -> host bridge ->host interface

    But you have:
    guest br0 -> no physical guest interface -> host bridge -> host interface

    Your host interface appears to be configured correctly, your networking inside the guest is a bit mangled.

    To move further along in problem determination, please let us know why you are using a bridge inside the guest.

    --thanks

  5. #5
    Join Date
    Oct 2005
    Location
    San Francisco
    Beans
    228
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Bridging with kvm and libvirt in 9.10

    I'm not, I just mistyped that. Hard to copy from virt-viewer. Should have been
    guest /etc/network/interfaces
    Code:
    auto eth0 
    iface eth0 inet static
     address 10.10.1.52
     netmask 255.255.255.0
     network 10.10.1.0
     broadcast 10.10.1.255
     gateway 10.10.1.1
    I have also done
    Code:
    auto eth0 
    iface eth0 inet dhcp
    Which results in the dhcp lookup timing out without ever getting an address.
    Jj
    Registered Linux user #401472

  6. #6
    Join Date
    May 2009
    Beans
    19

    Re: Bridging with kvm and libvirt in 9.10

    Thanks for the updated information.

    <stumped>it really does work </stumped>

    When the guest is up and running, does the bridge on the host see the mac of the guest?
    brctl showmacs br0

    Have you attempted to redefine the guest?
    virsh define path_to_guest_xml

    Is guest eth0 truly guest eth0?
    Does /etc/udev/rules.d/70-persistent-net.rules list eth0 as having the same mac as what the xml states?

  7. #7
    Join Date
    Oct 2005
    Location
    San Francisco
    Beans
    228
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Bridging with kvm and libvirt in 9.10

    So you have successfully done bridging with 9.10?
    When the guest is up and running, does the bridge on the host see the mac of the guest?
    brctl showmacs br0
    Code:
    brctl showmacs br0
      2	52:54:00:c1:46:23	no		   7.04 <- the guest
      2	d2:bb:50:9f:2e:31	yes		   0.00 <- vnet0
    I assume that vnet0 is being created and used to connect the guest to the bridge.

    Have you attempted to redefine the guest?
    Yes. Several times. Even undefined and defined again.

    Is guest eth0 truly guest eth0?
    Does /etc/udev/rules.d/70-persistent-net.rules list eth0 as having the same mac as what the xml states?
    No. But I was messing with the MAC address on the guest to see if that was causing a problem. I edited 70-persistent-net.rules and rebooted the guest, still doesn't work. Does changing this file fix the problem, or is that a symptom of a udev problem somewhere else?

    This is the first time I have seen anything different though so I'm going to build a second guest and see if the MAC address is correct in the new guest.
    Jj
    Registered Linux user #401472

  8. #8
    Join Date
    Oct 2005
    Location
    San Francisco
    Beans
    228
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Bridging with kvm and libvirt in 9.10

    Quote Originally Posted by uopjohnson View Post
    This is the first time I have seen anything different though so I'm going to build a second guest and see if the MAC address is correct in the new guest.
    Ok built a new guest and the udev rules are correct. The previous problem was a result of me messing with the mac address.
    I'm still stymied here and looking for some validation that someone is successfully doing bridging with 9.04 or 9.10.
    Jj
    Registered Linux user #401472

  9. #9
    Join Date
    Oct 2005
    Location
    San Francisco
    Beans
    228
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Bridging with kvm and libvirt in 9.10

    Bump... if anyone has setup bridging with a 9.10 Karmic host please let me know. Just knowing it is possible would be nice.
    Jj
    Registered Linux user #401472

  10. #10
    Join Date
    Apr 2006
    Location
    Windsor, Ontario, Canada
    Beans
    13

    Re: Bridging with kvm and libvirt in 9.10

    bump

    I want to know too. I had this working on 32-bit, but it isn't working on 64-bit.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •