1ovs-vsctl(8) Open vSwitch Manual ovs-vsctl(8)
2
3
4
6 ovs-vsctl - utility for querying and configuring ovs-vswitchd
7
9 ovs-vsctl [options] -- [options] command [args] [-- [options] command
10 [args]]...
11
13 The ovs-vsctl program configures ovs-vswitchd(8) by providing a
14 high-level interface to its configuration database. See
15 ovs-vswitchd.conf.db(5) for comprehensive documentation of the database
16 schema.
17
18 ovs-vsctl connects to an ovsdb-server process that maintains an Open
19 vSwitch configuration database. Using this connection, it queries and
20 possibly applies changes to the database, depending on the supplied
21 commands. Then, if it applied any changes, by default it waits until
22 ovs-vswitchd has finished reconfiguring itself before it exits. (If
23 you use ovs-vsctl when ovs-vswitchd is not running, use --no-wait.)
24
25 ovs-vsctl can perform any number of commands in a single run, imple‐
26 mented as a single atomic transaction against the database.
27
28 The ovs-vsctl command line begins with global options (see OPTIONS
29 below for details). The global options are followed by one or more
30 commands. Each command should begin with -- by itself as a command-
31 line argument, to separate it from the following commands. (The --
32 before the first command is optional.) The command itself starts with
33 command-specific options, if any, followed by the command name and any
34 arguments. See EXAMPLES below for syntax examples.
35
36 Linux VLAN Bridging Compatibility
37 The ovs-vsctl program supports the model of a bridge implemented by
38 Open vSwitch, in which a single bridge supports ports on multiple
39 VLANs. In this model, each port on a bridge is either a trunk port
40 that potentially passes packets tagged with 802.1Q headers that desig‐
41 nate VLANs or it is assigned a single implicit VLAN that is never
42 tagged with an 802.1Q header.
43
44 For compatibility with software designed for the Linux bridge,
45 ovs-vsctl also supports a model in which traffic associated with a
46 given 802.1Q VLAN is segregated into a separate bridge. A special form
47 of the add-br command (see below) creates a ``fake bridge'' within an
48 Open vSwitch bridge to simulate this behavior. When such a ``fake
49 bridge'' is active, ovs-vsctl will treat it much like a bridge separate
50 from its ``parent bridge,'' but the actual implementation in Open
51 vSwitch uses only a single bridge, with ports on the fake bridge
52 assigned the implicit VLAN of the fake bridge of which they are mem‐
53 bers. (A fake bridge for VLAN 0 receives packets that have no 802.1Q
54 tag or a tag with VLAN 0.)
55
57 The following options affect the behavior ovs-vsctl as a whole. Some
58 individual commands also accept their own options, which are given just
59 before the command name. If the first command on the command line has
60 options, then those options must be separated from the global options
61 by --.
62
63 --db=server
64 Sets server as the database server that ovs-vsctl contacts to
65 query or modify configuration. server may be an OVSDB active or
66 passive connection method, as described in ovsdb(7). The
67 default is unix:/var/run/openvswitch/db.sock.
68
69 --no-wait
70 Prevents ovs-vsctl from waiting for ovs-vswitchd to reconfigure
71 itself according to the modified database. This option should
72 be used if ovs-vswitchd is not running; otherwise, ovs-vsctl
73 will not exit until ovs-vswitchd starts.
74
75 This option has no effect if the commands specified do not
76 change the database.
77
78 --no-syslog
79 By default, ovs-vsctl logs its arguments and the details of any
80 changes that it makes to the system log. This option disables
81 this logging.
82
83 This option is equivalent to --verbose=vsctl:syslog:warn.
84
85 --oneline
86 Modifies the output format so that the output for each command
87 is printed on a single line. New-line characters that would
88 otherwise separate lines are printed as \n, and any instances of
89 \ that would otherwise appear in the output are doubled. Prints
90 a blank line for each command that has no output. This option
91 does not affect the formatting of output from the list or find
92 commands; see Table Formatting Options below.
93
94 --dry-run
95 Prevents ovs-vsctl from actually modifying the database.
96
97 -t secs
98 --timeout=secs
99 By default, or with a secs of 0, ovs-vsctl waits forever for a
100 response from the database. This option limits runtime to
101 approximately secs seconds. If the timeout expires, ovs-vsctl
102 will exit with a SIGALRM signal. (A timeout would normally hap‐
103 pen only if the database cannot be contacted, or if the system
104 is overloaded.)
105
106 --retry
107 Without this option, if ovs-vsctl connects outward to the data‐
108 base server (the default) then ovs-vsctl will try to connect
109 once and exit with an error if the connection fails (which usu‐
110 ally means that ovsdb-server is not running).
111
112 With this option, or if --db specifies that ovs-vsctl should
113 listen for an incoming connection from the database server, then
114 ovs-vsctl will wait for a connection to the database forever.
115
116 Regardless of this setting, --timeout always limits how long
117 ovs-vsctl will wait.
118
119 Table Formatting Options
120 These options control the format of output from the list and find com‐
121 mands.
122
123 -f format
124 --format=format
125 Sets the type of table formatting. The following types of for‐
126 mat are available:
127
128 table 2-D text tables with aligned columns.
129
130 list (default)
131 A list with one column per line and rows separated by a
132 blank line.
133
134 html HTML tables.
135
136 csv Comma-separated values as defined in RFC 4180.
137
138 json JSON format as defined in RFC 4627. The output is a
139 sequence of JSON objects, each of which corresponds to
140 one table. Each JSON object has the following members
141 with the noted values:
142
143 caption
144 The table's caption. This member is omitted if
145 the table has no caption.
146
147 headings
148 An array with one element per table column. Each
149 array element is a string giving the corresponding
150 column's heading.
151
152 data An array with one element per table row. Each
153 element is also an array with one element per ta‐
154 ble column. The elements of this second-level
155 array are the cells that constitute the table.
156 Cells that represent OVSDB data or data types are
157 expressed in the format described in the OVSDB
158 specification; other cells are simply expressed as
159 text strings.
160
161 -d format
162 --data=format
163 Sets the formatting for cells within output tables unless the
164 table format is set to json, in which case json formatting is
165 always used when formatting cells. The following types of for‐
166 mat are available:
167
168 string (default)
169 The simple format described in the Database Values sec‐
170 tion below.
171
172 bare The simple format with punctuation stripped off: [] and
173 {} are omitted around sets, maps, and empty columns,
174 items within sets and maps are space-separated, and
175 strings are never quoted. This format may be easier for
176 scripts to parse.
177
178 json The RFC 4627 JSON format as described above.
179
180 --no-headings
181 This option suppresses the heading row that otherwise appears in
182 the first row of table output.
183
184 --pretty
185 By default, JSON in output is printed as compactly as possible.
186 This option causes JSON in output to be printed in a more read‐
187 able fashion. Members of objects and elements of arrays are
188 printed one per line, with indentation.
189
190 This option does not affect JSON in tables, which is always
191 printed compactly.
192
193 --bare Equivalent to --format=list --data=bare --no-headings.
194
195 --max-column-width=n
196 For table output only, limits the width of any column in the
197 output to n columns. Longer cell data is truncated to fit, as
198 necessary. Columns are always wide enough to display the column
199 names, if the heading row is printed.
200
201 Public Key Infrastructure Options
202 -p privkey.pem
203 --private-key=privkey.pem
204 Specifies a PEM file containing the private key used as
205 ovs-vsctl's identity for outgoing SSL connections.
206
207 -c cert.pem
208 --certificate=cert.pem
209 Specifies a PEM file containing a certificate that certifies the
210 private key specified on -p or --private-key to be trustworthy.
211 The certificate must be signed by the certificate authority (CA)
212 that the peer in SSL connections will use to verify it.
213
214 -C cacert.pem
215 --ca-cert=cacert.pem
216 Specifies a PEM file containing the CA certificate that
217 ovs-vsctl should use to verify certificates presented to it by
218 SSL peers. (This may be the same certificate that SSL peers use
219 to verify the certificate specified on -c or --certificate, or
220 it may be a different one, depending on the PKI design in use.)
221
222 -C none
223 --ca-cert=none
224 Disables verification of certificates presented by SSL peers.
225 This introduces a security risk, because it means that certifi‐
226 cates cannot be verified to be those of known trusted hosts.
227
228 --bootstrap-ca-cert=cacert.pem
229 When cacert.pem exists, this option has the same effect as -C or
230 --ca-cert. If it does not exist, then ovs-vsctl will attempt to
231 obtain the CA certificate from the SSL peer on its first SSL
232 connection and save it to the named PEM file. If it is success‐
233 ful, it will immediately drop the connection and reconnect, and
234 from then on all SSL connections must be authenticated by a cer‐
235 tificate signed by the CA certificate thus obtained.
236
237 This option exposes the SSL connection to a man-in-the-middle
238 attack obtaining the initial CA certificate, but it may be use‐
239 ful for bootstrapping.
240
241 This option is only useful if the SSL peer sends its CA certifi‐
242 cate as part of the SSL certificate chain. The SSL protocol
243 does not require the server to send the CA certificate.
244
245 This option is mutually exclusive with -C and --ca-cert.
246
247 --peer-ca-cert=peer-cacert.pem
248 Specifies a PEM file that contains one or more additional cer‐
249 tificates to send to SSL peers. peer-cacert.pem should be the
250 CA certificate used to sign ovs-vsctl's own certificate, that
251 is, the certificate specified on -c or --certificate. If
252 ovs-vsctl's certificate is self-signed, then --certificate and
253 --peer-ca-cert should specify the same file.
254
255 This option is not useful in normal operation, because the SSL
256 peer must already have the CA certificate for the peer to have
257 any confidence in ovs-vsctl's identity. However, this offers a
258 way for a new installation to bootstrap the CA certificate on
259 its first SSL connection.
260
261 -v[spec]
262 --verbose=[spec]
263 Sets logging levels. Without any spec, sets the log level for
264 every module and destination to dbg. Otherwise, spec is a list
265 of words separated by spaces or commas or colons, up to one from
266 each category below:
267
268 · A valid module name, as displayed by the vlog/list com‐
269 mand on ovs-appctl(8), limits the log level change to the
270 specified module.
271
272 · syslog, console, or file, to limit the log level change
273 to only to the system log, to the console, or to a file,
274 respectively. (If --detach is specified, ovs-vsctl
275 closes its standard file descriptors, so logging to the
276 console will have no effect.)
277
278 On Windows platform, syslog is accepted as a word and is
279 only useful along with the --syslog-target option (the
280 word has no effect otherwise).
281
282 · off, emer, err, warn, info, or dbg, to control the log
283 level. Messages of the given severity or higher will be
284 logged, and messages of lower severity will be filtered
285 out. off filters out all messages. See ovs-appctl(8)
286 for a definition of each log level.
287
288 Case is not significant within spec.
289
290 Regardless of the log levels set for file, logging to a file
291 will not take place unless --log-file is also specified (see
292 below).
293
294 For compatibility with older versions of OVS, any is accepted as
295 a word but has no effect.
296
297 -v
298 --verbose
299 Sets the maximum logging verbosity level, equivalent to --ver‐
300 bose=dbg.
301
302 -vPATTERN:destination:pattern
303 --verbose=PATTERN:destination:pattern
304 Sets the log pattern for destination to pattern. Refer to
305 ovs-appctl(8) for a description of the valid syntax for pattern.
306
307 -vFACILITY:facility
308 --verbose=FACILITY:facility
309 Sets the RFC5424 facility of the log message. facility can be
310 one of kern, user, mail, daemon, auth, syslog, lpr, news, uucp,
311 clock, ftp, ntp, audit, alert, clock2, local0, local1, local2,
312 local3, local4, local5, local6 or local7. If this option is not
313 specified, daemon is used as the default for the local system
314 syslog and local0 is used while sending a message to the target
315 provided via the --syslog-target option.
316
317 --log-file[=file]
318 Enables logging to a file. If file is specified, then it is
319 used as the exact name for the log file. The default log file
320 name used if file is omitted is /var/log/open‐
321 vswitch/ovs-vsctl.log.
322
323 --syslog-target=host:port
324 Send syslog messages to UDP port on host, in addition to the
325 system syslog. The host must be a numerical IP address, not a
326 hostname.
327
328 --syslog-method=method
329 Specify method how syslog messages should be sent to syslog dae‐
330 mon. Following forms are supported:
331
332 · libc, use libc syslog() function. Downside of using this
333 options is that libc adds fixed prefix to every message
334 before it is actually sent to the syslog daemon over
335 /dev/log UNIX domain socket.
336
337 · unix:file, use UNIX domain socket directly. It is possi‐
338 ble to specify arbitrary message format with this option.
339 However, rsyslogd 8.9 and older versions use hard coded
340 parser function anyway that limits UNIX domain socket
341 use. If you want to use arbitrary message format with
342 older rsyslogd versions, then use UDP socket to localhost
343 IP address instead.
344
345 · udp:ip:port, use UDP socket. With this method it is pos‐
346 sible to use arbitrary message format also with older
347 rsyslogd. When sending syslog messages over UDP socket
348 extra precaution needs to be taken into account, for
349 example, syslog daemon needs to be configured to listen
350 on the specified UDP port, accidental iptables rules
351 could be interfering with local syslog traffic and there
352 are some security considerations that apply to UDP sock‐
353 ets, but do not apply to UNIX domain sockets.
354
355 · null, discards all messages logged to syslog.
356
357 The default is taken from the OVS_SYSLOG_METHOD environment
358 variable; if it is unset, the default is libc.
359
360 -h
361 --help Prints a brief help message to the console.
362
363 -V
364 --version
365 Prints version information to the console.
366
368 The commands implemented by ovs-vsctl are described in the sections
369 below.
370
371 Open vSwitch Commands
372 These commands work with an Open vSwitch as a whole.
373
374 init Initializes the Open vSwitch database, if it is empty. If the
375 database has already been initialized, this command has no
376 effect.
377
378 Any successful ovs-vsctl command automatically initializes the
379 Open vSwitch database if it is empty. This command is provided
380 to initialize the database without executing any other command.
381
382 show Prints a brief overview of the database contents.
383
384 emer-reset
385 Reset the configuration into a clean state. It deconfigures
386 OpenFlow controllers, OVSDB servers, and SSL, and deletes port
387 mirroring, fail_mode, NetFlow, sFlow, and IPFIX configuration.
388 This command also removes all other-config keys from all data‐
389 base records, except that other-config:hwaddr is preserved if it
390 is present in a Bridge record. Other networking configuration
391 is left as-is.
392
393 Bridge Commands
394 These commands examine and manipulate Open vSwitch bridges.
395
396 [--may-exist] add-br bridge
397 Creates a new bridge named bridge. Initially the bridge will
398 have no ports (other than bridge itself).
399
400 Without --may-exist, attempting to create a bridge that exists
401 is an error. With --may-exist, this command does nothing if
402 bridge already exists as a real bridge.
403
404 [--may-exist] add-br bridge parent vlan
405 Creates a ``fake bridge'' named bridge within the existing Open
406 vSwitch bridge parent, which must already exist and must not
407 itself be a fake bridge. The new fake bridge will be on 802.1Q
408 VLAN vlan, which must be an integer between 0 and 4095. The
409 parent bridge must not already have a fake bridge for vlan.
410 Initially bridge will have no ports (other than bridge itself).
411
412 Without --may-exist, attempting to create a bridge that exists
413 is an error. With --may-exist, this command does nothing if
414 bridge already exists as a VLAN bridge under parent for vlan.
415
416 [--if-exists] del-br bridge
417 Deletes bridge and all of its ports. If bridge is a real
418 bridge, this command also deletes any fake bridges that were
419 created with bridge as parent, including all of their ports.
420
421 Without --if-exists, attempting to delete a bridge that does not
422 exist is an error. With --if-exists, attempting to delete a
423 bridge that does not exist has no effect.
424
425 [--real|--fake] list-br
426 Lists all existing real and fake bridges on standard output, one
427 per line. With --real or --fake, only bridges of that type are
428 returned.
429
430 br-exists bridge
431 Tests whether bridge exists as a real or fake bridge. If so,
432 ovs-vsctl exits successfully with exit code 0. If not,
433 ovs-vsctl exits unsuccessfully with exit code 2.
434
435 br-to-vlan bridge
436 If bridge is a fake bridge, prints the bridge's 802.1Q VLAN as a
437 decimal integer. If bridge is a real bridge, prints 0.
438
439 br-to-parent bridge
440 If bridge is a fake bridge, prints the name of its parent
441 bridge. If bridge is a real bridge, print bridge.
442
443 br-set-external-id bridge key [value]
444 Sets or clears an ``external ID'' value on bridge. These values
445 are intended to identify entities external to Open vSwitch with
446 which bridge is associated, e.g. the bridge's identifier in a
447 virtualization management platform. The Open vSwitch database
448 schema specifies well-known key values, but key and value are
449 otherwise arbitrary strings.
450
451 If value is specified, then key is set to value for bridge,
452 overwriting any previous value. If value is omitted, then key
453 is removed from bridge's set of external IDs (if it was
454 present).
455
456 For real bridges, the effect of this command is similar to that
457 of a set or remove command in the external-ids column of the
458 Bridge table. For fake bridges, it actually modifies keys with
459 names prefixed by fake-bridge- in the Port table.
460
461 br-get-external-id bridge [key]
462 Queries the external IDs on bridge. If key is specified, the
463 output is the value for that key or the empty string if key is
464 unset. If key is omitted, the output is key=value, one per
465 line, for each key-value pair.
466
467 For real bridges, the effect of this command is similar to that
468 of a get command in the external-ids column of the Bridge table.
469 For fake bridges, it queries keys with names prefixed by
470 fake-bridge- in the Port table.
471
472 Port Commands
473 These commands examine and manipulate Open vSwitch ports. These com‐
474 mands treat a bonded port as a single entity.
475
476 list-ports bridge
477 Lists all of the ports within bridge on standard output, one per
478 line. The local port bridge is not included in the list.
479
480 [--may-exist] add-port bridge port [column[:key]=value]...
481 Creates on bridge a new port named port from the network device
482 of the same name.
483
484 Optional arguments set values of column in the Port record cre‐
485 ated by the command. For example, tag=9 would make the port an
486 access port for VLAN 9. The syntax is the same as that for the
487 set command (see Database Commands below).
488
489 Without --may-exist, attempting to create a port that exists is
490 an error. With --may-exist, this command does nothing if port
491 already exists on bridge and is not a bonded port.
492
493 [--if-exists] del-port [bridge] port
494 Deletes port. If bridge is omitted, port is removed from what‐
495 ever bridge contains it; if bridge is specified, it must be the
496 real or fake bridge that contains port.
497
498 Without --if-exists, attempting to delete a port that does not
499 exist is an error. With --if-exists, attempting to delete a
500 port that does not exist has no effect.
501
502 [--if-exists] --with-iface del-port [bridge] iface
503 Deletes the port named iface or that has an interface named
504 iface. If bridge is omitted, the port is removed from whatever
505 bridge contains it; if bridge is specified, it must be the real
506 or fake bridge that contains the port.
507
508 Without --if-exists, attempting to delete the port for an inter‐
509 face that does not exist is an error. With --if-exists,
510 attempting to delete the port for an interface that does not
511 exist has no effect.
512
513 port-to-br port
514 Prints the name of the bridge that contains port on standard
515 output.
516
517 Bond Commands
518 These commands work with ports that have more than one interface, which
519 Open vSwitch calls ``bonds.''
520
521 [--fake-iface] add-bond bridge port iface... [column[:key]=value]...
522 Creates on bridge a new port named port that bonds together the
523 network devices given as each iface. At least two interfaces
524 must be named. If the interfaces are DPDK enabled then the
525 transaction will need to include operations to explicitly set
526 the interface type to 'dpdk'.
527
528 Optional arguments set values of column in the Port record cre‐
529 ated by the command. The syntax is the same as that for the set
530 command (see Database Commands below).
531
532 With --fake-iface, a fake interface with the name port is cre‐
533 ated. This should only be used for compatibility with legacy
534 software that requires it.
535
536 Without --may-exist, attempting to create a port that exists is
537 an error. With --may-exist, this command does nothing if port
538 already exists on bridge and bonds together exactly the speci‐
539 fied interfaces.
540
541 [--may-exist] add-bond-iface bond iface
542 Adds iface as a new bond interface to the existing port bond.
543 If bond previously had only one port, this transforms it into a
544 bond.
545
546 Without --may-exist, attempting to add an iface that is already
547 part of bond is an error. With --may-exist, this command does
548 nothing if iface is already part of bond. (It is still an error
549 if iface is an interface of some other port or bond.)
550
551 [--if-exists] del-bond-iface [bond] iface
552 Removes iface from its port. If bond is omitted, iface is
553 removed from whatever port contains it; if bond is specified, it
554 must be the port that contains bond.
555
556 If removing iface causes its port to have only a single inter‐
557 face, then that port transforms from a bond into an ordinary
558 port. It is an error if iface is the only interface in its
559 port.
560
561 Without --if-exists, attempting to delete an interface that does
562 not exist is an error. With --if-exists, attempting to delete
563 an interface that does not exist has no effect.
564
565 Interface Commands
566 These commands examine the interfaces attached to an Open vSwitch
567 bridge. These commands treat a bonded port as a collection of two or
568 more interfaces, rather than as a single port.
569
570 list-ifaces bridge
571 Lists all of the interfaces within bridge on standard output,
572 one per line. The local port bridge is not included in the
573 list.
574
575 iface-to-br iface
576 Prints the name of the bridge that contains iface on standard
577 output.
578
579 OpenFlow Controller Connectivity
580 ovs-vswitchd can perform all configured bridging and switching locally,
581 or it can be configured to communicate with one or more external Open‐
582 Flow controllers. The switch is typically configured to connect to a
583 primary controller that takes charge of the bridge's flow table to
584 implement a network policy. In addition, the switch can be configured
585 to listen to connections from service controllers. Service controllers
586 are typically used for occasional support and maintenance, e.g. with
587 ovs-ofctl.
588
589 get-controller bridge
590 Prints the configured controller target.
591
592 del-controller bridge
593 Deletes the configured controller target.
594
595 set-controller bridge target...
596 Sets the configured controller target or targets. Each target
597 may use any of the following forms:
598
599 ssl:host[:port]
600 tcp:host[:port]
601 The specified port on the given host, which can be
602 expressed either as a DNS name (if built with unbound
603 library) or an IP address in IPv4 or IPv6 address format.
604 Wrap IPv6 addresses in square brackets, e.g.
605 tcp:[::1]:6653. On Linux, use %device to designate a
606 scope for IPv6 link-level addresses, e.g.
607 tcp:[fe80::1234%eth0]:6653. For ssl, the --private-key,
608 --certificate, and --ca-cert options are mandatory.
609
610 If port is not specified, it defaults to 6653.
611
612 unix:file
613 On POSIX, a Unix domain server socket named file.
614
615 On Windows, connect to a local named pipe that is repre‐
616 sented by a file created in the path file to mimic the
617 behavior of a Unix domain socket.
618
619 pssl:[port][:host]
620 ptcp:[port][:host]
621 Listens for OpenFlow connections on port. The default
622 port is 6653. By default, connections are allowed from
623 any IPv4 address. Specify host as an IPv4 address or a
624 bracketed IPv6 address (e.g. ptcp:6653:[::1]). On Linux,
625 use %device to designate a scope for IPv6 link-level
626 addresses, e.g. ptcp:6653:[fe80::1234%eth0]. DNS names
627 can be used if built with unbound library. For pssl, the
628 --private-key,--certificate, and --ca-cert options are
629 mandatory.
630
631 punix:file
632 Listens for OpenFlow connections on the Unix domain
633 server socket named file.
634
635 Controller Failure Settings
636
637 When a controller is configured, it is, ordinarily, responsible for
638 setting up all flows on the switch. Thus, if the connection to the
639 controller fails, no new network connections can be set up. If the
640 connection to the controller stays down long enough, no packets can
641 pass through the switch at all.
642
643 If the value is standalone, or if neither of these settings is set,
644 ovs-vswitchd will take over responsibility for setting up flows when no
645 message has been received from the controller for three times the inac‐
646 tivity probe interval. In this mode, ovs-vswitchd causes the datapath
647 to act like an ordinary MAC-learning switch. ovs-vswitchd will con‐
648 tinue to retry connecting to the controller in the background and, when
649 the connection succeeds, it discontinues its standalone behavior.
650
651 If this option is set to secure, ovs-vswitchd will not set up flows on
652 its own when the controller connection fails.
653
654 get-fail-mode bridge
655 Prints the configured failure mode.
656
657 del-fail-mode bridge
658 Deletes the configured failure mode.
659
660 set-fail-mode bridge standalone|secure
661 Sets the configured failure mode.
662
663 Manager Connectivity
664 These commands manipulate the manager_options column in the
665 Open_vSwitch table and rows in the Managers table. When ovsdb-server
666 is configured to use the manager_options column for OVSDB connections
667 (as described in the startup scripts provided with Open vSwitch; the
668 corresponding ovsdb-server command option is
669 --remote=db:Open_vSwitch,Open_vSwitch,manager_options), this allows the
670 administrator to use ovs-vsctl to configure database connections.
671
672 get-manager
673 Prints the configured manager(s).
674
675 del-manager
676 Deletes the configured manager(s).
677
678 set-manager target...
679 Sets the configured manager target or targets. Each target may
680 be an OVSDB active or passive connection method, e.g. pssl:6640,
681 as described in ovsdb(7).
682
683 SSL Configuration
684 When ovs-vswitchd is configured to connect over SSL for management or
685 controller connectivity, the following parameters are required:
686
687 private-key
688 Specifies a PEM file containing the private key used as the vir‐
689 tual switch's identity for SSL connections to the controller.
690
691 certificate
692 Specifies a PEM file containing a certificate, signed by the
693 certificate authority (CA) used by the controller and manager,
694 that certifies the virtual switch's private key, identifying a
695 trustworthy switch.
696
697 ca-cert
698 Specifies a PEM file containing the CA certificate used to ver‐
699 ify that the virtual switch is connected to a trustworthy con‐
700 troller.
701
702 These files are read only once, at ovs-vswitchd startup time. If their
703 contents change, ovs-vswitchd must be killed and restarted.
704
705 These SSL settings apply to all SSL connections made by the virtual
706 switch.
707
708 get-ssl
709 Prints the SSL configuration.
710
711 del-ssl
712 Deletes the current SSL configuration.
713
714 [--bootstrap] set-ssl private-key certificate ca-cert
715 Sets the SSL configuration. The --bootstrap option is described
716 below.
717
718 CA Certificate Bootstrap
719
720 Ordinarily, all of the files named in the SSL configuration must exist
721 when ovs-vswitchd starts. However, if the ca-cert file does not exist
722 and the --bootstrap option is given, then ovs-vswitchd will attempt to
723 obtain the CA certificate from the controller on its first SSL connec‐
724 tion and save it to the named PEM file. If it is successful, it will
725 immediately drop the connection and reconnect, and from then on all SSL
726 connections must be authenticated by a certificate signed by the CA
727 certificate thus obtained.
728
729 This option exposes the SSL connection to a man-in-the-middle attack
730 obtaining the initial CA certificate, but it may be useful for boot‐
731 strapping.
732
733 This option is only useful if the controller sends its CA certificate
734 as part of the SSL certificate chain. The SSL protocol does not
735 require the controller to send the CA certificate.
736
737 Auto-Attach Commands
738 The IETF Auto-Attach SPBM draft standard describes a compact method of
739 using IEEE 802.1AB Link Layer Discovery Protocol (LLDP) together with a
740 IEEE 802.1aq Shortest Path Bridging (SPB) network to automatically
741 attach network devices to individual services in a SPB network. The
742 intent here is to allow network applications and devices using OVS to
743 be able to easily take advantage of features offered by industry stan‐
744 dard SPB networks. A fundamental element of the Auto-Attach feature is
745 to map traditional VLANs onto SPB I_SIDs. These commands manage the
746 Auto-Attach I-SID/VLAN mappings.
747
748 add-aa-mapping bridge i-sid vlan
749 Creates a new Auto-Attach mapping on bridge for i-sid and vlan.
750
751 del-aa-mapping bridge i-sid vlan
752 Deletes an Auto-Attach mapping on bridge for i-sid and vlan.
753
754 get-aa-mapping bridge
755 Lists all of the Auto-Attach mappings within bridge on standard
756 output.
757
758 Database Commands
759 These commands query and modify the contents of ovsdb tables. They are
760 a slight abstraction of the ovsdb interface and as such they operate at
761 a lower level than other ovs-vsctl commands.
762
763 Identifying Tables, Records, and Columns
764
765 Each of these commands has a table parameter to identify a table within
766 the database. Many of them also take a record parameter that identi‐
767 fies a particular record within a table. The record parameter may be
768 the UUID for a record, and many tables offer additional ways to iden‐
769 tify records. Some commands also take column parameters that identify
770 a particular field within the records in a table.
771
772 For a list of tables and their columns, see ovs-vswitchd.conf.db(5) or
773 see the table listing from the --help option.
774
775 Record names must be specified in full and with correct capitalization,
776 except that UUIDs may be abbreviated to their first 4 (or more) hex
777 digits, as long as that is unique within the table. Names of tables
778 and columns are not case-sensitive, and - and _ are treated inter‐
779 changeably. Unique abbreviations of table and column names are accept‐
780 able, e.g. net or n is sufficient to identify the NetFlow table.
781
782 Database Values
783
784 Each column in the database accepts a fixed type of data. The cur‐
785 rently defined basic types, and their representations, are:
786
787 integer
788 A decimal integer in the range -2**63 to 2**63-1, inclusive.
789
790 real A floating-point number.
791
792 Boolean
793 True or false, written true or false, respectively.
794
795 string An arbitrary Unicode string, except that null bytes are not
796 allowed. Quotes are optional for most strings that begin with
797 an English letter or underscore and consist only of letters,
798 underscores, hyphens, and periods. However, true and false and
799 strings that match the syntax of UUIDs (see below) must be
800 enclosed in double quotes to distinguish them from other basic
801 types. When double quotes are used, the syntax is that of
802 strings in JSON, e.g. backslashes may be used to escape special
803 characters. The empty string must be represented as a pair of
804 double quotes ("").
805
806 UUID Either a universally unique identifier in the style of RFC 4122,
807 e.g. f81d4fae-7dec-11d0-a765-00a0c91e6bf6, or an @name defined
808 by a get or create command within the same ovs-vsctl invocation.
809
810 Multiple values in a single column may be separated by spaces or a sin‐
811 gle comma. When multiple values are present, duplicates are not
812 allowed, and order is not important. Conversely, some database columns
813 can have an empty set of values, represented as [], and square brackets
814 may optionally enclose other non-empty sets or single values as well.
815 For a column accepting a set of integers, database commands accept a
816 range. A range is represented by two integers separated by -. A range
817 is inclusive. A range has a maximum size of 4096 elements. If more ele‐
818 ments are needed, they can be specified in seperate ranges.
819
820 A few database columns are ``maps'' of key-value pairs, where the key
821 and the value are each some fixed database type. These are specified
822 in the form key=value, where key and value follow the syntax for the
823 column's key type and value type, respectively. When multiple pairs
824 are present (separated by spaces or a comma), duplicate keys are not
825 allowed, and again the order is not important. Duplicate values are
826 allowed. An empty map is represented as {}. Curly braces may option‐
827 ally enclose non-empty maps as well (but use quotes to prevent the
828 shell from expanding other-config={0=x,1=y} into other-config=0=x
829 other-config=1=y, which may not have the desired effect).
830
831 Database Command Syntax
832
833 [--if-exists] [--columns=column[,column]...] list table [record]...
834 Lists the data in each specified record. If no records are
835 specified, lists all the records in table.
836
837 If --columns is specified, only the requested columns are
838 listed, in the specified order. Otherwise, all columns are
839 listed, in alphabetical order by column name.
840
841 Without --if-exists, it is an error if any specified record does
842 not exist. With --if-exists, the command ignores any record
843 that does not exist, without producing any output.
844
845 [--columns=column[,column]...] find table [column[:key]=value]...
846 Lists the data in each record in table whose column equals value
847 or, if key is specified, whose column contains a key with the
848 specified value. The following operators may be used where = is
849 written in the syntax summary:
850
851 = != < > <= >=
852 Selects records in which column[:key] equals, does not
853 equal, is less than, is greater than, is less than or
854 equal to, or is greater than or equal to value, respec‐
855 tively.
856
857 Consider column[:key] and value as sets of elements.
858 Identical sets are considered equal. Otherwise, if the
859 sets have different numbers of elements, then the set
860 with more elements is considered to be larger. Other‐
861 wise, consider a element from each set pairwise, in
862 increasing order within each set. The first pair that
863 differs determines the result. (For a column that con‐
864 tains key-value pairs, first all the keys are compared,
865 and values are considered only if the two sets contain
866 identical keys.)
867
868 {=} {!=}
869 Test for set equality or inequality, respectively.
870
871 {<=} Selects records in which column[:key] is a subset of
872 value. For example, flood-vlans{<=}1,2 selects records
873 in which the flood-vlans column is the empty set or con‐
874 tains 1 or 2 or both.
875
876 {<} Selects records in which column[:key] is a proper subset
877 of value. For example, flood-vlans{<}1,2 selects records
878 in which the flood-vlans column is the empty set or con‐
879 tains 1 or 2 but not both.
880
881 {>=} {>}
882 Same as {<=} and {<}, respectively, except that the rela‐
883 tionship is reversed. For example, flood-vlans{>=}1,2
884 selects records in which the flood-vlans column contains
885 both 1 and 2.
886
887 For arithmetic operators (= != < > <= >=), when key is specified
888 but a particular record's column does not contain key, the
889 record is always omitted from the results. Thus, the condition
890 other-config:mtu!=1500 matches records that have a mtu key whose
891 value is not 1500, but not those that lack an mtu key.
892
893 For the set operators, when key is specified but a particular
894 record's column does not contain key, the comparison is done
895 against an empty set. Thus, the condition other-con‐
896 fig:mtu{!=}1500 matches records that have a mtu key whose value
897 is not 1500 and those that lack an mtu key.
898
899 Don't forget to escape < or > from interpretation by the shell.
900
901 If --columns is specified, only the requested columns are
902 listed, in the specified order. Otherwise all columns are
903 listed, in alphabetical order by column name.
904
905 The UUIDs shown for rows created in the same ovs-vsctl invoca‐
906 tion will be wrong.
907
908 [--if-exists] [--id=@name] get table record [column[:key]]...
909 Prints the value of each specified column in the given record in
910 table. For map columns, a key may optionally be specified, in
911 which case the value associated with key in the column is
912 printed, instead of the entire map.
913
914 Without --if-exists, it is an error if record does not exist or
915 key is specified, if key does not exist in record. With
916 --if-exists, a missing record yields no output and a missing key
917 prints a blank line.
918
919 If @name is specified, then the UUID for record may be referred
920 to by that name later in the same ovs-vsctl invocation in con‐
921 texts where a UUID is expected.
922
923 Both --id and the column arguments are optional, but usually at
924 least one or the other should be specified. If both are omit‐
925 ted, then get has no effect except to verify that record exists
926 in table.
927
928 --id and --if-exists cannot be used together.
929
930 [--if-exists] set table record column[:key]=value...
931 Sets the value of each specified column in the given record in
932 table to value. For map columns, a key may optionally be speci‐
933 fied, in which case the value associated with key in that column
934 is changed (or added, if none exists), instead of the entire
935 map.
936
937 Without --if-exists, it is an error if record does not exist.
938 With --if-exists, this command does nothing if record does not
939 exist.
940
941 [--if-exists] add table record column [key=]value...
942 Adds the specified value or key-value pair to column in record
943 in table. If column is a map, then key is required, otherwise
944 it is prohibited. If key already exists in a map column, then
945 the current value is not replaced (use the set command to
946 replace an existing value).
947
948 Without --if-exists, it is an error if record does not exist.
949 With --if-exists, this command does nothing if record does not
950 exist.
951
952 [--if-exists] remove table record column value...
953 [--if-exists] remove table record column key...
954 [--if-exists] remove table record column key=value...
955 Removes the specified values or key-value pairs from column in
956 record in table. The first form applies to columns that are not
957 maps: each specified value is removed from the column. The sec‐
958 ond and third forms apply to map columns: if only a key is spec‐
959 ified, then any key-value pair with the given key is removed,
960 regardless of its value; if a value is given then a pair is
961 removed only if both key and value match.
962
963 It is not an error if the column does not contain the specified
964 key or value or pair.
965
966 Without --if-exists, it is an error if record does not exist.
967 With --if-exists, this command does nothing if record does not
968 exist.
969
970 [--if-exists] clear table record column...
971 Sets each column in record in table to the empty set or empty
972 map, as appropriate. This command applies only to columns that
973 are allowed to be empty.
974
975 Without --if-exists, it is an error if record does not exist.
976 With --if-exists, this command does nothing if record does not
977 exist.
978
979 [--id=@name] create table column[:key]=value...
980 Creates a new record in table and sets the initial values of
981 each column. Columns not explicitly set will receive their
982 default values. Outputs the UUID of the new row.
983
984 If @name is specified, then the UUID for the new row may be
985 referred to by that name elsewhere in the same ovs-vsctl invoca‐
986 tion in contexts where a UUID is expected. Such references may
987 precede or follow the create command.
988
989 Caution (ovs-vsctl as example)
990 Records in the Open vSwitch database are significant only
991 when they can be reached directly or indirectly from the
992 Open_vSwitch table. Except for records in the QoS or
993 Queue tables, records that are not reachable from the
994 Open_vSwitch table are automatically deleted from the
995 database. This deletion happens immediately, without
996 waiting for additional ovs-vsctl commands or other data‐
997 base activity. Thus, a create command must generally be
998 accompanied by additional commands within the same
999 ovs-vsctl invocation to add a chain of references to the
1000 newly created record from the top-level Open_vSwitch
1001 record. The EXAMPLES section gives some examples that
1002 show how to do this.
1003
1004 [--if-exists] destroy table record...
1005 Deletes each specified record from table. Unless --if-exists is
1006 specified, each records must exist.
1007
1008 --all destroy table
1009 Deletes all records from the table.
1010
1011 Caution (ovs-vsctl as example)
1012 The destroy command is only useful for records in the QoS
1013 or Queue tables. Records in other tables are automati‐
1014 cally deleted from the database when they become unreach‐
1015 able from the Open_vSwitch table. This means that delet‐
1016 ing the last reference to a record is sufficient for
1017 deleting the record itself. For records in these tables,
1018 destroy is silently ignored. See the EXAMPLES section
1019 below for more information.
1020
1021 wait-until table record [column[:key]=value]...
1022 Waits until table contains a record named record whose column
1023 equals value or, if key is specified, whose column contains a
1024 key with the specified value. Any of the operators !=, <, >,
1025 <=, or >= may be substituted for = to test for inequality, less
1026 than, greater than, less than or equal to, or greater than or
1027 equal to, respectively. (Don't forget to escape < or > from
1028 interpretation by the shell.)
1029
1030 If no column[:key]=value arguments are given, this command waits
1031 only until record exists. If more than one such argument is
1032 given, the command waits until all of them are satisfied.
1033
1034 Caution (ovs-vsctl as example)
1035 Usually wait-until should be placed at the beginning of a
1036 set of ovs-vsctl commands. For example, wait-until
1037 bridge br0 -- get bridge br0 datapath_id waits until a
1038 bridge named br0 is created, then prints its datapath_id
1039 column, whereas get bridge br0 datapath_id -- wait-until
1040 bridge br0 will abort if no bridge named br0 exists when
1041 ovs-vsctl initially connects to the database.
1042
1043 Consider specifying --timeout=0 along with --wait-until, to pre‐
1044 vent ovs-vsctl from terminating after waiting only at most 5
1045 seconds.
1046
1047 comment [arg]...
1048 This command has no effect on behavior, but any database log
1049 record created by the command will include the command and its
1050 arguments.
1051
1053 Create a new bridge named br0 and add port eth0 to it:
1054
1055 ovs-vsctl add-br br0
1056 ovs-vsctl add-port br0 eth0
1057
1058 Alternatively, perform both operations in a single atomic transaction:
1059
1060 ovs-vsctl add-br br0 -- add-port br0 eth0
1061
1062 Delete bridge br0, reporting an error if it does not exist:
1063
1064 ovs-vsctl del-br br0
1065
1066 Delete bridge br0 if it exists:
1067
1068 ovs-vsctl --if-exists del-br br0
1069
1070 Set the qos column of the Port record for eth0 to point to a new QoS
1071 record, which in turn points with its queue 0 to a new Queue record:
1072
1073 ovs-vsctl -- set port eth0 qos=@newqos -- --id=@newqos create
1074 qos type=linux-htb other-config:max-rate=1000000
1075 queues:0=@newqueue -- --id=@newqueue create queue other-con‐
1076 fig:min-rate=1000000 other-config:max-rate=1000000
1077
1079 Port Configuration
1080 Add an ``internal port'' vlan10 to bridge br0 as a VLAN access port for
1081 VLAN 10, and configure it with an IP address:
1082
1083 ovs-vsctl add-port br0 vlan10 tag=10 -- set Interface vlan10
1084 type=internal
1085
1086 ip addr add 192.168.0.123/24 dev vlan10
1087
1088 Add a GRE tunnel port gre0 to remote IP address 1.2.3.4 to bridge br0:
1089
1090 ovs-vsctl add-port br0 gre0 -- set Interface gre0 type=gre
1091 options:remote_ip=1.2.3.4
1092
1093 Port Mirroring
1094 Mirror all packets received or sent on eth0 or eth1 onto eth2, assuming
1095 that all of those ports exist on bridge br0 (as a side-effect this
1096 causes any packets received on eth2 to be ignored):
1097
1098 ovs-vsctl -- set Bridge br0 mirrors=@m \
1099
1100 -- --id=@eth0 get Port eth0 \
1101
1102 -- --id=@eth1 get Port eth1 \
1103
1104 -- --id=@eth2 get Port eth2 \
1105
1106 -- --id=@m create Mirror name=mymirror select-dst-
1107 port=@eth0,@eth1 select-src-port=@eth0,@eth1 output-port=@eth2
1108
1109 Remove the mirror created above from br0, which also destroys the Mir‐
1110 ror record (since it is now unreferenced):
1111
1112 ovs-vsctl -- --id=@rec get Mirror mymirror \
1113
1114 -- remove Bridge br0 mirrors @rec
1115
1116 The following simpler command also works:
1117
1118 ovs-vsctl clear Bridge br0 mirrors
1119
1120 Quality of Service (QoS)
1121 Create a linux-htb QoS record that points to a few queues and use it on
1122 eth0 and eth1:
1123
1124 ovs-vsctl -- set Port eth0 qos=@newqos \
1125
1126 -- set Port eth1 qos=@newqos \
1127
1128 -- --id=@newqos create QoS type=linux-htb other-con‐
1129 fig:max-rate=1000000000 queues=0=@q0,1=@q1 \
1130
1131 -- --id=@q0 create Queue other-config:min-rate=100000000
1132 other-config:max-rate=100000000 \
1133
1134 -- --id=@q1 create Queue other-config:min-rate=500000000
1135
1136 Deconfigure the QoS record above from eth1 only:
1137
1138 ovs-vsctl clear Port eth1 qos
1139
1140 To deconfigure the QoS record from both eth0 and eth1 and then delete
1141 the QoS record (which must be done explicitly because unreferenced QoS
1142 records are not automatically destroyed):
1143
1144 ovs-vsctl -- destroy QoS eth0 -- clear Port eth0 qos -- clear
1145 Port eth1 qos
1146
1147 (This command will leave two unreferenced Queue records in the data‐
1148 base. To delete them, use "ovs-vsctl list Queue" to find their UUIDs,
1149 then "ovs-vsctl destroy Queue uuid1 uuid2" to destroy each of them or
1150 use "ovs-vsctl -- --all destroy Queue" to delete all records.)
1151
1152 Connectivity Monitoring
1153 Monitor connectivity to a remote maintenance point on eth0.
1154
1155 ovs-vsctl set Interface eth0 cfm_mpid=1
1156
1157 Deconfigure connectivity monitoring from above:
1158
1159 ovs-vsctl clear Interface eth0 cfm_mpid
1160
1161 NetFlow
1162 Configure bridge br0 to send NetFlow records to UDP port 5566 on host
1163 192.168.0.34, with an active timeout of 30 seconds:
1164
1165 ovs-vsctl -- set Bridge br0 netflow=@nf \
1166
1167 -- --id=@nf create NetFlow targets=\"192.168.0.34:5566\"
1168 active-timeout=30
1169
1170 Update the NetFlow configuration created by the previous command to
1171 instead use an active timeout of 60 seconds:
1172
1173 ovs-vsctl set NetFlow br0 active_timeout=60
1174
1175 Deconfigure the NetFlow settings from br0, which also destroys the Net‐
1176 Flow record (since it is now unreferenced):
1177
1178 ovs-vsctl clear Bridge br0 netflow
1179
1180 sFlow
1181 Configure bridge br0 to send sFlow records to a collector on 10.0.0.1
1182 at port 6343, using eth1´s IP address as the source, with specific sam‐
1183 pling parameters:
1184
1185 ovs-vsctl -- --id=@s create sFlow agent=eth1 tar‐
1186 get=\"10.0.0.1:6343\" header=128 sampling=64 polling=10 \
1187
1188 -- set Bridge br0 sflow=@s
1189
1190 Deconfigure sFlow from br0, which also destroys the sFlow record (since
1191 it is now unreferenced):
1192
1193 ovs-vsctl -- clear Bridge br0 sflow
1194
1195 IPFIX
1196 Configure bridge br0 to send one IPFIX flow record per packet sample to
1197 UDP port 4739 on host 192.168.0.34, with Observation Domain ID 123 and
1198 Observation Point ID 456, a flow cache active timeout of 1 minute (60
1199 seconds), maximum flow cache size of 13 flows, and flows sampled on
1200 output port with tunnel info(sampling on input and output port is
1201 enabled by default if not disabled) :
1202
1203 ovs-vsctl -- set Bridge br0 ipfix=@i \
1204
1205 -- --id=@i create IPFIX targets=\"192.168.0.34:4739\"
1206 obs_domain_id=123 obs_point_id=456 cache_active_timeout=60
1207 cache_max_flows=13 \
1208
1209 other_config:enable-input-sampling=false other_config:enable-
1210 tunnel-sampling=true
1211
1212 Deconfigure the IPFIX settings from br0, which also destroys the IPFIX
1213 record (since it is now unreferenced):
1214
1215 ovs-vsctl clear Bridge br0 ipfix
1216
1217 802.1D Spanning Tree Protocol (STP)
1218 Configure bridge br0 to participate in an 802.1D spanning tree:
1219
1220 ovs-vsctl set Bridge br0 stp_enable=true
1221
1222 Set the bridge priority of br0 to 0x7800:
1223
1224 ovs-vsctl set Bridge br0 other_config:stp-priority=0x7800
1225
1226 Set the path cost of port eth0 to 10:
1227
1228 ovs-vsctl set Port eth0 other_config:stp-path-cost=10
1229
1230 Deconfigure STP from above:
1231
1232 ovs-vsctl set Bridge br0 stp_enable=false
1233
1234 Multicast Snooping
1235 Configure bridge br0 to enable multicast snooping:
1236
1237 ovs-vsctl set Bridge br0 mcast_snooping_enable=true
1238
1239 Set the multicast snooping aging time br0 to 300 seconds:
1240
1241 ovs-vsctl set Bridge br0 other_config:mcast-snooping-aging-
1242 time=300
1243
1244 Set the multicast snooping table size br0 to 2048 entries:
1245
1246 ovs-vsctl set Bridge br0 other_config:mcast-snooping-table-
1247 size=2048
1248
1249 Disable flooding of unregistered multicast packets to all ports. When
1250 set to true, the switch will send unregistered multicast packets only
1251 to ports connected to multicast routers. When it is set to false, the
1252 switch will send them to all ports. This command disables the flood of
1253 unregistered packets on bridge br0.
1254
1255 ovs-vsctl set Bridge br0 other_config:mcast-snooping-disable-
1256 flood-unregistered=true
1257
1258 Enable flooding of multicast packets (except Reports) on a specific
1259 port.
1260
1261 ovs-vsctl set Port eth1 other_config:mcast-snooping-flood=true
1262
1263 Enable flooding of Reports on a specific port.
1264
1265 ovs-vsctl set Port eth1 other_config:mcast-snooping-flood-
1266 reports=true
1267
1268 Deconfigure multicasting snooping from above:
1269
1270 ovs-vsctl set Bridge br0 mcast_snooping_enable=false
1271
1272 802.1D-2004 Rapid Spanning Tree Protocol (RSTP)
1273 Configure bridge br0 to participate in an 802.1D-2004 Rapid Spanning
1274 Tree:
1275
1276 ovs-vsctl set Bridge br0 rstp_enable=true
1277
1278 Set the bridge address of br0 to 00:aa:aa:aa:aa:aa :
1279
1280 ovs-vsctl set Bridge br0 other_config:rstp-
1281 address=00:aa:aa:aa:aa:aa
1282
1283 Set the bridge priority of br0 to 0x7000. The value must be specified
1284 in decimal notation and should be a multiple of 4096 (if not, it is
1285 rounded down to the nearest multiple of 4096). The default priority
1286 value is 0x800 (32768).
1287
1288 ovs-vsctl set Bridge br0 other_config:rstp-priority=28672
1289
1290 Set the bridge ageing time of br0 to 1000 s. The ageing time value
1291 should be between 10 s and 1000000 s. The default value is 300 s.
1292
1293 ovs-vsctl set Bridge br0 other_config:rstp-ageing-time=1000
1294
1295 Set the bridge force protocol version of br0 to 0. The force protocol
1296 version has two acceptable values: 0 (STP compatibility mode) and 2
1297 (normal operation).
1298
1299 ovs-vsctl set Bridge br0 other_config:rstp-force-protocol-ver‐
1300 sion=0
1301
1302 Set the bridge max age of br0 to 10 s. The max age value should be
1303 between 6 s and 40 s. The default value is 20 s.
1304
1305 ovs-vsctl set Bridge br0 other_config:rstp-max-age=10
1306
1307 Set the bridge forward delay of br0 to 15 s. This value should be
1308 between 4 s and 30 s. The default value is 15 s.
1309
1310 ovs-vsctl set Bridge br0 other_config:rstp-forward-delay=15
1311
1312 Set the bridge transmit hold count of br0 to 7 s. This value should be
1313 between 1 s and 10 s. The default value is 6 s.
1314
1315 ovs-vsctl set Bridge br0 other_config:rstp-transmit-hold-count=7
1316
1317 Enable RSTP on the Port eth0:
1318
1319 ovs-vsctl set Port eth0 other_config:rstp-enable=true
1320
1321 Disable RSTP on the Port eth0:
1322
1323 ovs-vsctl set Port eth0 other_config:rstp-enable=false
1324
1325 Set the priority of port eth0 to 32. The value must be specified in
1326 decimal notation and should be a multiple of 16 (if not, it is rounded
1327 down to the nearest multiple of 16). The default priority value is 0x80
1328 (128).
1329
1330 ovs-vsctl set Port eth0 other_config:rstp-port-priority=32
1331
1332 Set the port number of port eth0 to 3:
1333
1334 ovs-vsctl set Port eth0 other_config:rstp-port-num=3
1335
1336 Set the path cost of port eth0 to 150:
1337
1338 ovs-vsctl set Port eth0 other_config:rstp-path-cost=150
1339
1340 Set the admin edge value of port eth0:
1341
1342 ovs-vsctl set Port eth0 other_config:rstp-port-admin-edge=true
1343
1344 Set the auto edge value of port eth0:
1345
1346 ovs-vsctl set Port eth0 other_config:rstp-port-auto-edge=true
1347
1348 Set the admin point to point MAC value of port eth0. Acceptable values
1349 are 0 (not point-to-point), 1 (point-to-point, the default value) or 2
1350 (automatic detection). The auto-detection mode is not currently imple‐
1351 mented, and the value 2 has the same effect of 0 (not point-to-point).
1352
1353 ovs-vsctl set Port eth0 other_config:rstp-admin-p2p-mac=1
1354
1355 Set the admin port state value of port eth0. true is the default
1356 value.
1357
1358 ovs-vsctl set Port eth0 other_config:rstp-admin-port-state=false
1359
1360 Set the mcheck value of port eth0:
1361
1362 ovs-vsctl set Port eth0 other_config:rstp-port-mcheck=true
1363
1364 Deconfigure RSTP from above:
1365
1366 ovs-vsctl set Bridge br0 rstp_enable=false
1367
1368 OpenFlow Version
1369 Configure bridge br0 to support OpenFlow versions 1.0, 1.2, and 1.3:
1370
1371 ovs-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow12,Open‐
1372 Flow13
1373
1374 Flow Table Configuration
1375 Make flow table 0 on bridge br0 refuse to accept more than 100 flows:
1376
1377 ovs-vsctl -- --id=@ft create Flow_Table flow_limit=100 over‐
1378 flow_policy=refuse -- set Bridge br0 flow_tables=0=@ft
1379
1380 Make flow table 0 on bridge br0 evict flows, with fairness based on the
1381 matched ingress port, when there are more than 100:
1382
1383 ovs-vsctl -- --id=@ft create Flow_Table flow_limit=100 over‐
1384 flow_policy=evict groups='"NXM_OF_IN_PORT[]"' -- set Bridge br0
1385 flow_tables:0=@ft
1386
1388 0 Successful program execution.
1389
1390 1 Usage, syntax, or configuration file error.
1391
1392 2 The bridge argument to br-exists specified the name of a bridge
1393 that does not exist.
1394
1396 ovsdb-server(1), ovs-vswitchd(8), ovs-vswitchd.conf.db(5).
1397
1398
1399
1400Open vSwitch 2.12.0 ovs-vsctl(8)