[ovs-discuss] Connect two ovs in different vm's that are in different machines

Pedro Maia pedroflow at icloud.com
Fri Sep 11 19:12:53 UTC 2015


Hello,

I’m trying to create a network environment in which i have two Machines each with 1 VM running openvswitch.
Both machines are connected to the same switch and the VMs are using the same vlan which is mapped on that switch.
It’s something like

(((ovs1)VM1)Host1)— switch — (Host2(VM2(ovs2)))

In order to do this i’ve done the following:

Host1
- Created bridge br0 and added eth1
- ovs-vsctl set interface eth1 type=patch
- ovs-vsctl set interface eth1 options:peer=peer2
- ip nets add h1
- ip link add h1-eth1 type veth peer name s1-eth1
- ip link set h1-eth1 nets h1
- ovs-vsctl add-port br0 s1-eth1
- ip netns exec h1 ifconfig h1-eth1 10.1
- ip netns exec h1 ifconfig lo up
- ifconfig s1-eth1 up

And the same on VM2 but with ip 10.2
Then i’ve added flow’s to both switches so that they match on the inport and send to the corresponding outport, in both directions.

 cookie=0x0, duration=4142.923s, table=0, n_packets=0, n_bytes=0, idle_age=4142, in_port=3 actions=output:4
 cookie=0x0, duration=4130.518s, table=0, n_packets=24, n_bytes=1008, idle_age=3, in_port=4 actions=output:3

ovs-ofctl dump-ports-desc br0
OFPST_PORT_DESC reply (xid=0x2):
 3(eth1): addr:00:00:00:00:00:00
     config:     0
     state:      0
     speed: 0 Mbps now, 0 Mbps max
 4(s1-eth1): addr:00:00:00:00:00:00
     config:     0
     state:      0
     current:    10GB-FD COPPER
     speed: 10000 Mbps now, 0 Mbps max
 LOCAL(br0): addr:00:00:00:00:00:00
     config:     PORT_DOWN
     state:      LINK_DOWN
     speed: 0 Mbps now, 0 Mbps max

But when i try ip nets exec h1 ping -c1 10.2 the packet never gets out of VM1. The counters on eth1 never change despite the ones on ovs do.

Surely i’m making something wrong but i can’t figure out what. If someone could point me in the right direction that would be great.

Regards,
Pedro


More information about the discuss mailing list