Hi Gavin,
I don't know if it's the usual way, but it works for me:
On a Centos you can configure like this
kvm:/etc/sysconfig/network-scripts# cat ifcfg-eth0
# With no address on the interface
DEVICE=eth0
HWADDR=00:15:17:FF:FF:FF
BOOTPROTO=static
BRIDGE=kvmbr0
ONBOOT=yes
IPV6INIT=no
IPV6_AUTOCONF=no
kvm:/etc/sysconfig/network-scripts# cat ifcfg-kvmbr0
# With no address on the bridge
DEVICE=kvmbr0
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
IPV6INIT=no
IPV6_AUTOCONF=no
kvm:/etc/sysconfig/network-scripts# cat ifcfg-kvmbr0
# With static address on the bridge
DEVICE=kvmbr0
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
IPADDR=xxx.xxx.xxx.xxx
NETMASK=255.255.255.0
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6ADDR=xx:xx:xx:xx::xx
IPV6_DEFAULTGW=xx:xx:xx:xx::xx
On Debian/Ubuntu :
kvm:/etc/network# cat interfaces
# The primary network interface (no address)
auto eth0
iface eth0 inet manual
# The primary bridge interface (DHCP configured)
auto kvmbr0
iface kvmbr0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
You will need at least one bridge with an IP to be able to connect to
the KVM host. The bridge will cleverly see if the incoming packets are
for the host or the guests and will forward accordingly.
Hope that helps,
Cheers,
Jef
On 18/07/11 10:59, Gavin McCullagh wrote:
> Hi,
>> I'm looking to set up a KVM with bridge mode networking so that the VM is
> not NATted and is directly available on the local network alongside the
> host OS, eg host OS at 10.1.10.2/24 (on eth0) and VM at 10.1.10.3/24 (on
> its eth0, bridged onto the host eth0), both available from a remote host on
> the same subnet or on another subnet via a router.
>> I'm a bit new to bridge setup and the examples I've found all seem to miss
> out key details -- they just tell you arbitrary things to type but without
> explaining the background so I can tailor it. I presume if I set br0 on
> the host OS to 10.1.10.3/24 I will encounter routing issues. I guess I
> could use eg /31 or /32 netmasks which would avoid that.
>> Does one set IP addresses on the host OS bridge interface? Do you use the
> same addresses or different to the VM interface? What is the usual way of
> doing this?
>> Answers or good references would be most welcome.
>> Thanks,
> Gavin
>
--
Jean-Francois Bucas
IT System Administrator
School of Theoretical Physics
Dublin Institute for Advanced Studies
10 Burlington Road
Dublin 4
Tel. +353 1 614 0132
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!