Here is a possible solution that is working for me...
I'm assuming that the host server is connected to the public network through eth0 with public ip address 10.0.0.2 (10.0.0.0/24). Also make sure that network-manager is removed/disabled.
On the host server set a bridge interface br0 (or whatever)
Install needed packages
Code:
aptitude install bridge-utils
Edit network configuration
Code:
vim /etc/network/interfaces
Code:
...
# Main Interface
auto eth0
iface eth0 inet manual
# KVM Bridge
auto br0
iface br0 inet static
address 10.0.0.2
netmask 255.255.252.0
network 10.0.0.0
gateway 10.0.0.1
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
...
Restart your network
Code:
invoke-rc.d networking restart
Network bridge is configured. When you create a new guest, set it to use bridge br0. The static public ip 10.0.0.3-254 can then be configured on the guest machines and will have public access. The qemu xml will look something like this:
Code:
...
<interface type='bridge'>
<mac address='GUEST-MAC-ADDRESS'/>
<source bridge='br0'/>
<model type='virtio'/>
</interface>
...
Hope that helps.
vSolo - Sunder Design
Bookmarks