13 .TH ovs\-vsctl 8 "November 2009" "Open vSwitch" "Open vSwitch Manual"
14 .\" This program's name:
16 .\" SSL peer program's name:
20 ovs\-vsctl \- utility for querying and configuring \fBovs\-vswitchd\fR
23 \fBovs\-vsctl\fR [\fIoptions\fR] \fB\-\-\fR [\fIoptions\fR] \fIcommand
24 \fR[\fIargs\fR] [\fB\-\-\fR [\fIoptions\fR] \fIcommand \fR[\fIargs\fR]]...
27 The \fBovs\-vsctl\fR program configures \fBovs\-vswitchd\fR(8) by
28 providing a high\-level interface to its configuration
29 database. This program is mainly intended for use when
30 \fBovs\-vswitchd\fR is running. If it is used when
31 \fBovs\-vswitchd\fR is not running, then \fB\-\-no\-wait\fR should be
32 specified and configuration changes will only take effect when
33 \fBovs\-vswitchd\fR is started.
35 By default, each time \fBovs\-vsctl\fR runs, it connects to an
36 \fBovsdb\-server\fR process that maintains an Open vSwitch
37 configuration database. Using this connection, it queries and
38 possibly applies changes to the database, depending on the supplied
39 commands. Then, if it applied any changes, it waits until
40 \fBovs\-vswitchd\fR has finished reconfiguring itself before it exits.
42 \fBovs\-vsctl\fR can perform any number of commands in a single run,
43 implemented as a single atomic transaction against the database.
45 The \fBovs\-vsctl\fR command line begins with global options (see
46 \fBOPTIONS\fR below for details). The global options are followed by
47 one or more commands. Each command should begin with \fB\-\-\fR by
48 itself as a command-line argument, to separate it from the global
49 options and following commands. (If the first command does not have
50 any options, then the first \fB\-\-\fR may be omitted.) The command
51 itself starts with command-specific options, if any, followed by the
52 command name and any arguments. See \fBEXAMPLES\fR below for syntax
55 .SS "Linux VLAN Bridging Compatibility"
56 The \fBovs\-vsctl\fR program supports the model of a bridge
57 implemented by Open vSwitch, in which a single bridge supports ports
58 on multiple VLANs. In this model, each port on a bridge is either a
59 trunk port that potentially passes packets tagged with 802.1Q headers
60 that designate VLANs or it is assigned a single implicit VLAN that is
61 never tagged with an 802.1Q header.
63 For compatibility with software designed for the Linux bridge,
64 \fBovs\-vsctl\fR also supports a model in which traffic associated
65 with a given 802.1Q VLAN is segregated into a separate bridge. A
66 special form of the \fBadd\-br\fR command (see below) creates a ``fake
67 bridge'' within an Open vSwitch bridge to simulate this behavior.
68 When such a ``fake bridge'' is active, \fBovs\-vsctl\fR will treat it
69 much like a bridge separate from its ``parent bridge,'' but the actual
70 implementation in Open vSwitch uses only a single bridge, with ports on
71 the fake bridge assigned the implicit VLAN of the fake bridge of which
76 The following options affect the behavior \fBovs\-vsctl\fR as a whole.
77 Some individual commands also accept their own options, which are
78 given just before the command name. If the first command on the
79 command line has options, then those options must be separated from
80 the global options by \fB\-\-\fR.
82 .IP "\fB\-\-db=\fIserver\fR"
83 Sets \fIserver\fR as the database server that \fBovs\-vsctl\fR
84 contacts to query or modify configuration. The default is
85 \fBunix:@RUNDIR@/db.sock\fR. \fIserver\fR must take one of the
88 .so ovsdb/remote-active.man
89 .so ovsdb/remote-passive.man
92 .IP "\fB\-\-no\-wait\fR"
93 Prevents \fBovs\-vsctl\fR from waiting for \fBovs\-vswitchd\fR to
94 reconfigure itself according to the the modified database. This
95 option should be used if \fBovs\-vswitchd\fR is not running;
96 otherwise, \fBovs\-vsctl\fR will not exit until \fBovs\-vswitchd\fR
99 This option has no effect if the commands specified do not change the
102 .IP "\fB\-\-no\-syslog\fR"
103 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
104 changes that it makes to the system log. This option disables this
107 This option is equivalent to \fB\-\-verbose=vvsctl:syslog:warn\fR.
109 .IP "\fB\-\-oneline\fR"
110 Modifies the output format so that the output for each command is printed
111 on a single line. New-line characters that would otherwise separate
112 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
113 would otherwise appear in the output are doubled.
114 Prints a blank line for each command that has no output.
115 This option does not affect the formatting of output from the
116 \fBlist\fR or \fBfind\fR commands; see \fBTable Formatting Options\fR
119 .IP "\fB\-\-dry\-run\fR"
120 Prevents \fBovs\-vsctl\fR from actually modifying the database.
122 .IP "\fB\-t \fIsecs\fR"
123 .IQ "\fB\-\-timeout=\fIsecs\fR"
124 By default, or with a \fIsecs\fR of \fB0\fR, \fBovs\-vsctl\fR waits
125 forever for a response from the database. This option limits runtime
126 to approximately \fIsecs\fR seconds. If the timeout expires,
127 \fBovs\-vsctl\fR will exit with a \fBSIGALRM\fR signal. (A timeout
128 would normally happen only if the database cannot be contacted, or if
129 the system is overloaded.)
131 .SS "Table Formatting Options"
132 These options control the format of output from the \fBlist\fR and
136 .SS "Public Key Infrastructure Options"
138 .so lib/ssl-bootstrap.man
139 .so lib/ssl-peer-ca-cert.man
143 The commands implemented by \fBovs\-vsctl\fR are described in the
145 .SS "Open vSwitch Commands"
146 These commands work with an Open vSwitch as a whole.
149 Initializes the Open vSwitch database, if it is empty. If the
150 database has already been initialized, this command has no effect.
152 Any successful \fBovs\-vsctl\fR command automatically initializes the
153 Open vSwitch database if it is empty. This command is provided to
154 initialize the database without executing any other command.
156 .IP "\fBemer\-reset\fR"
157 Reset the configuration into a clean state. It deconfigures OpenFlow
158 controllers, OVSDB servers, and SSL, and deletes port mirroring,
159 \fBfail_mode\fR, NetFlow, and sFlow configuration. This command also
160 removes all \fBother\-config\fR keys from all database records, except
161 that \fBother\-config:hwaddr\fR is preserved if it is present in a
162 Bridge record. Other networking configuration is left as-is.
164 .SS "Bridge Commands"
165 These commands examine and manipulate Open vSwitch bridges.
167 .IP "[\fB\-\-may\-exist\fR] \fBadd\-br \fIbridge\fR"
168 Creates a new bridge named \fIbridge\fR. Initially the bridge will
169 have no ports (other than \fIbridge\fR itself).
171 Without \fB\-\-may\-exist\fR, attempting to create a bridge that
172 exists is an error. With \fB\-\-may\-exist\fR, \fIbridge\fR may
173 already exist (but it must be a real bridge, not a VLAN bridge).
175 .IP "[\fB\-\-may\-exist\fR] \fBadd\-br \fIbridge parent vlan\fR"
176 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
177 vSwitch bridge \fIparent\fR, which must already exist and must not
178 itself be a fake bridge. The new fake bridge will be on 802.1Q VLAN
179 \fIvlan\fR, which must be an integer between 1 and 4095. Initially
180 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
182 Without \fB\-\-may\-exist\fR, attempting to create a bridge that
183 exists is an error. With \fB\-\-may\-exist\fR, \fIbridge\fR may
184 already exist (but it must have the specified \fIvlan\fR and
187 .IP "[\fB\-\-if\-exists\fR] \fBdel\-br \fIbridge\fR"
188 Deletes \fIbridge\fR and all of its ports. If \fIbridge\fR is a real
189 bridge, this command also deletes any fake bridges that were created
190 with \fIbridge\fR as parent, including all of their ports.
192 Without \fB\-\-if\-exists\fR, attempting to delete a bridge that does
193 not exist is an error. With \fB\-\-if\-exists\fR, attempting to
194 delete a bridge that does not exist has no effect.
197 Lists all existing real and fake bridges on standard output, one per
200 .IP "\fBbr\-exists \fIbridge\fR"
201 Tests whether \fIbridge\fR exists as a real or fake bridge. If so,
202 \fBovs\-vsctl\fR exits successfully with exit code 0. If not,
203 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
205 .IP "\fBbr\-to\-vlan \fIbridge\fR"
206 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
207 decimal integer. If \fIbridge\fR is a real bridge, prints 0.
209 .IP "\fBbr\-to\-parent \fIbridge\fR"
210 If \fIbridge\fR is a fake bridge, prints the name of its parent
211 bridge. If \fIbridge\fR is a real bridge, print \fIbridge\fR.
213 .IP "\fBbr\-set\-external\-id \fIbridge key\fR [\fIvalue\fR]"
214 Sets or clears an ``external ID'' value on \fIbridge\fR. These values
215 are intended to identify entities external to Open vSwitch with which
216 \fIbridge\fR is associated, e.g. the bridge's identifier in a
217 virtualization management platform. The Open vSwitch database schema
218 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
219 are otherwise arbitrary strings.
221 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
222 \fIbridge\fR, overwriting any previous value. If \fIvalue\fR is
223 omitted, then \fIkey\fR is removed from \fIbridge\fR's set of external
224 IDs (if it was present).
226 For real bridges, the effect of this command is similar to that of a
227 \fBset\fR or \fBremove\fR command in the \fBexternal\-ids\fR column of
228 the \fBBridge\fR table. For fake bridges, it actually modifies keys
229 with names prefixed by \fBfake\-bridge\-\fR in the \fBPort\fR table.
231 .IP "\fBbr\-get\-external\-id \fIbridge\fR [\fIkey\fR]"
232 Queries the external IDs on \fIbridge\fR. If \fIkey\fR is specified,
233 the output is the value for that \fIkey\fR or the empty string if
234 \fIkey\fR is unset. If \fIkey\fR is omitted, the output is
235 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
237 For real bridges, the effect of this command is similar to that of a
238 \fBget\fR command in the \fBexternal\-ids\fR column of the
239 \fBBridge\fR table. For fake bridges, it queries keys with names
240 prefixed by \fBfake\-bridge\-\fR in the \fBPort\fR table.
244 These commands examine and manipulate Open vSwitch ports. These
245 commands treat a bonded port as a single entity.
247 .IP "\fBlist\-ports \fIbridge\fR"
248 Lists all of the ports within \fIbridge\fR on standard output, one per
249 line. The local port \fIbridge\fR is not included in the list.
251 .IP "[\fB\-\-may\-exist\fR] \fBadd\-port \fIbridge port \fR[\fIcolumn\fR[\fB:\fIkey\fR]\fR=\fIvalue\fR]\&...\fR"
252 Creates on \fIbridge\fR a new port named \fIport\fR from the network
253 device of the same name.
255 Optional arguments set values of column in the Port record created by
256 the command. For example, \fBtag=9\fR would make the port an access
257 port for VLAN 9. The syntax is the same as that for the \fBset\fR
258 command (see \fBDatabase Commands\fR below).
260 Without \fB\-\-may\-exist\fR, attempting to create a port that exists
261 is an error. With \fB\-\-may\-exist\fR, \fIport\fR may already exist
262 (but it must be on \fIbridge\fR and not be a bonded port).
264 .IP "[\fB\-\-fake\-iface\fR] \fBadd\-bond \fIbridge port iface\fR\&... [\fIcolumn\fR[\fB:\fIkey\fR]\fR=\fIvalue\fR]\&...\fR"
265 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
266 together the network devices given as each \fIiface\fR. At least two
267 interfaces must be named.
269 Optional arguments set values of column in the Port record created by
270 the command. The syntax is the same as that for the \fBset\fR command
271 (see \fBDatabase Commands\fR below).
273 With \fB\-\-fake\-iface\fR, a fake interface with the name \fIport\fR is
274 created. This should only be used for compatibility with legacy
275 software that requires it.
277 Without \fB\-\-may\-exist\fR, attempting to create a port that exists
278 is an error. With \fB\-\-may\-exist\fR, \fIport\fR may already exist
279 (but it must be on \fIbridge\fR and bond together exactly the
280 specified interface).
282 .IP "[\fB\-\-if\-exists\fR] \fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
283 Deletes \fIport\fR. If \fIbridge\fR is omitted, \fIport\fR is removed
284 from whatever bridge contains it; if \fIbridge\fR is specified, it
285 must be the real or fake bridge that contains \fIport\fR.
287 Without \fB\-\-if\-exists\fR, attempting to delete a port that does
288 not exist is an error. With \fB\-\-if\-exists\fR, attempting to
289 delete a port that does not exist has no effect.
291 .IP "[\fB\-\-if\-exists\fR] \fB\-\-with\-iface del\-port \fR[\fIbridge\fR] \fIiface\fR"
292 Deletes the port named \fIiface\fR or that has an interface named
293 \fIiface\fR. If \fIbridge\fR is omitted, the port is removed from
294 whatever bridge contains it; if \fIbridge\fR is specified, it must be
295 the real or fake bridge that contains the port.
297 Without \fB\-\-if\-exists\fR, attempting to delete the port for an
298 interface that does not exist is an error. With \fB\-\-if\-exists\fR,
299 attempting to delete the port for an interface that does not exist has
302 .IP "\fBport\-to\-br \fIport\fR"
303 Prints the name of the bridge that contains \fIport\fR on standard
306 .SS "Interface Commands"
308 These commands examine the interfaces attached to an Open vSwitch
309 bridge. These commands treat a bonded port as a collection of two or
310 more interfaces, rather than as a single port.
312 .IP "\fBlist\-ifaces \fIbridge\fR"
313 Lists all of the interfaces within \fIbridge\fR on standard output,
314 one per line. The local port \fIbridge\fR is not included in the
317 .IP "\fBiface\-to\-br \fIiface\fR"
318 Prints the name of the bridge that contains \fIiface\fR on standard
321 .SS "OpenFlow Controller Connectivity"
323 \fBovs\-vswitchd\fR can perform all configured bridging and switching
324 locally, or it can be configured to connect a given bridge to one or
325 more external OpenFlow controllers, such as NOX.
327 .IP "\fBget\-controller\fR \fIbridge\fR"
328 Prints the configured controller target.
330 .IP "\fBdel\-controller\fR \fIbridge\fR"
331 Deletes the configured controller target.
333 .IP "\fBset\-controller\fR \fIbridge\fR \fItarget\fR\&..."
334 Sets the configured controller target or targets. Each \fItarget\fR may
335 use any of the following forms:
338 .so lib/vconn-active.man
341 .ST "Controller Failure Settings"
343 When a controller is configured, it is, ordinarily, responsible for
344 setting up all flows on the switch. Thus, if the connection to
345 the controller fails, no new network connections can be set up. If
346 the connection to the controller stays down long enough, no packets
347 can pass through the switch at all.
349 If the value is \fBstandalone\fR, or if neither of these settings
350 is set, \fBovs\-vswitchd\fR will take over
351 responsibility for setting up
352 flows when no message has been received from the controller for three
353 times the inactivity probe interval (xxx needs to be exposed). In this mode,
354 \fBovs\-vswitchd\fR causes the datapath to act like an ordinary
355 MAC-learning switch. \fBovs\-vswitchd\fR will continue to retry connecting
356 to the controller in the background and, when the connection succeeds,
357 it discontinues its standalone behavior.
359 If this option is set to \fBsecure\fR, \fBovs\-vswitchd\fR will not
360 set up flows on its own when the controller connection fails.
362 .IP "\fBget\-fail\-mode\fR \fIbridge\fR"
363 Prints the configured failure mode.
365 .IP "\fBdel\-fail\-mode\fR \fIbridge\fR"
366 Deletes the configured failure mode.
368 .IP "\fBset\-fail\-mode\fR \fIbridge\fR \fBstandalone\fR|\fBsecure\fR"
369 Sets the configured failure mode.
371 .SS "Manager Connectivity"
373 These commands manipulate the \fBmanagers\fR and \fBmanager_options\fR columns
374 in the \fBOpen_vSwitch\fR table and rows in the \fBManagers\fR table. When
375 \fBovsdb\-server\fR is configured to use those rows and columns for OVSDB
376 connections, as described in \fBINSTALL.Linux\fR and in the startup scripts
377 provided with Open vSwitch, this allows the administrator to use
378 \fBovs\-vsctl\fR to configure database connections.
380 .IP "\fBget\-manager\fR"
381 Prints the configured manager(s).
383 .IP "\fBdel\-manager\fR"
384 Deletes the configured manager(s).
386 .IP "\fBset\-manager\fR \fItarget\fR\&..."
387 Sets the configured manager target or targets. Each \fItarget\fR may
388 use any of the following forms:
391 .so ovsdb/remote-active.man
392 .so ovsdb/remote-passive.man
395 .SS "SSL Configuration"
396 When \fBovs\-vswitchd\fR is configured to connect over SSL for management or
397 controller connectivity, the following parameters are required:
400 Specifies a PEM file containing the private key used as the virtual
401 switch's identity for SSL connections to the controller.
404 Specifies a PEM file containing a certificate, signed by the
405 certificate authority (CA) used by the controller and manager, that
406 certifies the virtual switch's private key, identifying a trustworthy
410 Specifies a PEM file containing the CA certificate used to verify that
411 the virtual switch is connected to a trustworthy controller.
413 These files are read only once, at \fBovs\-vswitchd\fR startup time. If
414 their contents change, \fBovs\-vswitchd\fR must be killed and restarted.
416 These SSL settings apply to all SSL connections made by the virtual
420 Prints the SSL configuration.
423 Deletes the current SSL configuration.
425 .IP "[\fB\-\-bootstrap\fR] \fBset\-ssl\fR \fIprivate-key\fR \fIcertificate\fR \fIca-cert\fR"
426 Sets the SSL configuration. The \fB\-\-bootstrap\fR option is described
429 .ST "CA Certificate Bootstrap"
431 Ordinarily, all of the files named in the SSL configuration must exist
432 when \fBovs\-vswitchd\fR starts. However, if the \fB\-\-bootstrap\fR
433 option is given, then \fBovs\-vswitchd\fR will attempt to obtain the
434 CA certificate from the controller on its first SSL connection and
435 save it to the named PEM file. If it is successful, it will
436 immediately drop the connection and reconnect, and from then on all
437 SSL connections must be authenticated by a certificate signed by the
438 CA certificate thus obtained.
440 \fBThis option exposes the SSL connection to a man-in-the-middle
441 attack obtaining the initial CA certificate\fR, but it may be useful
444 This option is only useful if the controller sends its CA certificate
445 as part of the SSL certificate chain. The SSL protocol does not
446 require the controller to send the CA certificate, but
447 \fBovs\-controller\fR(8) can be configured to do so with the
448 \fB\-\-peer\-ca\-cert\fR option.
450 .SS "Database Commands"
452 These commands query and modify the contents of \fBovsdb\fR tables.
453 They are a slight abstraction of the \fBovsdb\fR interface and as such
454 they operate at a lower level than other \fBovs\-vsctl\fR commands.
456 .ST "Identifying Tables, Records, and Columns"
458 Each of these commands has a \fItable\fR parameter to identify a table
459 within the database. Many of them also take a \fIrecord\fR parameter
460 that identifies a particular record within a table. The \fIrecord\fR
461 parameter may be the UUID for a record, and many tables offer
462 additional ways to identify records. Some commands also take
463 \fIcolumn\fR parameters that identify a particular field within the
466 The following tables are currently defined:
467 .IP "\fBOpen_vSwitch\fR"
468 Global configuration for an \fBovs\-vswitchd\fR. This table contains
469 exactly one record, identified by specifying \fB.\fR as the record
472 Configuration for a bridge within an Open vSwitch. Records may be
473 identified by bridge name.
475 A bridge port. Records may be identified by port name.
476 .IP "\fBInterface\fR"
477 A network device attached to a port. Records may be identified by
480 A port mirroring configuration attached to a bridge. Records may be
481 identified by mirror name.
482 .IP "\fBController\fR"
483 Configuration for an OpenFlow controller. A controller attached to a
484 particular bridge may be identified by the bridge's name.
486 Configuration for an OVSDB connection. Records may be identified
487 by target (e.g. \fBtcp:1.2.3.4\fR).
489 A NetFlow configuration attached to a bridge. Records may be
490 identified by bridge name.
492 The global SSL configuration for \fBovs\-vswitchd\fR. The record
493 attached to the \fBOpen_vSwitch\fR table may be identified by
494 specifying \fB.\fR as the record name.
496 An sFlow configuration attached to a bridge. Records may be
497 identified by bridge name.
499 Connectivity Monitoring attached to an interface. Records may be
500 identified by interface name.
501 .IP "\fBMaintenance_Point\fR"
502 Maintenance Point managed by a Monitor.
504 Record names must be specified in full and with correct
505 capitalization. Names of tables and columns are not case-sensitive,
506 and \fB\-\-\fR and \fB_\fR are treated interchangeably. Unique
507 abbreviations are acceptable, e.g. \fBnet\fR or \fBn\fR is sufficient
508 to identify the \fBNetFlow\fR table.
510 .ST "Database Values"
512 Each column in the database accepts a fixed type of data. The
513 currently defined basic types, and their representations, are:
515 A decimal integer in the range \-2**63 to 2**63\-1, inclusive.
517 A floating-point number.
519 True or false, written \fBtrue\fR or \fBfalse\fR, respectively.
521 An arbitrary Unicode string, except that null bytes are not allowed.
522 Quotes are optional for most strings that begin with an English letter
523 or underscore and consist only of letters, underscores, hyphens, and
524 periods. However, \fBtrue\fR and \fBfalse\fR and strings that match
525 the syntax of UUIDs (see below) must be enclosed in double quotes to
526 distinguish them from other basic types. When double quotes are used,
527 the syntax is that of strings in JSON, e.g. backslashes may be used to
528 escape special characters. The empty string must be represented as a
529 pair of double quotes (\fB""\fR).
531 Either a universally unique identifier in the style of RFC 4122,
532 e.g. \fBf81d4fae\-7dec\-11d0\-a765\-00a0c91e6bf6\fR, or an \fB@\fIname\fR
533 defined by a \fBget\fR or \fBcreate\fR command within the same \fBovs\-vsctl\fR
536 Multiple values in a single column may be separated by spaces or a
537 single comma. When multiple values are present, duplicates are not
538 allowed, and order is not important. Conversely, some database
539 columns can have an empty set of values, represented as \fB[]\fR, and
540 square brackets may optionally enclose other non-empty sets or single
543 A few database columns are ``maps'' of key-value pairs, where the key
544 and the value are each some fixed database type. These are specified
545 in the form \fIkey\fB=\fIvalue\fR, where \fIkey\fR and \fIvalue\fR
546 follow the syntax for the column's key type and value type,
547 respectively. When multiple pairs are present (separated by spaces or
548 a comma), duplicate keys are not allowed, and again the order is not
549 important. Duplicate values are allowed. An empty map is represented
550 as \fB{}\fR, and curly braces may be optionally enclose non-empty maps
553 .ST "Database Command Syntax"
554 .IP "[\fB\-\-columns=\fIcolumn\fR[\fB,\fIcolumn\fR]...] \fBlist \fItable \fR[\fIrecord\fR]..."
555 Lists the data in each specified \fIrecord\fR. If no
556 records are specified, lists all the records in \fItable\fR.
558 If \fB\-\-columns\fR is specified, only the requested columns are
559 listed, in the specified order. Otherwise, all columns are listed, in
560 alphabetical order by column name.
562 .IP "[\fB\-\-columns=\fIcolumn\fR[\fB,\fIcolumn\fR]...] \fBfind \fItable \fR[\fIcolumn\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR]..."
563 Lists the data in each record in \fItable\fR whose \fIcolumn\fR equals
564 \fIvalue\fR or, if \fIkey\fR is specified, whose \fIcolumn\fR contains
565 a \fIkey\fR with the specified \fIvalue\fR. Any of the operators
566 \fB!=\fR, \fB<\fR, \fB>\fR, \fB<=\fR, or \fB>=\fR may be substituted
567 for \fB=\fR to test for inequality, less than, greater than, less than
568 or equal to, or greater than or equal to, respectively. (Don't forget
569 to escape \fB<\fR or \fB>\fR from interpretation by the shell.)
571 If \fB\-\-columns\fR is specified, only the requested columns are
572 listed, in the specified order. Otherwise all columns are listed, in
573 alphabetical order by column name.
575 The UUIDs shown for rows created in the same \fBovs\-vsctl\fR
576 invocation will be wrong.
578 .IP "[\fB\-\-id=@\fIname\fR] [\fB\-\-if\-exists\fR] \fBget \fItable record \fR[\fIcolumn\fR[\fB:\fIkey\fR]]..."
579 Prints the value of each specified \fIcolumn\fR in the given
580 \fIrecord\fR in \fItable\fR. For map columns, a \fIkey\fR may
581 optionally be specified, in which case the value associated with
582 \fIkey\fR in the column is printed, instead of the entire map.
584 For a map column, without \fB\-\-if\-exists\fR it is an error if
585 \fIkey\fR does not exist; with it, a blank line is printed. If
586 \fIcolumn\fR is not a map column or if \fIkey\fR is not specified,
587 \fB\-\-if\-exists\fR has no effect.
589 If \fB@\fIname\fR is specified, then the UUID for \fIrecord\fR may be
590 referred to by that name later in the same \fBovs\-vsctl\fR
591 invocation in contexts where a UUID is expected.
593 .IP "\fBset \fItable record column\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR..."
594 Sets the value of each specified \fIcolumn\fR in the given
595 \fIrecord\fR in \fItable\fR to \fIvalue\fR. For map columns, a
596 \fIkey\fR may optionally be specified, in which case the value
597 associated with \fIkey\fR in that column is changed (or added, if none
598 exists), instead of the entire map.
600 .IP "\fBadd \fItable record column \fR[\fIkey\fB=\fR]\fIvalue\fR..."
601 Adds the specified value or key-value pair to \fIcolumn\fR in
602 \fIrecord\fR in \fItable\fR. If \fIcolumn\fR is a map, then \fIkey\fR
603 is required, otherwise it is prohibited. If \fIkey\fR already exists
604 in a map column, then the current \fIvalue\fR is not replaced (use the
605 \fBset\fR command to replace an existing value).
607 .IP "\fBremove \fItable record column \fR\fIvalue\fR..."
608 .IQ "\fBremove \fItable record column \fR\fIkey\fR..."
609 .IQ "\fBremove \fItable record column \fR\fIkey\fB=\fR\fIvalue\fR..."
610 Removes the specified values or key-value pairs from \fIcolumn\fR in
611 \fIrecord\fR in \fItable\fR. The first form applies to columns that
612 are not maps: each specified \fIvalue\fR is removed from the column.
613 The second and third forms apply to map columns: if only a \fIkey\fR
614 is specified, then any key-value pair with the given \fIkey\fR is
615 removed, regardless of its value; if a \fIvalue\fR is given then a
616 pair is removed only if both key and value match.
618 It is not an error if the column does not contain the specified key or
621 .IP "\fBclear\fR \fItable record column\fR..."
622 Sets each \fIcolumn\fR in \fIrecord\fR in \fItable\fR to the empty set
623 or empty map, as appropriate. This command applies only to columns
624 that are allowed to be empty.
626 .IP "[\fB\-\-id=@\fIname\fR] \fBcreate\fR \fItable column\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR..."
627 Creates a new record in \fItable\fR and sets the initial values of
628 each \fIcolumn\fR. Columns not explicitly set will receive their
629 default values. Outputs the UUID of the new row.
631 If \fB@\fIname\fR is specified, then the UUID for the new row may be
632 referred to by that name elsewhere in the same \fBovs\-vsctl\fR
633 invocation in contexts where a UUID is expected. Such references may
634 precede or follow the \fBcreate\fR command.
636 .IP "\fR[\fB\-\-if\-exists\fR] \fBdestroy \fItable record\fR..."
637 Deletes each specified \fIrecord\fR from \fItable\fR. Unless
638 \fB\-\-if\-exists\fR is specified, each \fIrecord\fRs must exist.
640 .IP "\fBwait\-until \fItable record \fR[\fIcolumn\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR]..."
641 Waits until \fItable\fR contains a record named \fIrecord\fR whose
642 \fIcolumn\fR equals \fIvalue\fR or, if \fIkey\fR is specified, whose
643 \fIcolumn\fR contains a \fIkey\fR with the specified \fIvalue\fR. Any
644 of the operators \fB!=\fR, \fB<\fR, \fB>\fR, \fB<=\fR, or \fB>=\fR may
645 be substituted for \fB=\fR to test for inequality, less than, greater
646 than, less than or equal to, or greater than or equal to,
647 respectively. (Don't forget to escape \fB<\fR or \fB>\fR from
648 interpretation by the shell.)
650 If no \fIcolumn\fR[\fB:\fIkey\fR]\fB=\fIvalue\fR arguments are given,
651 this command waits only until \fIrecord\fR exists. If more than one
652 such argument is given, the command waits until all of them are
655 Usually \fBwait\-until\fR should be placed at the beginning of a set
656 of \fBovs\-vsctl\fR commands. For example, \fBwait\-until bridge br0
657 \-\- get bridge br0 datapath_id\fR waits until a bridge named
658 \fBbr0\fR is created, then prints its \fBdatapath_id\fR column,
659 whereas \fBget bridge br0 datapath_id \-\- wait\-until bridge br0\fR
660 will abort if no bridge named \fBbr0\fR exists when \fBovs\-vsctl\fR
661 initially connects to the database.
663 Consider specifying \fB\-\-timeout=0\fR along with
664 \fB\-\-wait\-until\fR, to prevent \fBovs\-vsctl\fR from terminating
665 after waiting only at most 5 seconds.
667 Create a new bridge named br0 and add port eth0 to it:
669 .B "ovs\-vsctl add\-br br0"
671 .B "ovs\-vsctl add\-port br0 eth0"
673 Alternatively, perform both operations in a single atomic transaction:
675 .B "ovs\-vsctl add\-br br0 \-\- add\-port br0 eth0"
677 Delete bridge \fBbr0\fR, reporting an error if it does not exist:
679 .B "ovs\-vsctl del\-br br0"
681 Delete bridge \fBbr0\fR if it exists (the \fB\-\-\fR is required to
682 separate \fBdel\-br\fR's options from the global options):
684 .B "ovs\-vsctl \-\- \-\-if\-exists del\-br br0"
686 Set the \fBqos\fR column of the \fBPort\fR record for \fBeth0\fR to
687 point to a new \fBQoS\fR record, which in turn points with its queue 0
688 to a new \fBQueue\fR record:
690 .B "ovs\-vsctl \-\- set port eth0 qos=@newqos \-\- \-\-id=@newqos create qos type=linux\-htb other\-config:max\-rate=1000000 queues:0=@newqueue \-\- \-\-id=@newqueue create queue other\-config:min\-rate=1000000 other\-config:max\-rate=1000000"
691 .SH "CONFIGURATION COOKBOOK"
692 .SS "Port Configuration"
694 Add an ``internal port'' \fBvlan10\fR to bridge \fBbr0\fR as a VLAN
695 access port for VLAN 10, and configure it with an IP address:
697 .B "ovs\-vsctl add\-port br0 vlan10 tag=10 \-\- set Interface vlan10 type=internal"
699 .B "ifconfig vlan10 192.168.0.123"
703 Mirror all packets received or sent on \fBeth0\fR or \fBeth1\fR onto
704 \fBeth2\fR, assuming that all of those ports exist on bridge \fBbr0\fR
705 (as a side-effect this causes any packets received on \fBeth2\fR to be
708 .B "ovs\-vsctl \-\- set Bridge br0 mirrors=@m \(rs"
710 .B "\-\- \-\-id=@eth0 get Port eth0 \(rs"
712 .B "\-\- \-\-id=@eth1 get Port eth1 \(rs"
714 .B "\-\- \-\-id=@eth2 get Port eth2 \(rs"
716 .B "\-\- \-\-id=@m create Mirror name=mymirror select-dst-port=@eth0,@eth1 select-src-port=@eth0,@eth1 output-port=@eth2"
718 Remove the mirror created above from \fBbr0\fR and destroy the Mirror
719 record (to avoid having an unreferenced record in the database):
721 .B "ovs\-vsctl destroy Mirror mymirror \-\- clear Bridge br0 mirrors"
722 .SS "Quality of Service (QoS)"
724 Create a \fBlinux\-htb\fR QoS record that points to a few queues and
725 use it on \fBeth0\fR and \fBeth1\fR:
727 .B "ovs\-vsctl \-\- set Port eth0 qos=@newqos \(rs"
729 .B "\-\- set Port eth1 qos=@newqos \(rs"
731 .B "\-\- \-\-id=@newqos create QoS type=linux\-htb other\-config:max\-rate=1000000000 queues=0=@q0,1=@q1 \(rs"
733 .B "\-\- \-\-id=@q0 create Queue other\-config:min\-rate=100000000 other\-config:max\-rate=100000000 \(rs"
735 .B "\-\- \-\-id=@q1 create Queue other\-config:min\-rate=500000000"
737 Deconfigure the QoS record above from \fBeth1\fR only:
739 .B "ovs\-vsctl clear Port eth1 qos"
741 To deconfigure the QoS record from both \fBeth0\fR and \fBeth1\fR and
742 then delete the QoS record:
744 .B "ovs\-vsctl \-\- destroy QoS eth0 \-\- clear Port eth0 qos \-\- clear Port eth1 qos"
746 (This command will leave two unreferenced Queue records in the
747 database. To delete them, use "\fBovs\-vsctl list Queue\fR" to find
748 their UUIDs, then "\fBovs\-vsctl destroy Queue \fIuuid1\fR
749 \fIuuid2\fR" to destroy each of them.)
750 .SS "Connectivity Monitoring"
752 Create a Monitor which manages a couple of remote Maintenance Points on eth0.
754 .B "ovs\-vsctl \-\- set Interface eth0 Monitor=@newmon \(rs"
756 .B "\-\- \-\-id=@newmon create Monitor mpid=1 remote_mps=@mp2,@mp3 \(rs"
758 .B "\-\- \-\-id=@mp2 create Maintenance_Point mpid=2 \(rs"
760 .B "\-\- \-\-id=@mp3 create Maintenance_Point mpid=3"
762 Deconfigure the Monitor record from above:
764 .B "ovs\-vsctl clear Interface eth0 Monitor"
767 Configure bridge \fBbr0\fR to send NetFlow records to UDP port 5566 on
768 host 192.168.0.34, with an active timeout of 30 seconds:
770 .B "ovs\-vsctl \-\- set Bridge br0 netflow=@nf \(rs"
772 .B "\-\- \-\-id=@nf create NetFlow targets=\(rs\(dq192.168.0.34:5566\(rs\(dq active\-timeout=30"
774 Update the NetFlow configuration created by the previous command to
775 instead use an active timeout of 60 seconds:
777 .B "ovs\-vsctl set NetFlow br0 active_timeout=60"
779 Deconfigure the NetFlow settings from \fBbr0\fR and delete the NetFlow
780 record (to avoid having an unreferenced record in the database):
782 .B "ovs\-vsctl destroy NetFlow br0 \-\- clear Bridge br0 netflow"
785 Configure bridge \fBbr0\fR to send sFlow records to a collector on
786 10.0.0.1 at port 6343, using \fBeth1\fR\'s IP address as the source,
787 with specific sampling parameters:
789 .B "ovs\-vsctl \-\- \-\-id=@s create sFlow agent=eth1 target=\(rs\(dq10.0.0.1:6343\(rs\(dq header=128 sampling=64 polling=10 \(rs"
791 .B "\-\- set Bridge br0 sflow=@s"
793 Deconfigure sFlow from br0 and destroy the sFlow record (to avoid
794 having an unreferenced record in the database):
796 .B "ovs\-vsctl \-\- destroy sFlow br0 \-\- clear Bridge br0 sflow"
799 Successful program execution.
801 Usage, syntax, or configuration file error.
803 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
804 bridge that does not exist.
807 .BR ovsdb\-server (1),
808 .BR ovs\-vswitchd (8).