接口无法通过 ovs vxlan 相互 ping 通

Interfaces cannot ping each other over ovs vxlan

我正在使用 OpenvSwitch-2.5.2 在两个虚拟机上设置第 2 层网络,如上图所示。

看了ovs官方教程和其他一些文章后,我在每台虚拟机上尝试了以下命令:

# 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 br0 veth1
ovs-vsctl add-port br0 vx1 -- set Interface vx1 type=vxlan options:remote_ip=192.168.99.100

原来,

#vm1 ip netns exec ns0 ping 10.0.0.2失败。

更糟的是,

#vm1 ip netns exec ns0 ping 10.0.0.3失败。

但是,如果我删除 vxlan 端口,在 vm1 上,从 veth0 ping 到 veth3 会按预期正常工作。

我是否遗漏了任何东西,导致整个覆盖网络无法正常运行?

通过将我的内核版本从 3.13.x 升级到 4.4.x 来解决。

另一个用户报告的类似问题是 here