[Novalug] nat bridge for kvm (centos 5.4)
Sean Spurrier
sean.spurrier at gmail.com
Fri Oct 23 17:05:05 EDT 2009
John,
Shooting this off the top of my head because my rhel5.4 box is rebuilding
as we speak, You can do all of this by editing sysconfig scripts or you can
use the utility I cover below ( I am not sure of the default behaviour of
virbr0 but you might be able to modify it to do the same)
you should be able to use a command called brctl (part of bridge-utils
package) to show you existing bridges and if they are tied to a physical
interface.
>brctl show
What I do on my hosts is create a bridge (I call mine br0) and add one of
my physical nics to it (eth0 )
>brctl addbr bro
>brctl addif eth0
Now to have libvirt pickup the bridge restart libvirt
>service libvirt restart
So now you have a bridge which can be assigned to a virt either using
virt-manager
So if you are running DHCP on the network eth0 is attached to a virt
assigned to use br0 will pull its address/dns from there and you can now ssh
into it from another box (better then having a local NAT on the box, and
keeps your iptables rules cleaner)
if you edit your virtual machine config files directly just edit
/etc/libvirt/qemu/<insertguestnamehere>
look for a section that starts with <interface type='bridge' > and you will
want to put the name of your bridge on the line that says
<source bridge='br0'/>
and that should do it for you.
On Fri, Oct 23, 2009 at 7:48 AM, John Holland <jbholland at gmail.com> wrote:
> OK, I just upgrade my CentOS to 5.4 and created a KVM. the vm (happens to
> be freebsd) can access the virbr0 interface on the CentOS from which it can
> to DNS lookups. but it can't reach the outside world. Anyone know what I
> need to do to fix that?
>
> John
>
> --
>
> ______________________________________
>
> Note new email address jbholland at gmail.com
>
> _______________________________________________
> Novalug mailing list
> Novalug at calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug
>
>
--
Sean R. Spurrier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://calypso.tux.org/pipermail/novalug/attachments/20091023/6499a61b/attachment.html
More information about the Novalug
mailing list