Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

Vinllen Chen


ovs vlan gre vxlan实验


  在宿主即创建了一个ovs bridge,连接至宿主机的出口网卡eht0,再创建了两个vport,然后用virtualbox创建两个虚拟机,分别桥接至两个vport。搭建方式可以参考我的上篇博客:使用VirtualBox创建虚拟机连接ovs bridge。网络拓扑如下:
  在没设置vlan tag之前,两个主机是可以相互ping通的。然后设置vlan tag:

ovs-vsctl set port vport1 tag=100  

发现VM1无法ping通至VM2,同理在VM2设置相同的tag后,两个主机可以互相ping通,位于一个vlan下了。可以用ovs-vsctl list port指令查看port的vlan等配置。



  一直跑gre实验跑不通,配置明明ok的,后来查阅官方文档发现ovs gre和linux gre不能共存,ovs在编译时如果发现ip_gre的存在,则不会再次编译ovs gre。

Q: I created a GRE port using ovs-vsctl so why can't I send traffic or  
see the port in the datapath?

A: On Linux kernels before 3.11, the OVS GRE module and Linux GRE module cannot be loaded at the same time. It is likely that on your system the Linux GRE module is already loaded and blocking OVS (to confirm, check dmesg for errors regarding GRE registration). To fix this, unload all GRE modules that appear in lsmod as well as the OVS kernel module. You can then reload the OVS module following the directions in, which will ensure that dependencies are satisfied.  
To use GRE tunneling on Linux 2.6.37 or newer, kernel support for GRE demultiplexing (CONFIG_NET_IPGRE_DEMUX) must be compiled in or available as a module. Also, on kernels before 3.11, the ip_gre module, for GRE tunnels over IP (NET_IPGRE), must not be loaded or compiled in.  




ip netns add red  
ovs-vsctl add-br ovsbr0  
ovs-vsctl add-port ovsbr0 red0 -- set interface red0 type=internal  
ip link set red0 netns red  
ovs-vsctl add-port ovsbr0 vxlan0 -- set interface vxlan0 type=vxlan options:remote_ip=  
ip netns exec red ifconfig red0 up  

vxlan 其实也可以自己搭虚拟机,再测试:


About the author

vinllen chen

Beijing, China



comments powered by Disqus