[ovs-discuss] How to get 2 vms on 2 different physical hosts to communicate using openvswitch

Aishwarya aishu85 at gmail.com
Mon Sep 12 17:13:07 UTC 2011


Hi Jesse and openvswitch team,

Thanks for all your suggestions till now. I was able to establish the gre
tunnel between 2 vms located on the same subnet on 2 different hosts. I am
not able to figure out the configuration steps to establish the gre tunnel
when the vms are located in different subnets, from the available
documentation. This is what I have done till now:

host1: ip address: 10.0.0.1
host2: ip address: 10.0.0.2

vm on host1 : 192.168.0.14
vm on host 2: 192.168.0.15

bridge br0 created on host 1: ip address : 192.168.0.1
bridge br0 created on host 2: ip address : 192.168.0.2

As you can see, the ip address I have assigned to the bridge is in the same
subnet as the vm ip addresses.

Also, there is a tap0 interface on both hosts, which is added to the bridge.
Eacg vm (which is a UML), is started using this tap0 interface.

Now, I start openvswitch on both hosts. After adding tap0 top br0, I create
a gre tunnel:

On host 1:
sudo ovs-vsctl add-port br0 gre0 -- set interface gre0 type=gre
options:remote_ip=10.0.0.2

On host 2:
sudo ovs-vsctl add-port br0 gre0 -- set interface gre0 type=gre
options:remote_ip=10.0.0.1

The above works ok. Now, as soon as I change one of the vms to be in a
different subnet, and also the bridge on the host of the vm to be in that
same subnet, what else do I need to change to get it working?
Your help is much appreciated.

Thanks,
Aish



On Fri, Sep 9, 2011 at 9:12 PM, Aishwarya <aishu85 at gmail.com> wrote:

> Hi Jesse,
>
> Sorry to bother you with so many questions. But my question from the
> beginning has been how to configure gre tunnel for vm-to-vm communication
> using openvswitch. I have got it to work for vms in the same subnet, but am
> not able to for vms in different subnets. It would be very helpful to me if
> you could guide me through the configuration steps.
>
> Thanks,
> Aish
>
>
> On Fri, Sep 9, 2011 at 9:03 PM, Jesse Gross <jesse at nicira.com> wrote:
>
>> I think at this point these questions don't particularly relate to
>> Open vSwitch, so perhaps some background reading on general network
>> principles would be appropriate first.
>>
>> On Fri, Sep 9, 2011 at 8:21 PM, Aishwarya <aishu85 at gmail.com> wrote:
>> > Hi Jesse,
>> >
>> > I was doing the following:
>> >
>> > ifconfig eth0 0.0.0.0 up from teh terminal.
>> >
>> > Regarding gre tunnel, if one vm has an ip address of 192.168.0.1/24 and
>> the
>> > other has an ipaddress of 192.168.10.1/24, how do i configure gre to
>> make
>> > these 2 communicate. Right now, i have created a bridge br0 on both
>> physical
>> > hosts, and added an interface of type gre to it. It works as long as
>> both
>> > vms and bridges are in the same subnet. It stops working as soon as i
>> change
>> > ip address of vm2 to be a different subnet.
>> >
>> > Thanks,
>> > AIsh
>> >
>> > On Fri, Sep 9, 2011 at 8:15 PM, Jesse Gross <jesse at nicira.com> wrote:
>> >>
>> >> On Fri, Sep 9, 2011 at 8:08 PM, Aishwarya <aishu85 at gmail.com> wrote:
>> >> > Hi Jesse,
>> >> >
>> >> > Ok.. this solution does not seem to work for me. The problem is that
>> as
>> >> > soon
>> >> > as I take the physical interface eth0 off the network(i.e. assign it
>> an
>> >> > ip
>> >> > of 0), all networking stops for me and the machine hangs. This
>> happens
>> >> > every
>> >> > time.
>> >>
>> >> You should probably use the console to make networking changes.
>> >>
>> >> > I tried the gre tunnel and that seems to work for me. But I want to
>> know
>> >> > if
>> >> > that can be used to connect vms in multiple subnets as well?
>> >>
>> >> Yes.
>> >
>> >
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20110912/23c2e21d/attachment.html>


More information about the discuss mailing list