I've been playing with KVM on Ubuntu Server 9.10 - I've successfully got
machines working however try as I might I cannot get the network bridge to
work.

I've been trying this for a very long time and was putting off posting this
but I'm getting to the end of my tether and it's holding me up.

I'll try if I may be outlining the steps taken so far followed by the
symptoms experienced.

1) The host machine has a br0 interfaced bridged to eth0. The config file in
/etc/network/interfaces on the host reads as follows - this seems to work, I
have internet access from the host etc.

#### START /etc/network/interfaces on HOST ####

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
        address 88.208.249.44
        network 88.208.249.0
        netmask 255.255.252.0
        gateway 88.208.248.1
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0

#### END /etc/network/interfaces on HOST ###

2) The virtual machine was created on the host using the following:

virt-install --connect qemu:///system -n nameserver -r 512 --vcpus=1 -f
/home/vm_disks/testbox.qcow2 -s 4 -c
/home/vm_disks/ubuntu-9.04-server-i386.iso --vnc --noautoconsole --os-type
linux --accelerate --network=bridge:br0 --hvm

3) The VM can be connected to at this point it was then configured with the
following /etc/network/interfaces

## START /etc/network/interfaces on guest ##

auto eth0
iface eth0 inet static
    address 88.208.249.45
    netmask 255.255.252.0
    network 88.208.248.0
    broadcast 88.208.251.255
    gateway 88.208.248.1

## END /etc/network/interfaces on guest ##


Symptoms
----------------
I can now ssh from the host into the guest (from the host) and from the
guest to the host, however try as I might I cannot get the guest to access
the outside world or the host to pass packets to the guest.

On the host when I do 'ifconfig' I get the following output.

# ifconfig
br0       Link encap:Ethernet  HWaddr 00:19:99:70:5a:61
          inet addr:88.208.249.44  Bcast:88.208.251.255  Mask:255.255.252.0
          inet6 addr: fe80::219:99ff:fe70:5a61/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5863 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2034 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:378572 (378.5 KB)  TX bytes:1465549 (1.4 MB)

eth0      Link encap:Ethernet  HWaddr 00:19:99:70:5a:61
          inet6 addr: fe80::219:99ff:fe70:5a61/64 Scope:Link
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:19595 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4387 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:1573365 (1.5 MB)  TX bytes:2319893 (2.3 MB)
          Memory:fc400000-fc420000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3089 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3089 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1810345 (1.8 MB)  TX bytes:1810345 (1.8 MB)

vnet0     Link encap:Ethernet  HWaddr ce:59:6f:23:ef:e8
          inet6 addr: fe80::cc59:6fff:fe23:efe8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:115 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2295 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:15107 (15.1 KB)  TX bytes:564732 (564.7 KB)




As you can see, the bridge is working and when I start the VM from virsh#
the vnet0 adapter is created, however no tap0 is being created.

The /etc/libvirt/qemu/testbox.xml file is as follows

## Start testbox.xml ###

<domain type='kvm'>
  <name>testbox</name>
  <uuid>1b625323-0a4e-b725-b60d-a66e11472e44</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/home/vm_disks/testbox.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='file' device='cdrom'>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <interface type='bridge'>
      <mac address='54:52:00:7b:96:f0'/>
      <source bridge='br0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
  </devices>
</domain>

## END testbox.xml ##

The MAC address used for that guest VM is unique as it was created by
virt-install. I have also tried several VM's to no avail.

As far as I am aware you should not need ipv4 forwarding enabled in the
Kernel for bridged networks however despite this it is enabled.

If any of you could shed any light on this issue (since I can't seem to find
anyone else with the issue) it would be most appreciated.

Kind Regards,
Jamie.
-- 
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam

Reply via email to