old blog,

HOWTO: Enabling Bridging for Libvirtd QEMU

Izhar Firdaus Izhar Firdaus Follow Support Feb 15, 2008 · 1 min read
HOWTO: Enabling Bridging for Libvirtd QEMU
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.
I need to implement an SNMP setup for Inigo, and I need a number of virtual machines for understanding SNMP and for testing and exploring possible solutions. Before this, I used Xen through virt-manager for my virtualization needs, but recently it feels like its more pain in the ass when I need to install various distro and OSes on the VM to test. Plus, Xen caused some weird problems which I don't really understand (one of it are the Xen bridging, on random, refused to work after reboot). So, I switched to use the normal kernel with Qemu instead to avoid the headache.

Thanks to Jonathan (daMaestro), I got the Qemu bridge working. The howto I followed from watzmann.net does not work for me because of what I believe some missing details for me understand the setup and set it properly.

Creating a Bridge

Lets assume we want to create a bridge called br0, which will be bridged to eth0. The host will be using a static IP 192.168.0.20 on a /24 network, with a gateway 192.168.0.1.

Edit /etc/sysconfig/network-scripts/ifcfg-br0. Change it to be similar to this.


DEVICE=br0
BOOTPROTO=static
IPADDR=192.168.0.20
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
TYPE=Bridge


Then, edit /etc/sysconfig/network-scripts/ifcfg-eth0 to this.


DEVICE=eth0
HWADDR=$MACADDRESS
ONBOOT=yes
BRIDGE=br0


(Replace $MACADDRESS with the MAC address of your network card.)

Afterward, restart the network `/sbin/service network restart`

From this point, you should be able to select the bridge when you are creating a new VM through virt-manager.

Firewall

You will need to set br0 as a trusted interface through system-config-firewall before you'll be able to use the network.

Yay, now I feel much more comfortable on Qemu.
Written by Izhar Firdaus Follow Support
I'm a system architect, data engineer and developer advocate with passion in Free / Open Source software, entrepreneurship, community building, education and martial art. I take enjoyment in bridging and bringing together different FOSS technologies to help businesses and organizations utilize IT infrastructure to aid and optimize their business and organizational process.

An Open Letter for the Rector of PETRONAS University of Technology

DISCLAIMER:THIS OPEN LETTER IS MY OWN OPINION, FROM MY OWN POINT OF VIEW OF LOOKING AT THE CURRENT STATE OF AFFAIRS IN UTP. IT DOES N...

In old blog, Feb 12, 2008

« Previous Post

Why I wrote the open letter to rector

My Open Letter to UTP Rector generated a lot of response from UTP, especially from the students.Some people asked me why I am doing t...

In old blog, Feb 22, 2008

Next Post »