[Lxc-users] lxc and openvswitch

Serge Hallyn serge.hallyn at canonical.com
Sun May 27 16:04:23 UTC 2012


Quoting Eslam Mamdouh (emamdouh at cloud9ers.com):
> Hi all,
> i'm a little bit newbie in lxc and i'd like to know how to use lxc with
> openvswitch to be able to connect from an lxc container hosted on host
> machine 1 to another one hosted on host machine two as this picture
> describes

Heh, I was just playing with this on friday.  Doing it by hand for net
namespaces with veth tunnels worked beautifully.  For some reason my
cloud-init script to automatically set up two containers like this
wasn't yet working, but the idea should be to simply have a second
lxc.network section for your container's eth1 which connects your
containers over a GRE tunnel.  Have a lxc.network.script.up =
/etc/lxc/ovsup script which does the "ovs-vsctl add-port br0 \$5" where
of course br0 is your ovs switch on the host with a gre tunnel connected
to the remote_ip of the other host.

(I'll play with it more tomorrow and post a working script to set
up two machines from scratch with containers talking to each other
over a subnet hopefully by tomorrow night)

-serge




More information about the lxc-users mailing list