On 04/07/2017 01:59 AM, duhongwei wrote:
> Hi,
> 
> I'm setting up a layer 2 network over two virtual machines using
> OpenvSwitch-2.5.2, like the picture shows below.
> 
> After reading the ovs official tutorials and some other articles, I've
> tried the following cmds on each virtual machine:
> 
> |# on vm1 ip link add dev veth0 type veth peer name veth1 ip link add dev
> veth3 type veth peer name veth4 ip netns add ns0 ip netns add ns1 ip
> link set veth0 netns ns0 ip link set veth3 netns ns1 ip link set veth1
> up ip link set veth4 up ip netns exec ns0 ip link set veth0 up ip netns
> exec ns1 ip link set veth3 up ip netns exec ns0 ip addr add 10.0.0.1/24
> dev veth0 ip netns exec ns1 ip addr add 10.0.0.3/24 dev veth3 ovs-vsctl
> add-br br0 ovs-vsctl add-port br0 veth1 ovs-vsctl add-port br0 veth4
> ovs-vsctl add-port br0 vx1 -- set Interface vx1 type=vxlan
> options:remote_ip=192.168.99.101 # on vm2 ip link add dev veth0 type
> veth peer name veth1 ip netns add ns0 ip link set veth0 netns ns0 ip
> link set veth1 up ip netns exec ns0 ip link set veth0 up ip netns exec
> ns0 ip addr add 10.0.0.2/24 dev veth0 ovs-vsctl add-br br0 ovs-vsctl
> add-port veth1 ovs-vsctl add-port br0 vx1 -- set Interface vx1
> type=vxlan options:remote_ip=192.168.99.100 |
> 
> Turns out,
> 
> |#vm1 ip netns exec ns0 ping 10.0.0.2| failed.
> 
> Even worse,
> 
> |#vm1 ip netns exec ns0 ping 10.0.0.3| failed.
> 
> However, if I delete the vxlan port, on vm1, ping from veth0 to veth3
> works well as expected.
> 
> Am I missing anything so that this whole overlay network just won't behave?


I just replicated your test environment (using VirtualBox with Vagrant,
see <https://github.com/lowescott/learning-tools/ovs-ovn/ovs-simple/>
for the Vagrant environment I used), and I was able to ping between
namespaces without any issues. That includes pinging between namespaces
on the same VM as well as pinging between namespaces on different VMs.

Here's the output of `ovs-vsctl show` from VM1:

929b24f3-4a7b-4036-9ee7-22870a3bdf80
    Bridge "br0"
        Port "veth1"
            Interface "veth1"
        Port "veth4"
            Interface "veth4"
        Port "br0"
            Interface "br0"
                type: internal
        Port "vx1"
            Interface "vx1"
                type: vxlan
                options: {remote_ip="192.168.100.102"}
    ovs_version: "2.5.2"

The output of `ovs-vsctl show` on VM2 is pretty much identical, except
for the configuration of the vx1 port and the specific veth interfaces
that are connected to the bridge.

You'll need to ensure that VM1 can communicate with VM2 via the
192.168.100.x addresses. If that doesn't work, the VXLAN tunnel won't
come up and your namespace-to-namespace ping tests will fail.

Hope this helps!

-- 
Scott

_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to