[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt-users] [ovs-discuss] OpenVswitch with KVM virtual machines



I am running NOX controller with a python script that prints out the
destination mac and the source mac for each packet arriving at the now
controller and then floods it out. So here's what happening:

With em1 connected, all the packets that arrive at em1 are coming to the
controller and printing out the details. However, without em1 connected to
the OVS, when I have the following setup:
 ____                  ____
/ VM1\______br0_______/ VM3\
\____/       |        \____/
             |
            _|_
           /VM2\
           \___/

VM1 & VM2 are of the same subnet. They can ping each other. The ping
packets aren't seen at the controller probably because they are in the
same subnet and they don't need a flow table entry.
VM3 is in a different subnet. So, when I ping from VM1 to VM3 or
viceversa, they aren't reachable to each other. However, the packets do
not arrive at the controller at all. Could you suggest me what might
possibly be wrong.

This is how the bridge looks:

$sudo ovs-vsctl br0 show
Bridge "br0"
	Port "vnet1"
		Interface "vnet1"
	Port "br0"
		Interface "br0"
		type: internal
	Port "vnet0"
		Interface "vnet0"
	Port "vnet2"
		Interface "vnet2"
	ovs_version: "1.4.0"


Thanks and Regards,
Neha



On 7/9/12 11:48 PM, "Neha Jatav" <jneha yahoo-inc com> wrote:

>
>
>On 7/9/12 10:25 PM, "Ben Pfaff" <blp nicira com> wrote:
>
>>On Tue, Jul 10, 2012 at 01:46:07AM +0900, Neha Jatav wrote:
>>> I have KVM installed on my Fedora 17 box. I added the network
>>>interfaces of the virtual machines to the openvswitch bridge as follows:
>>> 
>>>  ____                  ____
>>> / VM1\______br0_______/ em1\
>>> \____/       |        \____/
>>>      |
>>>     _|_
>>> /VM2\
>>> \____/
>>> 
>>> virbr0 is the virtual network switch
>>> VM1 and VM2 are on the same subnet having tap interfaces vnet0 and
>>>vnet1 respectively.
>>> em1 is the default network interface.
>>> 
>>> $sudo ovs-vsctl add-br br0
>>> $sudo ovs-vsctl add-port br0 em1
>>> $sudo ifconfig br0 <ip address of em1>
>>> $sudo ip route del default dev em1
>>> $sudo ip route add default dev br0
>>> (Using the above commands, I was able to connect to the internet)
>>> 
>>> $sudo brctl delif virbr0 vnet0
>>> $sudo ovs-vsctl add-port br0 vnet0
>>> $sudo brctl delif virbr0 vnet1
>>> $sudo ovs-vsctl add-port br0 vnet1
>>> 
>>> $brctl show
>>> bridge name    bridge id        STP enabled    interfaces
>>> virbr0        8000.52540094e45e    yes        virbr0-nic
>>>                             vnet0
>>>                             vnet2
>>> 
>>> $sudo ovs-vsctl show
>>> Bridge "br0"
>>>         Port "vnet1"
>>>             Interface "vnet1"
>>>         Port "br0"
>>>             Interface "br0"
>>>                 type: internal
>>>         Port "vnet0"
>>>             Interface "vnet0"
>>>         Port "em1"
>>>             Interface "em1"
>>>     ovs_version: "1.4.0"
>>> 
>>> $ifconfig em1
>>> em1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
>>>         inet 10.66.97.253  netmask 255.255.254.0  broadcast
>>>10.66.97.255
>>>         inet6 fe80::226:55ff:fe3e:971c  prefixlen 64  scopeid
>>>0x20<link>
>>>         ether 00:26:55:3e:97:1c  txqueuelen 1000  (Ethernet)
>>>         RX packets 194955  bytes 81216930 (77.4 MiB)
>>>         RX errors 0  dropped 0  overruns 0  frame 0
>>>         TX packets 53004  bytes 9477482 (9.0 MiB)
>>>         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
>>>         device interrupt 19  memory 0xf0200000-f0220000
>>> 
>>> $ifconfig br0
>>> br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
>>>         inet 10.66.97.253  netmask 255.0.0.0  broadcast 10.255.255.255
>>>         inet6 fe80::226:55ff:fe3e:971c  prefixlen 64  scopeid
>>>0x20<link>
>>>         ether 00:26:55:3e:97:1c  txqueuelen 0  (Ethernet)
>>>         RX packets 84745  bytes 60302978 (57.5 MiB)
>>>         RX errors 0  dropped 0  overruns 0  frame 0
>>>         TX packets 44528  bytes 7732040 (7.3 MiB)
>>>         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
>>> 
>>> By default, the OVS should act as a MAC-layer learning switch. However,
>>>the VMs which are in the same subnet can ping each other but the VMs
>>>can't ping the host machine (10.66.97.253) & viceversa.
>>> Can you tell me where am I wrong in my approach?
>>
>>You appear to have both OVS bridges and Linux bridges.  Why?  And at
>>least interface vnet0 is configured to be on both the Linux bridge and
>>the OVS bridge.  That can't work.
>
>$sudo brctl delif virbr0 vnet0
>I deleted this interface from virbr0 using the above command and only then
>I connected it to br0. So, vnet0 is only configured on the OVS bridge.
>Same is true with the vnet1.
>
>
>
>>
>>Also you appear to have the same IP address 10.66.97.253 configured on
>>both em1 and br0 (with different netmasks).  That won't work properly
>>either.
>
>I did the following:
>$sudo ifconfig br0 10.66.97.253 netmask 255.255.254.0
>It resulted in losing connection to the internet.
>
>>
>>Did you read the FAQ?  http://openvswitch.org/faq/
>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]