https://www.sdnlab.com/sdn-guide/14747.html

http://sdnhub.cn/index.php/openv-switch-full-guide/

http://www.rendoumi.com/open-vswitchde-ovs-vsctlming-ling-xiang-jie/

http://www.openvswitch.org/support/dist-docs/ovs-vsctl.8.txt

openvswitch完全使用手册:

https://www.cnblogs.com/puremans/p/6562388.html

很重要很典型的vxlan设置:

http://docs.openvswitch.org/en/latest/howto/userspace-tunneling/

ovs-ofctl 语法

http://www.rendoumi.com/open-vswitchzhong-ovs-ofctlde-xiang-xi-yong-fa/

http://www.openvswitch.org/support/dist-docs/ovs-ofctl.8.txt

摘要:

       priority=value
The priority at which a wildcarded entry will match in comparison to others. value is a number between and , inclusive. A higher value will match before a lower one. An exact-
match entry will always have priority over an entry containing wildcards, so it has an implicit priority value of . When adding a flow, if the field is not specified, the flow's pri‐
ority will default to . OpenFlow leaves behavior undefined when two or more flows with the same priority can match a single packet. Some users expect ``sensible'' behavior, such as more specific flows taking
precedence over less specific flows, but OpenFlow does not specify this and Open vSwitch does not implement it. Users should therefore take care to use priorities to ensure the behavior
that they expect.
       table=number
For flow dump commands, limits the flows dumped to those in the table with the given number between and . If not specified (or if is specified as number), then flows in all tables
are dumped.

关键流表

#add bridge and setup tunnel
ovs-vsctl --may-exist add-br br0
ovs-vsctl add-port br0 vxlantarget1 -- set interface vxlantarget1 type=vxlan options:remote_ip=$TARGET_REMOTE_1 options:local_ip=$VXLAN_LOCALIP options:in_key=flow options:out_key=flow
ovs-vsctl add-port br0 vxlantarget2 -- set interface vxlantarget2 type=vxlan options:remote_ip=$TARGET_REMOTE_2 options:local_ip=$VXLAN_LOCALIP options:in_key=flow options:out_key=flow
ovs-vsctl add-port br0 vxlanclient1 -- set interface vxlanclient1 type=vxlan options:remote_ip=$CLIENT_REMOTE_1 options:local_ip=$VXLAN_LOCALIP options:in_key=flow options:out_key=flow
#ovs-vsctl set port veth0- tag=
#in
$OVS_OFCTL add-flow br0 "cookie=0x1111,table=0, priority=100, tun_id=$VNI,dl_dst=$NLB_MAC,nw_dst=$NLB_VIP,actions=move:NXM_NX_TUN_ID[0..23]->NXM_NX_REG0[0..23],resubmit(,1)"
$OVS_OFCTL add-flow br0 "cookie=0x2222,table=1, priority=100, actions=move:NXM_NX_REG0[0..23]->NXM_OF_ETH_SRC[24..47],output:$nlbnet1_port" #out
$OVS_OFCTL add-flow br0 "cookie=0x3333,table=0, priority=100, in_port=$nlbnet1_port,dl_dst=$TARGET_MAC_1,actions=move:NXM_OF_ETH_SRC[24..47]->NXM_NX_TUN_ID[0..23],output:$vxlantarget1_port" $OVS_OFCTL add-flow br0 "cookie=0x4444,table=0, priority=100, in_port=$nlbnet1_port,dl_dst=$TARGET_MAC_2,actions=move:NXM_OF_ETH_SRC[24..47]->NXM_NX_TUN_ID[0..23],output:$vxlantarget2_port"

ovs 所有options选项的文档

[root@vrouter1 ~]# man ovs-vswitchd.conf.db
       Each  tunnel  must be uniquely identified by the combination of type, options:remote_ip, options:local_ip, and options:in_key. If two ports are defined that are the same except one has an optional
identifier and the other does not, the more specific one is matched first. options:in_key is considered more specific than options:local_ip if a port defines one and another port defines the
other.
。。。 。。。
options : in_key: optional string
Optional. The key that received packets must contain, one of: · . The tunnel receives packets with no key or with a key of . This is equivalent to specifying no options:in_key at all. · A positive -bit (for Geneve, VXLAN, and LISP), -bit (for GRE) or -bit (for STT) number. The tunnel receives only packets with the specified key. · The word flow. The tunnel accepts packets with any key. The key will be placed in the tun_id field for matching in the flow table. The ovs-ofctl manual page contains additional
information about matching fields in OpenFlow flows. options : out_key: optional string
Optional. The key to be set on outgoing packets, one of: · . Packets sent through the tunnel will have no key. This is equivalent to specifying no options:out_key at all. · A positive -bit (for Geneve, VXLAN and LISP), -bit (for GRE) or -bit (for STT) number. Packets sent through the tunnel will have the specified key. · The word flow. Packets sent through the tunnel will have the key set using the set_tunnel Nicira OpenFlow vendor extension ( is used in the absence of an action). The ovs-ofctl man‐
ual page contains additional information about the Nicira OpenFlow vendor extensions. options : key: optional string
Optional. Shorthand to set in_key and out_key at the same time.

[ovs] openvswitch 入门的更多相关文章

  1. [ovs] openvswitch 从源码编译安装

    文档:https://docs.openvswitch.org/en/latest/intro/install/general/ 1. yum install autoconf automake li ...

  2. OpenShift上的OpenvSwitch入门

    前段时间参加openshift培训,通过产品部门的讲解,刷新了我对OpenShift一些的认识,今天先从最弱的环节网络做一些了解吧. Openvswitch是openshift sdn的核心组件,进入 ...

  3. [ovs] openvswitch ovs ovs-vsctl ovs-appctl 命令行参数自动补全 bash bash-completion

    1, 安装bash_completion: [root@vrouter1 ~]# yum install bash-completio 2,  找到你的ovs的补全脚本装在了哪里 [root@vrou ...

  4. Openstack组件实现原理 — OpenVswitch/Gre/vlan

    目录 目录 前文提要 Neutron 管理的网络相关实体 OpenVswitchOVS OVS 的架构 VLan GRE 隧道 Compute Node 中的 Instance 通过 GRE 访问 P ...

  5. Docker 学习4 Docker容器虚拟化网络概述

    一.docker 虚拟化网络概述 1.OVS: OpenVSwitch,不仅能模拟二层网络,还能模拟三层网络,或者VLAN,VXLAN,流控 SDN软件定义网络技术等. 2.overlay netwo ...

  6. CloudStack学习-3

    此次试验主要是CloudStack结合openvswitch 背景介绍 之所以引入openswitch,是因为如果按照之前的方式,一个网桥占用一个vlan,假如一个zone有20个vlan,那么岂不是 ...

  7. neutron ml2

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/zhoumingbo532/article/details/27964675 在介绍ml2之前,先介绍 ...

  8. KVM原理及使用

    Qemu 和 Qemu-kvm Qemu: http://qemu-project.org/Download Qemu-kvm:https://sourceforge.net/projects/kvm ...

  9. DOCKER学习_005:Flannel网络配置

    一 简介 Flannel是一种基于overlay网络的跨主机容器网络解决方案,也就是将TCP数据包封装在另一种网络包里面进行路由转发和通信, Flannel是CoreOS开发,专门用于docker多机 ...

随机推荐

  1. [svc]linux的ip命令操作接口和路由表

    参考: https://www.tecmint.com/ip-command-examples/ 学会linux的配置ip,配置网关,添加路由等命令 man ip man ip address man ...

  2. [ci]jenkins-slave的添加(vm模式,通过ssh和jnlp)

    jenkins-slave的添加-在vm上通过jnlp方式 参考:http://www.cnblogs.com/sparkdev/p/7102622.html 下载 slave.jar和slave-a ...

  3. [svc]打通mysql主从同步

    MySQL数据库设置主从同步 主从同步的特点: 逻辑的 异步的 主从同步的作用 1.备份 2.读写分离 主从同步的步骤 准备环境 1, mysql版本一致 5.5以上 2, 主从数据库一致 主库mas ...

  4. Selenium Web 自动化 - 项目实战(一)

    Selenium Web 自动化 - 测试框架(一) 2016-08-05 目录 1 框架结构雏形2 把Java项目转变成Maven项目3 加入TestNG配置文件4 Eclipse编码修改5 编写代 ...

  5. Java多线程系列——线程池简介

    什么是线程池? 为了避免系统频繁地创建和销毁线程,我们可以让创建的线程进行复用.用线程时从线程池中获取,用完以后不销毁线程,而是归还给线程池. JDK 对线程池的支持 为了更好的控制多线程,JDK 提 ...

  6. 基于AC有限状态机的多模匹配算法

    参考链接:http://www.cnblogs.com/zzqcn/p/3525636.html 感谢原文作者. 花了两天半时间实现并测试了算法. 按照上文的思路实现了一遍,可能是原文中有些地方描述的 ...

  7. ecshop首页调用团购信息产品购买人数

    当我们在ecshop后台录入ecshop的团购信息之后,我们在ecshop的前台首页index.php里面,可以看到他能调用ecshop的团购商品信息,其中就包括团购商品的一些价格信息.但是如何在ec ...

  8. laravel 5 : Class 'input' not found

     在配置文件中:config\app.php 加上 'Input' => Illuminate\Support\Facades\Input::class, 或者 引用 :use Illumina ...

  9. Docker的概念术语(2)

    Docker是什么? Docker是开发人员和系统管理员使用容器开发,部署和运行应用程序的平台.使用Linux容器部署应用程序称为容器化.Linux容器不是一个全新的概念,它们用于轻松部署应用程序. ...

  10. CVE-2019-8341 Jinja2 RCE漏洞学习

    漏洞简述 漏洞简介 Jinja2.10版本,Environment的实例方法from_string,存在RCE,该函数在内部实现逻辑中,存在exec函数去执行了,from_string函数参数中的ji ...