-
add bridge
ovs-vsctl add-br 交换机名
-
remove bridge
ovs-vsctl del-br 交换机名
-
add port
ovs-vsctl add-port 交换机名 端口名(网卡名)
-
delete port
ovs-vsctl del-port 交换机名 端口名(网卡名)
-
Connect the controller
ovs-vsctl set-controller 交换机名 tcp:IP地址:端口号
-
Disconnect the controller
ovs-vsctl del-controller 交换机名
-
List all bridges
ovs-vsctl list-br
-
List all ports in a bridge
ovs-vsctl list-ports 交换机名
-
List all bridges attached to the network card
ovs-vsctl port-to-br 端口名(网卡名)
-
View the network status of the open vswitch
ovs-vsctl show
-
View port information in Open vSwitch
(交换机对应的 dpid, 以及每个端口的 OpenFlow 端口编号, 端口名称, 当前状态等等) ovs-ofctl show 交换机名
-
modify dpid
ovs-vsctl set bridge 交换机名 other_config:datapath-id=新DPID
-
Modify the port number
ovs-vsctl set Interface 端口名 ofport_request=新端口号
-
View all Tables in the switch
ovs-ofctl dump-tables ovs-switch
-
View all flow entries in the switch
ovs−ofctl dump−flows ovs-switch
-
Delete all flow entries on port number 100
ovs-ofctl del-flows ovs-switch "in_port=100"
-
Add flow entry
以“添加新的 OpenFlow 条目, 修改从端口 p0 收到的数据包的源地址为 9.181.137.1”为例: ovs-ofctl add-flow ovs-switch "priority=1 idle_timeout=0,in_port=100,actions=mod_nw_src:9.181.137.1,normal" 更多说明请查阅:[《基于 Open vSwitch 的 OpenFlow 实践》
-
View the version information of OVS
ovs-appctl --version
-
View the version of the OpenFlow protocol supported by OVS
ovs-ofctl --version