Poster of Linux kernelThe best gift for a Linux geek


Section: Open vSwitch Manual (8) Updated: August 2009
Local index Up


ovs-dpctl - administer Open vSwitch datapaths  


ovs-dpctl [options] command [switch] [args...]  


The ovs-dpctl program can create, modify, and delete Open vSwitch datapaths. A single machine may host up to 256 datapaths (numbered 0 to 255).

A newly created datapath is associated with only one network device, a virtual network device sometimes called the datapath's ``local port''. A newly created datapath is not, however, associated with any of the host's other network devices. To intercept and process traffic on a given network device, use the add-if command to explicitly add that network device to the datapath.

If ovs-vswitchd(8) is in use, use ovs-vsctl(8) instead of ovs-dpctl.

Most ovs-dpctl commands that work with datapaths take an argument that specifies the name of the datapath, in one of the following forms:

Datapath number N, where N is a number between 0 and 255, inclusive. If type is given, it specifies the datapath provider of dpN, otherwise the default provider system is assumed.
The name of the network device associated with the datapath's local port. (ovs-dpctl internally converts this into a datapath number, as above.) If type is given, it specifies the datapath provider of name, otherwise the default provider system is assumed.

The following commands manage datapaths.

add-dp dp [netdev...]
Creates datapath dp. The name of the new datapath's local port depends on how dp is specified: if it takes the form dpN, the local port will be named dpN; otherwise, the local port's name will be dp.
This will fail if the host already has 256 datapaths, if a network device with the same name as the new datapath's local port already exists, or if dp is given in the form dpN and a datapath numbered N already exists.
If netdevs are specified, ovs-dpctl adds them to the datapath.
del-dp dp
Deletes datapath dp. If dp is associated with any network devices, they are automatically removed.
add-if dp netdev[option...]...
Adds each netdev to the set of network devices datapath dp monitors, where dp is the name of an existing datapath, and netdev is the name of one of the host's network devices, e.g. eth0. Once a network device has been added to a datapath, the datapath has complete ownership of the network device's traffic and the network device appears silent to the rest of the system.
A netdev may be followed by a comma-separated list of options. The following options are currently supported:
Specifies the type of port to add. The default type is system.
Adds an arbitrary key-value option to the port's configuration.
ovs-vswitchd.conf.db(5) documents the available port types and options.
del-if dp netdev...
Removes each netdev from the list of network devices datapath dp monitors.
Prints the name of each configured datapath on a separate line.
show [dp...]
Prints a summary of configured datapaths, including their datapath numbers and a list of ports connected to each datapath. (The local port is identified as port 0.)
If one or more datapaths are specified, information on only those datapaths are displayed. Otherwise, ovs-dpctl displays information about all configured datapaths.
dump-flows dp
Prints to the console all flow entries in datapath dp's flow table.
This command is primarily useful for debugging Open vSwitch. The flow table entries that it displays are not OpenFlow flow entries. Instead, they are different and considerably simpler flows maintained by the Open vSwitch kernel module.
del-flows dp
Deletes all flow entries from datapath dp's flow table.
This command is primarily useful for debugging Open vSwitch. As discussed in dump-flows, these entries are not OpenFlow flow entries. By deleting them, the process that set them up may be confused about their disappearance.


-t, --timeout=secs
Limits ovs-dpctl runtime to approximately secs seconds. If the timeout expires, ovs-dpctl will exit with a SIGALRM signal.
-vmodule[:facility[:level]], --verbose=module[:facility[:level]]
Sets the logging level for module in facility to level:
module may be any valid module name (as displayed by the --list action on ovs-appctl(8)), or the special name ANY to set the logging levels for all modules.
facility may be syslog, console, or file to set the levels for logging to the system log, the console, or a file respectively, or ANY to set the logging levels for both facilities. If it is omitted, facility defaults to ANY.
Regardless of the log levels set for file, logging to a file will not take place unless --log-file is also specified (see below).
level must be one of emer, err, warn, info, or dbg, designating the minimum severity of a message for it to be logged. If it is omitted, level defaults to dbg.
-v, --verbose
Sets the maximum logging verbosity level, equivalent to --verbose=ANY:ANY:dbg.
-vPATTERN:facility:pattern, --verbose=PATTERN:facility:pattern
Sets the log pattern for facility to pattern. Refer to ovs-appctl(8) for a description of the valid syntax for pattern.
Enables logging to a file. If file is specified, then it is used as the exact name for the log file. The default log file name used if file is omitted is /var/log/openvswitch/ovs-dpctl.log.
-h, --help
Prints a brief help message to the console.
-V, --version
Prints version information to the console.


A typical ovs-dpctl command sequence for controlling an Open vSwitch kernel module:
ovs-dpctl add-dp dp0
Creates datapath number 0.
ovs-dpctl add-if dp0 eth0 eth1
Adds two network devices to the new datapath.

At this point one would ordinarily start ovs-openflowd(8) on dp0, transforming dp0 into an OpenFlow switch. Then, when the switch and the datapath is no longer needed:

ovs-dpctl del-if dp0 eth0 eth1
Removes network devices from the datapath.
ovs-dpctl del-dp dp0
Deletes the datapath.


ovs-appctl(8), ovs-openflowd(8), ovs-vswitchd(8)




This document was created by man2html, using the manual pages.
Time: 22:02:05 GMT, April 16, 2011