Ovs
Bridge
#add a bridge br-test
ovs-vsctl add-br br-test
#list bridge
ovs-vsctl list-br
#add a port tap-test to bridge br-test
ovs-vsctl add-port br-test tap-test
#show all information
ovs-vsctl show
ovsdb operation
# tables in ovsdb by default
bridge, controller, interface,mirror,netflow,open_vswitch,port,qos,queue,ssl,sflow
# common operation
ovs-vsctl list|set|get|add|remove|clear|destroy table record column [value]
# list all bridge
ovs-vsctl list bridge
# delete a qos record
ovs-vsctl destroy qos <qos-id>
#update VLAN tag of port p1 to 101(p1 will be in VLAN 101)
ovs-vsctl set port p1 tag=101
OpenFlow rules management
#show information of br-test
ovs-ofctl show br-test
#print port statistics of br-test
ovs-ofctl dump-ports br-test
#add a flow rule to drop all data flow in from port 2
ovs-ofctl add-flow br-test idle_timeout=120,in_port=2,actions=drop
#print all flow entries
ovs-ofctl dump-flows br-test
#drop broadcast data
ovs-ofctl add-flow br-test "table=0, dl_src=01:00:00:00:00:00/01:00:00:00:00:00, actions=drop"
#drop all STP data
ovs-ofctl add-flow br-test "table=0, dl_dst=01:80:c2:00:00:00/ff:ff:ff:ff:ff:f0, actions=drop"
QOS
ovs-vsctl set interface tap-xxx ingress_policing_rate=1000
ovs-vsctl set interface tap-xxx ingress_policing_burst=100