Hey,

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?

Thanks and regards,
Neha.