CLI for Open vSwitch

Besides the option to create and edit Open vSwitch devices through the Proxmox GUI, Open vSwitch comes loaded with command-line options to manage and gather information of a particular bridge, bond, or interface. There are four types of commands in Open vSwitch:

  • ovs-appctl: This is used to query and control the Open vSwitch daemon
  • ovs-vsctl: This is used to manage the Open vSwitch configuration database
  • ovs-ofctl: This is a tool used to monitor and manage the OpenFlow switch
  • ovs-dpctl: This is used to manage Open vSwitch data paths

It is beyond the scope of this book to go into details of all the available commands of Open vSwitch. In this section, we will only take a look at the commands that may prove to be very helpful while managing a Proxmox cluster:

  • To see a list of configured Open vSwitch bridges, ports, and interfaces, use the following commands:
        # ovs-vsctl list br
        # ovs-vsctl list port
        # ovs-vsctl list interface  
  • To see a list of all the interfaces in Open vSwitch, run the following command:
        # ovs-vsctl show  
  • To modify options at runtime without rebooting node:
        # ovs-vsctl set <interface_type> <interface_name> <option>  
  • For example, if we want to add more VLAN IDs to our Open vSwitch bonded interface, run the following command:
        # ovs-vsctl set port bond0 trunks=2,3,4,5,6,7  
  • We have to mention all the existing VLAN IDs along with the new ones. Otherwise, the trunk configuration will get replaced with only the new ones while the old configuration will get replaced. We also have to add the new IDs to the /etc/network/interfaces file.
  • To snoop and display traffic to and from the Open vSwitch bridge, run the following command:
        # ovs-ofctl snoop <bridge_name>  
  • To see the status of each of Open vSwitch components, run this command:
        # ovs-ofct lshow <name>  
  • To dump OpenFlow flows, including hidden ones, run this command:
        # ovs-appctl bridge/dump-flows <bridge_name>  
  • To print the version of Open vSwitch, run the following command:
        # ovs-appctl version  

For a complete list of the available Open vSwitch commands, visit the following link:

http://www.pica8.com/document/v2.3/pdf/ovs-commands-reference.pdf

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.118.250