Hi Justin,

Thanks so much or your reply. The reason I had to set an ip address for the
bridge was because I needed the physical host to talk to the vm too(in
addition to vm-to-vm communication). This would happen only if I set an ip
address for the bridge in the same subnet as the vm (in this case
192.168.0.0/24). When I do this, it basically creates a route entry in the
routing table for this subnet, with the output interface for packets
destined for that subnet as br0.

My setup is as follows:

I have 2 physical hosts, that are on the network, with physical interfaces
eth0 for the interface that puts these machines on the public network.

ip address of eth0 on host1 : 10.0.0.1
ip address of eth0 on host2: 10.0.0.2

I start openvswitch now (ovsdb-server and vswitchd processes) and then do
the following:

Now, I add a bridge br0 using the ovs-vsctl command(on both hosts
separately), and add a port to the bridge: tap1 on host1 and tap2 on host2.

Next, I start up 2 virtual machines(in my case, these are UMLs),  one on
host1 and another on host2. Once these are started, I assign an ipaddress to
these vms:
vm1: 192.168.0.14
vm2: 192.168.0.15

Now, I want to ping these vms from my physical host. So, I add an ipaddress
for the bridges on the 2 hosts:

On host1:
ifconfig br0 192.168.0.1/24 up

On host2:
ifconfig br0 192.168.0.2/24 up

Once I do this, I am able to ping the vms from my physical machine.

Next, I set up ab gre tunnel betwen the 2 hosts:

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

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

Once I do this, I am also able to talk between the vms. Also, to answer your
other question, there are no physical interfaces attached to the bridge(only
the virtual tap1 and tap2 are added to the bridge). I avoided attaching the
physical eth0 interface to the bridge because every time I do this, all the
networking just stops on the machine and the machine hangs.

In the above, you can see that right now, my vms are in the same subnet.
Now, I want to change one of the vms to be in a different subnet. i.e.:

vm1: 192.168.0.0/24
vm2: 192.168.10.0/24.

Now, if these vms were on the same host, I am able to get them to
communicate just by* setting up  a default route on each vm for the other
subnet to go through the eth0 interface of the vm *(and also by setting 2 ip
addresses for the bridge, one in each subnet) : Let me know if this is the
right thing to do to get this scenario working ( I was wondering about this
because the traffic is able to reach the other subnet without setting up any
flow rules on the switch, so I was wondering if this is just using linux
bridging or if it is actually using openvswitch switching).

The second case is when the vms are on 2 different hosts: In this case also,
I would need to set up some default route on the vm so that it has a route
in the routing table to reach the other subnet. Apart from this, I would
also have to have the gre tunnel. Do I also need to set up any flow rules
for this with ofctl? What is the correct direction to get this working?

Thanks,
Aish

On Mon, Sep 12, 2011 at 11:35 PM, Justin Pettit <jpet...@nicira.com> wrote:

> On Sep 12, 2011, at 10:13 AM, Aishwarya wrote:
>
> > 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
>
> Why are you setting an IP address on the bridge interfaces?  Maybe I'm not
> clear on your setup.  What devices are the IP addresses on the hosts on?
>  eth0?  Are any physical devices attached to your bridges?
>
> > 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?
>
> Did you change the IP address of the other host?  Without additional L3
> configuration, they're only going to see each other if they're in the same
> subnet.
>
> --Justin
>
>
>
_______________________________________________
discuss mailing list
discuss@openvswitch.org
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to