ovs common commands

 

 

  1. add bridge

     ovs-vsctl add-br 交换机名
    
  2. remove bridge

     ovs-vsctl del-br 交换机名
    
  3. add port

     ovs-vsctl add-port 交换机名 端口名(网卡名)
    
  4. delete port

     ovs-vsctl del-port 交换机名 端口名(网卡名)
    
  5. Connect the controller

     ovs-vsctl set-controller 交换机名 tcp:IP地址:端口号
    
  6. Disconnect the controller

     ovs-vsctl del-controller 交换机名
    
  7. List all bridges

     ovs-vsctl list-br
    
  8. List all ports in a bridge

     ovs-vsctl list-ports 交换机名
    
  9. List all bridges attached to the network card

     ovs-vsctl port-to-br 端口名(网卡名)
    
  10. View the network status of the open vswitch

    ovs-vsctl show
    
  11. View port information in Open vSwitch

    (交换机对应的 dpid,
    以及每个端口的 OpenFlow 端口编号,
    端口名称,
    当前状态等等)
    ovs-ofctl show 交换机名
    
  12. modify dpid

    ovs-vsctl set bridge 交换机名 other_config:datapath-id=新DPID
    
  13. Modify the port number

    ovs-vsctl set Interface 端口名 ofport_request=新端口号
    
  14. View all Tables in the switch

    ovs-ofctl dump-tables ovs-switch
    
  15. View all flow entries in the switch

    ovs−ofctl dump−flows ovs-switch
    
  16. Delete all flow entries on port number 100

    ovs-ofctl del-flows ovs-switch "in_port=100"
    
  17. 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 实践》
    
  18. View the version information of OVS

    ovs-appctl --version
    
  19. View the version of the OpenFlow protocol supported by OVS

    ovs-ofctl --version
    

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327026337&siteId=291194637