[CentOS] qemu

Sun Jul 4 14:47:40 UTC 2010
Paul Heinlein <heinlein at madboa.com>

On Sun, 4 Jul 2010, mattias jonsson wrote:

> How to use qemu with a network brdige
> The bridge should have dhcp
> Not nat

Assuming you're using the CentOS 5.x libvirt setup, then

1. Create /etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
DELAY=0

2. Edit /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes

3. Edit /etc/libvirt/qemu/networks/default.xml

<network>
   <name>default</name>
   <uuid>...long uuid...</uuid>
   <bridge name="br0" />
   <forward mode="route" dev="eth0"/>
</network>

Restart networking on the host server, then create (or modify) your 
qemu VM.

-- 
Paul Heinlein <> heinlein at madboa.com <> www.madboa.com