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.<br><br>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.<br>
<br>I'll try if I may be outlining the steps taken so far followed by the symptoms experienced.<br><br>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.<br>
<br>#### START /etc/network/interfaces on HOST ####<br><br>auto eth0<br>iface eth0 inet manual<br><br>auto br0<br>iface br0 inet static<br> address 88.208.249.44<br> network 88.208.249.0<br> netmask 255.255.252.0<br>
gateway 88.208.248.1<br> bridge_ports eth0<br> bridge_stp off<br> bridge_fd 0<br> bridge_maxwait 0<br><br>#### END /etc/network/interfaces on HOST ###<br><br>2) The virtual machine was created on the host using the following:<br>
<br>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<br>
<br>3) The VM can be connected to at this point it was then configured with the following /etc/network/interfaces<br><br>## START /etc/network/interfaces on guest ##<br><br>auto eth0<br>iface eth0 inet static<br> address 88.208.249.45<br>
netmask 255.255.252.0<br> network 88.208.248.0<br> broadcast 88.208.251.255<br> gateway 88.208.248.1<br><br>## END /etc/network/interfaces on guest ##<br><br><br>Symptoms<br>----------------<br>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.<br>
<br>On the host when I do 'ifconfig' I get the following output.<br><br># ifconfig<br>br0 Link encap:Ethernet HWaddr 00:19:99:70:5a:61 <br> inet addr:88.208.249.44 Bcast:88.208.251.255 Mask:255.255.252.0<br>
inet6 addr: fe80::219:99ff:fe70:5a61/64 Scope:Link<br> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br> RX packets:5863 errors:0 dropped:0 overruns:0 frame:0<br> TX packets:2034 errors:0 dropped:0 overruns:0 carrier:0<br>
collisions:0 txqueuelen:0 <br> RX bytes:378572 (378.5 KB) TX bytes:1465549 (1.4 MB)<br><br>eth0 Link encap:Ethernet HWaddr 00:19:99:70:5a:61 <br> inet6 addr: fe80::219:99ff:fe70:5a61/64 Scope:Link<br>
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1<br> RX packets:19595 errors:0 dropped:0 overruns:0 frame:0<br> TX packets:4387 errors:0 dropped:0 overruns:0 carrier:0<br> collisions:0 txqueuelen:100 <br>
RX bytes:1573365 (1.5 MB) TX bytes:2319893 (2.3 MB)<br> Memory:fc400000-fc420000 <br><br>lo Link encap:Local Loopback <br> inet addr:127.0.0.1 Mask:255.0.0.0<br> inet6 addr: ::1/128 Scope:Host<br>
UP LOOPBACK RUNNING MTU:16436 Metric:1<br> RX packets:3089 errors:0 dropped:0 overruns:0 frame:0<br> TX packets:3089 errors:0 dropped:0 overruns:0 carrier:0<br> collisions:0 txqueuelen:0 <br>
RX bytes:1810345 (1.8 MB) TX bytes:1810345 (1.8 MB)<br><br>vnet0 Link encap:Ethernet HWaddr ce:59:6f:23:ef:e8 <br> inet6 addr: fe80::cc59:6fff:fe23:efe8/64 Scope:Link<br> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1<br>
RX packets:115 errors:0 dropped:0 overruns:0 frame:0<br> TX packets:2295 errors:0 dropped:0 overruns:0 carrier:0<br> collisions:0 txqueuelen:500 <br> RX bytes:15107 (15.1 KB) TX bytes:564732 (564.7 KB)<br>
<br><br><br><br>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.<br><br>The /etc/libvirt/qemu/testbox.xml file is as follows <br><br>
## Start testbox.xml ###<br><br><domain type='kvm'><br> <name>testbox</name><br> <uuid>1b625323-0a4e-b725-b60d-a66e11472e44</uuid><br> <memory>524288</memory><br> <currentMemory>524288</currentMemory><br>
<vcpu>1</vcpu><br> <os><br> <type arch='x86_64' machine='pc'>hvm</type><br> <boot dev='hd'/><br> </os><br> <features><br> <acpi/><br>
<apic/><br> <pae/><br> </features><br> <clock offset='utc'/><br> <on_poweroff>destroy</on_poweroff><br> <on_reboot>restart</on_reboot><br> <on_crash>restart</on_crash><br>
<devices><br> <emulator>/usr/bin/kvm</emulator><br> <disk type='file' device='disk'><br> <source file='/home/vm_disks/testbox.qcow2'/><br> <target dev='hda' bus='ide'/><br>
</disk><br> <disk type='file' device='cdrom'><br> <target dev='hdc' bus='ide'/><br> <readonly/><br> </disk><br> <interface type='bridge'><br>
<mac address='54:52:00:7b:96:f0'/><br> <source bridge='br0'/><br> </interface><br> <serial type='pty'><br> <target port='0'/><br> </serial><br>
<console type='pty'><br> <target port='0'/><br> </console><br> <input type='mouse' bus='ps2'/><br> <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/><br>
</devices><br></domain><br><br>## END testbox.xml ##<br><br>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.<br><br>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.<br>
<br>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.<br><br>Kind Regards,<br>Jamie. <br><br><br>