KVM networking with multiple VM


#1

Hi, i have one question about how to configure the network with multiple Virtual Machines. I have installed ubuntu x64 and i am using KVM-QEMU. I would like to know hot configure virtual network because i want that computers can connet to server services (domain controler for example).

I have this network configuration currently. In /etc/network/interfaces i configured eth0 (physical network card) and br0 (my bridge).

auto eth0
iface eth0 inet static
address 192.168.0.201
network 192.168.0.0
gatewat 192.168.0.1
###############################

building a bridge

###############################
auto br0
iface br0 inet static
address 192.168.0.220
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1
##############################
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
#############################
post-up ip link set br0 address e0:69:95:d1:ce:cf

In /etc/resolv.conf

nameserver 192.168.200.1
nameserver 192.168.0.1

On the other hand, virtual machines has ip 192.168.200.2 and ip 192.168.200.3

I would like to know hot to configure the network correctly because i dont know how. For computers with ip 192.168.0.* must connect to 192.168.200.* I will be happy if i recibe help. I enable ipv4.route command.


#2

I use CentOS so I can’t give you any shortcuts.

Here is the documentation for Ubunu/Debian:

http://wiki.libvirt.org/page/Networking#Debian.2FUbuntu_Bridging

I’ve followed the instructions for CentOS on the same page and have successfully connected 8 virtual machines to a single bridge.

Once you have the bridge setup, each VM that uses that bridge will have network access just as if it had it’s own network card. They don’t care about the settings of the other VMs, the original eth0 or even br0 IP settings. As long as your VM host can connect to the physical network and you’ve created your br0 properly, any of your clients can be configured just as if they had their own network card.

Sorry if I couldn’t give you a real example but I don’t use Ubuntu.