本文共 3506 字,大约阅读时间需要 11 分钟。
Open vSwitch is a production quality, multilayer virtual switch licensed under the open source Apache 2.0 license. It is designed to enable massive network automation through programmatic extension, while still supporting standard management interfaces and protocols (e.g. NetFlow, sFlow, IPFIX, RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to support distribution across multiple physical servers similar to VMware’s vNetwork distributed vswitch or Cisco’s Nexus 1000V.
ovs-vsctl set-fail-mode ovs-switch standaloneovs-switch替换成bridge的名字
ovs-vsctl set-fail-mode ovs-switch secure
ovs-vsctl 用来查询和配置ovs-vswitchd
ovs-ofctl 管理配置openflow switch#添加网桥ovs-vsctl add-br br-int#列出网桥ovs-vsctl list-br#给网桥添加端口ovs-vsctl add-port br-int tap-xxx#列出挂载某网络接口的所有网桥ovs-vsctl port-to-br tap-xxx#查看全部信息ovs-vsctl show#举例 查看所有网桥ovs-vsctl list bridge#举例 删除一条qos记录ovs-vsctl destroy qos#修改端口 p1 的 VLAN tag 为 101,使端口 p1 成为一个隶属于 VLAN 101 的端口ovs-vsctl set Port p1 tag=101#查看某网桥信息ovs-ofctl show br-tun#查看某网桥上所有端口的状态ovs-ofctl dump-ports br-tun#添加一条流表规则 丢弃从port2上发来的所有数据表ovs-ofctl add-flow br-tun idle_timeout=120,in_port=2,actions=drop#查看某网桥上面的流表规则ovs-ofctl dump-flows br-tun#屏蔽所有进入 OVS 的以太网广播数据包ovs-ofctl add-flow ovs-switch "table=0, dl_src=01:00:00:00:00:00/01:00:00:00:00:00, actions=drop"#屏蔽 STP 协议的广播数据包ovs-ofctl add-flow ovs-switch "table=0, dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0, actions=drop"屏蔽对目的主机访问:ovs-ofctl add-flow br0 idle_timeout=0,dl_type=0x0800,nw_src=xx.xx.xx.xx,actions=dropQos设置Qos可以针对网络接口,也可以针对端口设置:#针对网络接口 1000±100kbpsovs-vsctl set interface tap-xxx ingress_policing_rate=1000ovs-vsctl set interface tap-xxx ingress_policing_burst=100#指定协议查看流表ovs-ofctl dump-flows -O OpenFlow13 br-int#删除br-int所连控制器ovs-vsctl del-controller br-int#添加br-int所连控制器(可以添加多个)ovs-vsctl set-controller br-int "tcp:192.168.53.53:6633" "tcp:192.168.53.68:6633"#添加br-int所连控制器步骤2(可以添加多个)ovs-vsctl set-manager "tcp:192.168.53.53:6640" "tcp:192.168.53.68:6640"#修改br-int支持的of协议ovs-vsctl set bridge br0 protocols=OpenFlow13#把ovs的状态设置成normal,就是全转发ovs-ofctl add-flow br-int "actions=normal"#增加in_port和out_port的对应规则ovs-ofctl add-flow br-int "in_port=22,actions=output:32" -O OpenFlow13#删除br-int上所有流表ovs-ofctl del-flows br-int
转载地址:http://sunqi.baihongyu.com/