Friday, November 27, 2009

Getting started with KVM Bridging

I have KVM VMs running on RHEL5.4 but I don't have networking set up yet. My plan was to add another bridge (since virbr0 is a default virtual bridge), connect eth0 to it and then connect my VMs to it with virsh net-define, net-create, ..., etc. However, I seem to have misunderstood something:

[root@kvm-dev0 ~]# brctl addbr virbr1
[root@kvm-dev0 ~]# 

[root@kvm-dev0 ~]# brctl show
bridge name     bridge id               STP enabled     interfaces
virbr0          8000.5690886c5cfa       yes             vnet2
                                                        vnet0
                                                        vnet1
virbr1          8000.000000000000       no
[root@kvm-dev0 ~]#

[root@kvm-dev0 ~]# brctl addif virbr1 eth0
[root@kvm-dev0 ~]# 
Looks like I locked myself out with the command above. Looks like no more playing on this box (yes, it's only a development system) until I get back to the office. Looks like I'll have to do more reading.

Haydn Solomon's KVM blog has an entry on bridged networking. Gavin Carr's blog has a quick guide to KVM bridging.

Update: as per wiki.libvirt.org, adding eth0 to virbr0 is not something that is ever necessary. I did the above out of confusion.

No comments: