[ovs-discuss] Openswitch VM to VM traffic switching

Praveen Reguraman preguraman at gmail.com
Thu May 13 20:09:23 UTC 2010

Hi Todd,
            Thanks for your email. I tried your script and still ran into
the same issue. But I think libvirt also uses a similar way of trying to
bring the interface up and I had a problem in the creation of the VM since
it was failing on TAP/TUN interface. Turns out that it started working fine
when I installed it in bridge compatible mode and used the brctl commands.
May be the br_compat.ko brought in the TUN/TAP drivers for the kernel, which
was probably not there. I had tried 'modprobe tun' and had a fatal error
saying 'tun not found'. However, I learned that with Ubuntu Lucid Lynx, TUN
module is built into the kernel. Somehow, the whole thing was confusing to
me when it worked.
Should it be that Openvswitch is always in br_compat mode? Or Could I use
some kind of fake bridge and work this around?


On Wed, May 12, 2010 at 9:43 AM, Todd Deshane <deshantm at gmail.com> wrote:

> Hi Praveen,
> Comments inline.
> On Tue, May 11, 2010 at 2:36 AM, Praveen Reguraman <preguraman at gmail.com>
> wrote:
> > Hi,
> >     I am beginner with Openvswitch and am trying to configure VMs and
> switch
> > traffic between them.
> > My setup:
> >               Ubuntu v 10.0.4 with KVM and virt-manager 0.8.2
> >               Openvswitch 0.99.2 - Compiled and installed including
> kernel
> > module. While installing the Openvswitch kernel module, I had disabled
> linux
> > bridge module.
> > Config:
> >           I have created br0 with Openvswitch using 'ovs-vsctl add-br
> br0'
> > and added eth0 to this bridge. I also created another bridge br1. I used
> > 'ifconfig' to configure an IP to the bridge interfaces.
> > I am using virt-manager to create two instances of Ubuntu virtual
> machines.
> > While trying to create virtual machine, am trying to associate the
> virtual
> > NICs of the VMs to one of these bridges br0/br1. It consistently fails
> > throwing an error,
> > 'br0 not a TAP device'. and VM install fails. Is it somehow trying to use
> > any user space module? Or anything wrong with the way I create the
> bridge?
> I think the problem that you are running into is with how libvirt
> brings up the networking on VMs.
> Particularly, with qemu/KVM guests a qemu-ifup or kvm-ifup script is used.
> My qemu-ifup and down scripts are below, but I was using 0.99.1, so I
> think that you might
> want to instead of working with the config file, run the appropriate
> ovs-vsctl add-port command.
> My guess is that it would be something like:
> ovs-vsctl add-port ${switch} $1
> (instead of the echo into the config file as I do below).
> Similarly, you will need to del-port on qemu-ifdown
> You man want to try using kvm directly and passing custom scripts manually
> something like:
> -net tap,script=custom-qemu-ifup,downscript=custom-qemu-ifdown
> ***qemu-ifup***
> #!/bin/sh
> switch='br0'
>  '''sudo''' /sbin/ifconfig $1 up
> echo "bridge.${switch}.port=$1" | sudo tee -a /etc/ovs/ovs-vswitchd.conf
> exit 0
> ***qemu-ifdown***
> #!/bin/sh
> switch=externalbr
> sed -i "/$1/d" /etc/ovs/ovs-vswitchd.conf
> /sbin/ifconfig $1 down
> > I would like to create two VMs on bridge br1 and assign IPs to the
> virtual
> > NICs and be able to ping the other VM as a basic test.
> > Can someone help me out?
> I should be able to test myself soon, but let us know if you get it
> working and we can try to help out more.
> Thanks,
> Todd
> --
> Todd Deshane
> http://todddeshane.net
> http://runningxen.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20100513/bcabfa95/attachment-0001.html>

More information about the discuss mailing list