25 Dec 2009

Fiddling with bridges for kvm on ubuntu (9.04)

For most virtualization technologies, bridged network interfaces are usefull if a host has to be accessible from outside (ssh for example). Bridging makes this possible.

Install bridge-utils

Disable your primary network interface, create a bridge and link the bridge to the original interface:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
#    address 10.0.0.33
#    network 10.0.0.0
#    netmask 255.255.255.0
#    gateway 10.0.0.1

#auto eth1
iface eth1 inet dhcp

auto vnet0
iface vnet0 inet static
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
address 10.0.0.33
network 10.0.0.0
netmask 255.255.255.0
gateway 10.0.0.1