]> git.proxmox.com Git - mirror_ovs.git/blob - utilities/ovs-vsctl.8.in
ovs-vsctl: Add commands "add-bond-iface" and "del-bond-iface".
[mirror_ovs.git] / utilities / ovs-vsctl.8.in
1 .\" -*- nroff -*-
2 .de IQ
3 . br
4 . ns
5 . IP "\\$1"
6 ..
7 .de ST
8 . PP
9 . RS -0.15in
10 . I "\\$1"
11 . RE
12 ..
13 .TH ovs\-vsctl 8 "@VERSION@" "Open vSwitch" "Open vSwitch Manual"
14 .\" This program's name:
15 .ds PN ovs\-vsctl
16 .
17 .SH NAME
18 ovs\-vsctl \- utility for querying and configuring \fBovs\-vswitchd\fR
19 .
20 .SH SYNOPSIS
21 \fBovs\-vsctl\fR [\fIoptions\fR] \fB\-\-\fR [\fIoptions\fR] \fIcommand
22 \fR[\fIargs\fR] [\fB\-\-\fR [\fIoptions\fR] \fIcommand \fR[\fIargs\fR]]...
23 .
24 .SH DESCRIPTION
25 The \fBovs\-vsctl\fR program configures \fBovs\-vswitchd\fR(8) by
26 providing a high\-level interface to its configuration database.
27 See \fBovs\-vswitchd.conf.db\fR(5) for comprehensive documentation of
28 the database schema.
29 .PP
30 \fBovs\-vsctl\fR connects to an \fBovsdb\-server\fR process that
31 maintains an Open vSwitch configuration database. Using this
32 connection, it queries and possibly applies changes to the database,
33 depending on the supplied commands. Then, if it applied any changes,
34 by default it waits until \fBovs\-vswitchd\fR has finished
35 reconfiguring itself before it exits. (If you use \fBovs\-vsctl\fR
36 when \fBovs\-vswitchd\fR is not running, use \fB\-\-no\-wait\fR.)
37 .PP
38 \fBovs\-vsctl\fR can perform any number of commands in a single run,
39 implemented as a single atomic transaction against the database.
40 .PP
41 The \fBovs\-vsctl\fR command line begins with global options (see
42 \fBOPTIONS\fR below for details). The global options are followed by
43 one or more commands. Each command should begin with \fB\-\-\fR by
44 itself as a command-line argument, to separate it from the following
45 commands. (The \fB\-\-\fR before the first command is optional.) The
46 command
47 itself starts with command-specific options, if any, followed by the
48 command name and any arguments. See \fBEXAMPLES\fR below for syntax
49 examples.
50 .
51 .SS "Linux VLAN Bridging Compatibility"
52 The \fBovs\-vsctl\fR program supports the model of a bridge
53 implemented by Open vSwitch, in which a single bridge supports ports
54 on multiple VLANs. In this model, each port on a bridge is either a
55 trunk port that potentially passes packets tagged with 802.1Q headers
56 that designate VLANs or it is assigned a single implicit VLAN that is
57 never tagged with an 802.1Q header.
58 .PP
59 For compatibility with software designed for the Linux bridge,
60 \fBovs\-vsctl\fR also supports a model in which traffic associated
61 with a given 802.1Q VLAN is segregated into a separate bridge. A
62 special form of the \fBadd\-br\fR command (see below) creates a ``fake
63 bridge'' within an Open vSwitch bridge to simulate this behavior.
64 When such a ``fake bridge'' is active, \fBovs\-vsctl\fR will treat it
65 much like a bridge separate from its ``parent bridge,'' but the actual
66 implementation in Open vSwitch uses only a single bridge, with ports on
67 the fake bridge assigned the implicit VLAN of the fake bridge of which
68 they are members. (A fake bridge for VLAN 0 receives packets that
69 have no 802.1Q tag or a tag with VLAN 0.)
70 .
71 .SH OPTIONS
72 .
73 The following options affect the behavior \fBovs\-vsctl\fR as a whole.
74 Some individual commands also accept their own options, which are
75 given just before the command name. If the first command on the
76 command line has options, then those options must be separated from
77 the global options by \fB\-\-\fR.
78 .
79 .IP "\fB\-\-db=\fIserver\fR"
80 Sets \fIserver\fR as the database server that \fBovs\-vsctl\fR
81 contacts to query or modify configuration. \fIserver\fR may be an
82 OVSDB active or passive connection method, as described in
83 \fBovsdb\fR(7). The default is \fBunix:@RUNDIR@/db.sock\fR.
84 .IP "\fB\-\-no\-wait\fR"
85 Prevents \fBovs\-vsctl\fR from waiting for \fBovs\-vswitchd\fR to
86 reconfigure itself according to the modified database. This
87 option should be used if \fBovs\-vswitchd\fR is not running;
88 otherwise, \fBovs\-vsctl\fR will not exit until \fBovs\-vswitchd\fR
89 starts.
90 .IP
91 This option has no effect if the commands specified do not change the
92 database.
93 .
94 .IP "\fB\-\-no\-syslog\fR"
95 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
96 changes that it makes to the system log. This option disables this
97 logging.
98 .IP
99 This option is equivalent to \fB\-\-verbose=vsctl:syslog:warn\fR.
100 .
101 .IP "\fB\-\-oneline\fR"
102 Modifies the output format so that the output for each command is printed
103 on a single line. New-line characters that would otherwise separate
104 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
105 would otherwise appear in the output are doubled.
106 Prints a blank line for each command that has no output.
107 This option does not affect the formatting of output from the
108 \fBlist\fR or \fBfind\fR commands; see \fBTable Formatting Options\fR
109 below.
110 .
111 .IP "\fB\-\-dry\-run\fR"
112 Prevents \fBovs\-vsctl\fR from actually modifying the database.
113 .
114 .IP "\fB\-t \fIsecs\fR"
115 .IQ "\fB\-\-timeout=\fIsecs\fR"
116 By default, or with a \fIsecs\fR of \fB0\fR, \fBovs\-vsctl\fR waits
117 forever for a response from the database. This option limits runtime
118 to approximately \fIsecs\fR seconds. If the timeout expires,
119 \fBovs\-vsctl\fR will exit with a \fBSIGALRM\fR signal. (A timeout
120 would normally happen only if the database cannot be contacted, or if
121 the system is overloaded.)
122 .
123 .IP "\fB\-\-retry\fR"
124 Without this option, if \fBovs\-vsctl\fR connects outward to the
125 database server (the default) then \fBovs\-vsctl\fR will try to
126 connect once and exit with an error if the connection fails (which
127 usually means that \fBovsdb\-server\fR is not running).
128 .IP
129 With this option, or if \fB\-\-db\fR specifies that \fBovs\-vsctl\fR
130 should listen for an incoming connection from the database server,
131 then \fBovs\-vsctl\fR will wait for a connection to the database
132 forever.
133 .IP
134 Regardless of this setting, \fB\-\-timeout\fR always limits how long
135 \fBovs\-vsctl\fR will wait.
136 .
137 .SS "Table Formatting Options"
138 These options control the format of output from the \fBlist\fR and
139 \fBfind\fR commands.
140 .so lib/table.man
141 .
142 .SS "Public Key Infrastructure Options"
143 .so lib/ssl.man
144 .so lib/ssl-bootstrap.man
145 .so lib/ssl-peer-ca-cert.man
146 .so lib/vlog.man
147 .so lib/common.man
148 .
149 .SH COMMANDS
150 The commands implemented by \fBovs\-vsctl\fR are described in the
151 sections below.
152 .SS "Open vSwitch Commands"
153 These commands work with an Open vSwitch as a whole.
154 .
155 .IP "\fBinit\fR"
156 Initializes the Open vSwitch database, if it is empty. If the
157 database has already been initialized, this command has no effect.
158 .IP
159 Any successful \fBovs\-vsctl\fR command automatically initializes the
160 Open vSwitch database if it is empty. This command is provided to
161 initialize the database without executing any other command.
162 .
163 .IP "\fBshow\fR"
164 Prints a brief overview of the database contents.
165 .
166 .IP "\fBemer\-reset\fR"
167 Reset the configuration into a clean state. It deconfigures OpenFlow
168 controllers, OVSDB servers, and SSL, and deletes port mirroring,
169 \fBfail_mode\fR, NetFlow, sFlow, and IPFIX configuration. This
170 command also removes all \fBother\-config\fR keys from all database
171 records, except that \fBother\-config:hwaddr\fR is preserved if it is
172 present in a Bridge record. Other networking configuration is left
173 as-is.
174 .
175 .SS "Bridge Commands"
176 These commands examine and manipulate Open vSwitch bridges.
177 .
178 .IP "[\fB\-\-may\-exist\fR] \fBadd\-br \fIbridge\fR"
179 Creates a new bridge named \fIbridge\fR. Initially the bridge will
180 have no ports (other than \fIbridge\fR itself).
181 .IP
182 Without \fB\-\-may\-exist\fR, attempting to create a bridge that
183 exists is an error. With \fB\-\-may\-exist\fR, this command does
184 nothing if \fIbridge\fR already exists as a real bridge.
185 .
186 .IP "[\fB\-\-may\-exist\fR] \fBadd\-br \fIbridge parent vlan\fR"
187 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
188 vSwitch bridge \fIparent\fR, which must already exist and must not
189 itself be a fake bridge. The new fake bridge will be on 802.1Q VLAN
190 \fIvlan\fR, which must be an integer between 0 and 4095. The parent
191 bridge must not already have a fake bridge for \fIvlan\fR. Initially
192 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
193 .IP
194 Without \fB\-\-may\-exist\fR, attempting to create a bridge that
195 exists is an error. With \fB\-\-may\-exist\fR, this command does
196 nothing if \fIbridge\fR already exists as a VLAN bridge under
197 \fIparent\fR for \fIvlan\fR.
198 .
199 .IP "[\fB\-\-if\-exists\fR] \fBdel\-br \fIbridge\fR"
200 Deletes \fIbridge\fR and all of its ports. If \fIbridge\fR is a real
201 bridge, this command also deletes any fake bridges that were created
202 with \fIbridge\fR as parent, including all of their ports.
203 .IP
204 Without \fB\-\-if\-exists\fR, attempting to delete a bridge that does
205 not exist is an error. With \fB\-\-if\-exists\fR, attempting to
206 delete a bridge that does not exist has no effect.
207 .
208 .IP "[\fB\-\-real\fR|\fB\-\-fake\fR] \fBlist\-br\fR"
209 Lists all existing real and fake bridges on standard output, one per
210 line. With \fB\-\-real\fR or \fB\-\-fake\fR, only bridges of that type
211 are returned.
212 .
213 .IP "\fBbr\-exists \fIbridge\fR"
214 Tests whether \fIbridge\fR exists as a real or fake bridge. If so,
215 \fBovs\-vsctl\fR exits successfully with exit code 0. If not,
216 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
217 .
218 .IP "\fBbr\-to\-vlan \fIbridge\fR"
219 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
220 decimal integer. If \fIbridge\fR is a real bridge, prints 0.
221 .
222 .IP "\fBbr\-to\-parent \fIbridge\fR"
223 If \fIbridge\fR is a fake bridge, prints the name of its parent
224 bridge. If \fIbridge\fR is a real bridge, print \fIbridge\fR.
225 .
226 .IP "\fBbr\-set\-external\-id \fIbridge key\fR [\fIvalue\fR]"
227 Sets or clears an ``external ID'' value on \fIbridge\fR. These values
228 are intended to identify entities external to Open vSwitch with which
229 \fIbridge\fR is associated, e.g. the bridge's identifier in a
230 virtualization management platform. The Open vSwitch database schema
231 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
232 are otherwise arbitrary strings.
233 .IP
234 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
235 \fIbridge\fR, overwriting any previous value. If \fIvalue\fR is
236 omitted, then \fIkey\fR is removed from \fIbridge\fR's set of external
237 IDs (if it was present).
238 .IP
239 For real bridges, the effect of this command is similar to that of a
240 \fBset\fR or \fBremove\fR command in the \fBexternal\-ids\fR column of
241 the \fBBridge\fR table. For fake bridges, it actually modifies keys
242 with names prefixed by \fBfake\-bridge\-\fR in the \fBPort\fR table.
243 .
244 .IP "\fBbr\-get\-external\-id \fIbridge\fR [\fIkey\fR]"
245 Queries the external IDs on \fIbridge\fR. If \fIkey\fR is specified,
246 the output is the value for that \fIkey\fR or the empty string if
247 \fIkey\fR is unset. If \fIkey\fR is omitted, the output is
248 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
249 .IP
250 For real bridges, the effect of this command is similar to that of a
251 \fBget\fR command in the \fBexternal\-ids\fR column of the
252 \fBBridge\fR table. For fake bridges, it queries keys with names
253 prefixed by \fBfake\-bridge\-\fR in the \fBPort\fR table.
254 .
255 .SS "Port Commands"
256 .
257 These commands examine and manipulate Open vSwitch ports. These
258 commands treat a bonded port as a single entity.
259 .
260 .IP "\fBlist\-ports \fIbridge\fR"
261 Lists all of the ports within \fIbridge\fR on standard output, one per
262 line. The local port \fIbridge\fR is not included in the list.
263 .
264 .IP "[\fB\-\-may\-exist\fR] \fBadd\-port \fIbridge port \fR[\fIcolumn\fR[\fB:\fIkey\fR]\fR=\fIvalue\fR]\&...\fR"
265 Creates on \fIbridge\fR a new port named \fIport\fR from the network
266 device of the same name.
267 .IP
268 Optional arguments set values of column in the Port record created by
269 the command. For example, \fBtag=9\fR would make the port an access
270 port for VLAN 9. The syntax is the same as that for the \fBset\fR
271 command (see \fBDatabase Commands\fR below).
272 .IP
273 Without \fB\-\-may\-exist\fR, attempting to create a port that exists
274 is an error. With \fB\-\-may\-exist\fR, this command does nothing if
275 \fIport\fR already exists on \fIbridge\fR and is not a bonded port.
276 .
277 .IP "[\fB\-\-if\-exists\fR] \fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
278 Deletes \fIport\fR. If \fIbridge\fR is omitted, \fIport\fR is removed
279 from whatever bridge contains it; if \fIbridge\fR is specified, it
280 must be the real or fake bridge that contains \fIport\fR.
281 .IP
282 Without \fB\-\-if\-exists\fR, attempting to delete a port that does
283 not exist is an error. With \fB\-\-if\-exists\fR, attempting to
284 delete a port that does not exist has no effect.
285 .
286 .IP "[\fB\-\-if\-exists\fR] \fB\-\-with\-iface del\-port \fR[\fIbridge\fR] \fIiface\fR"
287 Deletes the port named \fIiface\fR or that has an interface named
288 \fIiface\fR. If \fIbridge\fR is omitted, the port is removed from
289 whatever bridge contains it; if \fIbridge\fR is specified, it must be
290 the real or fake bridge that contains the port.
291 .IP
292 Without \fB\-\-if\-exists\fR, attempting to delete the port for an
293 interface that does not exist is an error. With \fB\-\-if\-exists\fR,
294 attempting to delete the port for an interface that does not exist has
295 no effect.
296 .
297 .IP "\fBport\-to\-br \fIport\fR"
298 Prints the name of the bridge that contains \fIport\fR on standard
299 output.
300 .
301 .SS "Bond Commands"
302 .
303 These commands work with ports that have more than one interface,
304 which Open vSwitch calls ``bonds.''
305 .
306 .IP "[\fB\-\-fake\-iface\fR] \fBadd\-bond \fIbridge port iface\fR\&... [\fIcolumn\fR[\fB:\fIkey\fR]\fR=\fIvalue\fR]\&...\fR"
307 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
308 together the network devices given as each \fIiface\fR. At least two
309 interfaces must be named. If the interfaces are DPDK enabled then
310 the transaction will need to include operations to explicitly set the
311 interface type to 'dpdk'.
312 .IP
313 Optional arguments set values of column in the Port record created by
314 the command. The syntax is the same as that for the \fBset\fR command
315 (see \fBDatabase Commands\fR below).
316 .IP
317 With \fB\-\-fake\-iface\fR, a fake interface with the name \fIport\fR is
318 created. This should only be used for compatibility with legacy
319 software that requires it.
320 .IP
321 Without \fB\-\-may\-exist\fR, attempting to create a port that exists
322 is an error. With \fB\-\-may\-exist\fR, this command does nothing if
323 \fIport\fR already exists on \fIbridge\fR and bonds together exactly
324 the specified interfaces.
325 .
326 .IP "[\fB\-\-may\-exist\fR] \fBadd\-bond\-iface \fIbond iface\fR"
327 Adds \fIiface\fR as a new bond interface to the existing port
328 \fIbond\fR. If \fIbond\fR previously had only one port, this
329 transforms it into a bond.
330 .IP
331 Without \fB\-\-may\-exist\fR, attempting to add an \fIiface\fR that is
332 already part of \fIbond\fR is an error. With \fB\-\-may\-exist\fR,
333 this command does nothing if \fIiface\fR is already part of
334 \fIbond\fR. (It is still an error if \fIiface\fR is an interface of
335 some other port or bond.)
336 .
337 .IP "[\fB\-\-if\-exists\fR] \fBdel\-bond\-iface\fR [\fIbond\fR] \fIiface\fR"
338 Removes \fIiface\fR from its port. If \fIbond\fR is omitted,
339 \fIiface\fR is removed from whatever port contains it; if \fIbond\fR
340 is specified, it must be the port that contains \fIbond\fR.
341 .IP
342 If removing \fIiface\fR causes its port to have only a single
343 interface, then that port transforms from a bond into an ordinary
344 port. It is an error if \fIiface\fR is the only interface in its
345 port.
346 .IP
347 Without \fB\-\-if\-exists\fR, attempting to delete an interface that
348 does not exist is an error. With \fB\-\-if\-exists\fR, attempting to
349 delete an interface that does not exist has no effect.
350 .
351 .SS "Interface Commands"
352 .
353 These commands examine the interfaces attached to an Open vSwitch
354 bridge. These commands treat a bonded port as a collection of two or
355 more interfaces, rather than as a single port.
356 .
357 .IP "\fBlist\-ifaces \fIbridge\fR"
358 Lists all of the interfaces within \fIbridge\fR on standard output,
359 one per line. The local port \fIbridge\fR is not included in the
360 list.
361 .
362 .IP "\fBiface\-to\-br \fIiface\fR"
363 Prints the name of the bridge that contains \fIiface\fR on standard
364 output.
365 .
366 .SS "OpenFlow Controller Connectivity"
367 .
368 \fBovs\-vswitchd\fR can perform all configured bridging and switching
369 locally, or it can be configured to communicate with one or more
370 external OpenFlow controllers. The switch is typically configured to
371 connect to a primary controller that takes charge of the bridge's flow
372 table to implement a network policy. In addition, the switch can be
373 configured to listen to connections from service controllers. Service
374 controllers are typically used for occasional support and maintenance,
375 e.g. with \fBovs\-ofctl\fR.
376 .
377 .IP "\fBget\-controller\fR \fIbridge\fR"
378 Prints the configured controller target.
379 .
380 .IP "\fBdel\-controller\fR \fIbridge\fR"
381 Deletes the configured controller target.
382 .
383 .IP "\fBset\-controller\fR \fIbridge\fR \fItarget\fR\&..."
384 Sets the configured controller target or targets. Each \fItarget\fR may
385 use any of the following forms:
386 .
387 .RS
388 .so lib/vconn-active.man
389 .so lib/vconn-passive.man
390 .RE
391 .
392 .ST "Controller Failure Settings"
393 .PP
394 When a controller is configured, it is, ordinarily, responsible for
395 setting up all flows on the switch. Thus, if the connection to
396 the controller fails, no new network connections can be set up. If
397 the connection to the controller stays down long enough, no packets
398 can pass through the switch at all.
399 .PP
400 If the value is \fBstandalone\fR, or if neither of these settings
401 is set, \fBovs\-vswitchd\fR will take over
402 responsibility for setting up
403 flows when no message has been received from the controller for three
404 times the inactivity probe interval. In this mode,
405 \fBovs\-vswitchd\fR causes the datapath to act like an ordinary
406 MAC-learning switch. \fBovs\-vswitchd\fR will continue to retry connecting
407 to the controller in the background and, when the connection succeeds,
408 it discontinues its standalone behavior.
409 .PP
410 If this option is set to \fBsecure\fR, \fBovs\-vswitchd\fR will not
411 set up flows on its own when the controller connection fails.
412 .
413 .IP "\fBget\-fail\-mode\fR \fIbridge\fR"
414 Prints the configured failure mode.
415 .
416 .IP "\fBdel\-fail\-mode\fR \fIbridge\fR"
417 Deletes the configured failure mode.
418 .
419 .IP "\fBset\-fail\-mode\fR \fIbridge\fR \fBstandalone\fR|\fBsecure\fR"
420 Sets the configured failure mode.
421 .
422 .SS "Manager Connectivity"
423 .
424 These commands manipulate the \fBmanager_options\fR column in the
425 \fBOpen_vSwitch\fR table and rows in the \fBManagers\fR table. When
426 \fBovsdb\-server\fR is configured to use the \fBmanager_options\fR column for
427 OVSDB connections (as described in the startup scripts provided with
428 Open vSwitch), this allows the administrator to use \fBovs\-vsctl\fR to
429 configure database connections.
430 .
431 .IP "\fBget\-manager\fR"
432 Prints the configured manager(s).
433 .
434 .IP "\fBdel\-manager\fR"
435 Deletes the configured manager(s).
436 .
437 .IP "\fBset\-manager\fR \fItarget\fR\&..."
438 Sets the configured manager target or targets.
439 Each \fItarget\fR may be an OVSDB active or passive connection method,
440 e.g. \fBpssl:6640\fR, as described in \fBovsdb\fR(7).
441 .
442 .SS "SSL Configuration"
443 When \fBovs\-vswitchd\fR is configured to connect over SSL for management or
444 controller connectivity, the following parameters are required:
445 .TP
446 \fIprivate-key\fR
447 Specifies a PEM file containing the private key used as the virtual
448 switch's identity for SSL connections to the controller.
449 .TP
450 \fIcertificate\fR
451 Specifies a PEM file containing a certificate, signed by the
452 certificate authority (CA) used by the controller and manager, that
453 certifies the virtual switch's private key, identifying a trustworthy
454 switch.
455 .TP
456 \fIca-cert\fR
457 Specifies a PEM file containing the CA certificate used to verify that
458 the virtual switch is connected to a trustworthy controller.
459 .PP
460 These files are read only once, at \fBovs\-vswitchd\fR startup time. If
461 their contents change, \fBovs\-vswitchd\fR must be killed and restarted.
462 .PP
463 These SSL settings apply to all SSL connections made by the virtual
464 switch.
465 .
466 .IP "\fBget\-ssl\fR"
467 Prints the SSL configuration.
468 .
469 .IP "\fBdel\-ssl\fR"
470 Deletes the current SSL configuration.
471 .
472 .IP "[\fB\-\-bootstrap\fR] \fBset\-ssl\fR \fIprivate-key\fR \fIcertificate\fR \fIca-cert\fR"
473 Sets the SSL configuration. The \fB\-\-bootstrap\fR option is described
474 below.
475 .
476 .ST "CA Certificate Bootstrap"
477 .PP
478 Ordinarily, all of the files named in the SSL configuration must exist
479 when \fBovs\-vswitchd\fR starts. However, if the \fIca-cert\fR file
480 does not exist and the \fB\-\-bootstrap\fR
481 option is given, then \fBovs\-vswitchd\fR will attempt to obtain the
482 CA certificate from the controller on its first SSL connection and
483 save it to the named PEM file. If it is successful, it will
484 immediately drop the connection and reconnect, and from then on all
485 SSL connections must be authenticated by a certificate signed by the
486 CA certificate thus obtained.
487 .PP
488 \fBThis option exposes the SSL connection to a man-in-the-middle
489 attack obtaining the initial CA certificate\fR, but it may be useful
490 for bootstrapping.
491 .PP
492 This option is only useful if the controller sends its CA certificate
493 as part of the SSL certificate chain. The SSL protocol does not
494 require the controller to send the CA certificate.
495 .
496 .SS "Auto-Attach Commands"
497 .
498 The IETF Auto-Attach SPBM draft standard describes a compact method of using
499 IEEE 802.1AB Link Layer Discovery Protocol (LLDP) together with a IEEE 802.1aq
500 Shortest Path Bridging (SPB) network to automatically attach network devices to
501 individual services in a SPB network. The intent here is to allow network
502 applications and devices using OVS to be able to easily take advantage of
503 features offered by industry standard SPB networks. A fundamental element of
504 the Auto-Attach feature is to map traditional VLANs onto SPB I_SIDs. These
505 commands manage the Auto-Attach I-SID/VLAN mappings.
506 .
507 .IP "\fBadd\-aa\-mapping \fIbridge i-sid vlan\fR"
508 Creates a new Auto-Attach mapping on \fIbridge\fR for \fIi-sid\fR
509 and \fIvlan\fR.
510 .
511 .IP "\fBdel\-aa\-mapping \fIbridge i-sid vlan\fR"
512 Deletes an Auto-Attach mapping on \fIbridge\fR for \fIi-sid\fR
513 and \fIvlan\fR.
514 .IP "\fBget\-aa\-mapping \fIbridge\fR"
515 Lists all of the Auto-Attach mappings within \fIbridge\fR on standard output.
516 .
517 .SS "Database Commands"
518 .
519 These commands query and modify the contents of \fBovsdb\fR tables.
520 They are a slight abstraction of the \fBovsdb\fR interface and as such
521 they operate at a lower level than other \fBovs\-vsctl\fR commands.
522 .PP
523 .ST "Identifying Tables, Records, and Columns"
524 .PP
525 Each of these commands has a \fItable\fR parameter to identify a table
526 within the database. Many of them also take a \fIrecord\fR parameter
527 that identifies a particular record within a table. The \fIrecord\fR
528 parameter may be the UUID for a record, and many tables offer
529 additional ways to identify records. Some commands also take
530 \fIcolumn\fR parameters that identify a particular field within the
531 records in a table.
532 .PP
533 The following tables are currently defined:
534 .IP "\fBOpen_vSwitch\fR"
535 Global configuration for an \fBovs\-vswitchd\fR. This table contains
536 exactly one record, identified by specifying \fB.\fR as the record
537 name.
538 .IP "\fBBridge\fR"
539 Configuration for a bridge within an Open vSwitch. Records may be
540 identified by bridge name.
541 .IP "\fBPort\fR"
542 A bridge port. Records may be identified by port name.
543 .IP "\fBInterface\fR"
544 A network device attached to a port. Records may be identified by
545 name.
546 .IP "\fBFlow_Table\fR"
547 Configuration for a particular OpenFlow flow table. Records may be
548 identified by name.
549 .IP "\fBQoS\fR"
550 Quality-of-service configuration for a \fBPort\fR. Records may be
551 identified by port name.
552 .IP "\fBQueue\fR"
553 Configuration for one queue within a \fBQoS\fR configuration. Records
554 may only be identified by UUID.
555 .IP "\fBMirror\fR"
556 A port mirroring configuration attached to a bridge. Records may be
557 identified by mirror name.
558 .IP "\fBController\fR"
559 Configuration for an OpenFlow controller. A controller attached to a
560 particular bridge may be identified by the bridge's name.
561 .IP "\fBManager\fR"
562 Configuration for an OVSDB connection. Records may be identified
563 by target (e.g. \fBtcp:1.2.3.4\fR).
564 .IP "\fBNetFlow\fR"
565 A NetFlow configuration attached to a bridge. Records may be
566 identified by bridge name.
567 .IP "\fBSSL\fR"
568 The global SSL configuration for \fBovs\-vswitchd\fR. The record
569 attached to the \fBOpen_vSwitch\fR table may be identified by
570 specifying \fB.\fR as the record name.
571 .IP "\fBsFlow\fR"
572 An sFlow exporter configuration attached to a bridge. Records may be
573 identified by bridge name.
574 .IP "\fBIPFIX\fR"
575 An IPFIX exporter configuration attached to a bridge. Records may be
576 identified by bridge name.
577 .IP "\fBFlow_Sample_Collector_Set\fR"
578 An IPFIX exporter configuration attached to a bridge for sampling
579 packets on a per-flow basis using OpenFlow \fBsample\fR actions.
580 .IP "\fBAutoAttach\fR"
581 Configuration for Auto Attach within a bridge.
582 .PP
583 Record names must be specified in full and with correct
584 capitalization, except that UUIDs may be abbreviated to their first 4
585 (or more) hex digits, as long as that is unique within the table.
586 Names of tables and columns are not case-sensitive, and \fB\-\fR and
587 \fB_\fR are treated interchangeably. Unique abbreviations of table
588 and column names are acceptable, e.g. \fBnet\fR or \fBn\fR is
589 sufficient to identify the \fBNetFlow\fR table.
590 .
591 .so lib/db-ctl-base.man
592 .SH "EXAMPLES"
593 Create a new bridge named br0 and add port eth0 to it:
594 .IP
595 .B "ovs\-vsctl add\-br br0"
596 .br
597 .B "ovs\-vsctl add\-port br0 eth0"
598 .PP
599 Alternatively, perform both operations in a single atomic transaction:
600 .IP
601 .B "ovs\-vsctl add\-br br0 \-\- add\-port br0 eth0"
602 .PP
603 Delete bridge \fBbr0\fR, reporting an error if it does not exist:
604 .IP
605 .B "ovs\-vsctl del\-br br0"
606 .PP
607 Delete bridge \fBbr0\fR if it exists:
608 .IP
609 .B "ovs\-vsctl \-\-if\-exists del\-br br0"
610 .PP
611 Set the \fBqos\fR column of the \fBPort\fR record for \fBeth0\fR to
612 point to a new \fBQoS\fR record, which in turn points with its queue 0
613 to a new \fBQueue\fR record:
614 .IP
615 .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"
616 .SH "CONFIGURATION COOKBOOK"
617 .SS "Port Configuration"
618 .PP
619 Add an ``internal port'' \fBvlan10\fR to bridge \fBbr0\fR as a VLAN
620 access port for VLAN 10, and configure it with an IP address:
621 .IP
622 .B "ovs\-vsctl add\-port br0 vlan10 tag=10 \-\- set Interface vlan10 type=internal"
623 .IP
624 .B "ip addr add 192.168.0.123/24 dev vlan10"
625 .
626 .PP
627 Add a GRE tunnel port \fBgre0\fR to remote IP address 1.2.3.4 to
628 bridge \fBbr0\fR:
629 .IP
630 .B "ovs\-vsctl add\-port br0 gre0 \-\- set Interface gre0 type=gre options:remote_ip=1.2.3.4"
631 .
632 .SS "Port Mirroring"
633 .PP
634 Mirror all packets received or sent on \fBeth0\fR or \fBeth1\fR onto
635 \fBeth2\fR, assuming that all of those ports exist on bridge \fBbr0\fR
636 (as a side-effect this causes any packets received on \fBeth2\fR to be
637 ignored):
638 .IP
639 .B "ovs\-vsctl \-\- set Bridge br0 mirrors=@m \(rs"
640 .IP
641 .B "\-\- \-\-id=@eth0 get Port eth0 \(rs"
642 .IP
643 .B "\-\- \-\-id=@eth1 get Port eth1 \(rs"
644 .IP
645 .B "\-\- \-\-id=@eth2 get Port eth2 \(rs"
646 .IP
647 .B "\-\- \-\-id=@m create Mirror name=mymirror select-dst-port=@eth0,@eth1 select-src-port=@eth0,@eth1 output-port=@eth2"
648 .PP
649 Remove the mirror created above from \fBbr0\fR, which also destroys
650 the Mirror record (since it is now unreferenced):
651 .IP
652 .B "ovs\-vsctl \-\- \-\-id=@rec get Mirror mymirror \(rs"
653 .IP
654 .B "\-\- remove Bridge br0 mirrors @rec"
655 .PP
656 The following simpler command also works:
657 .IP
658 .B "ovs\-vsctl clear Bridge br0 mirrors"
659 .SS "Quality of Service (QoS)"
660 .PP
661 Create a \fBlinux\-htb\fR QoS record that points to a few queues and
662 use it on \fBeth0\fR and \fBeth1\fR:
663 .IP
664 .B "ovs\-vsctl \-\- set Port eth0 qos=@newqos \(rs"
665 .IP
666 .B "\-\- set Port eth1 qos=@newqos \(rs"
667 .IP
668 .B "\-\- \-\-id=@newqos create QoS type=linux\-htb other\-config:max\-rate=1000000000 queues=0=@q0,1=@q1 \(rs"
669 .IP
670 .B "\-\- \-\-id=@q0 create Queue other\-config:min\-rate=100000000 other\-config:max\-rate=100000000 \(rs"
671 .IP
672 .B "\-\- \-\-id=@q1 create Queue other\-config:min\-rate=500000000"
673 .PP
674 Deconfigure the QoS record above from \fBeth1\fR only:
675 .IP
676 .B "ovs\-vsctl clear Port eth1 qos"
677 .PP
678 To deconfigure the QoS record from both \fBeth0\fR and \fBeth1\fR and
679 then delete the QoS record (which must be done explicitly because
680 unreferenced QoS records are not automatically destroyed):
681 .IP
682 .B "ovs\-vsctl \-\- destroy QoS eth0 \-\- clear Port eth0 qos \-\- clear Port eth1 qos"
683 .PP
684 (This command will leave two unreferenced Queue records in the
685 database. To delete them, use "\fBovs\-vsctl list Queue\fR" to find
686 their UUIDs, then "\fBovs\-vsctl destroy Queue \fIuuid1\fR
687 \fIuuid2\fR" to destroy each of them or use
688 "\fBovs\-vsctl -- --all destroy Queue\fR" to delete all records.)
689 .SS "Connectivity Monitoring"
690 .PP
691 Monitor connectivity to a remote maintenance point on eth0.
692 .IP
693 .B "ovs\-vsctl set Interface eth0 cfm_mpid=1"
694 .PP
695 Deconfigure connectivity monitoring from above:
696 .IP
697 .B "ovs\-vsctl clear Interface eth0 cfm_mpid"
698 .SS "NetFlow"
699 .PP
700 Configure bridge \fBbr0\fR to send NetFlow records to UDP port 5566 on
701 host 192.168.0.34, with an active timeout of 30 seconds:
702 .IP
703 .B "ovs\-vsctl \-\- set Bridge br0 netflow=@nf \(rs"
704 .IP
705 .B "\-\- \-\-id=@nf create NetFlow targets=\(rs\(dq192.168.0.34:5566\(rs\(dq active\-timeout=30"
706 .PP
707 Update the NetFlow configuration created by the previous command to
708 instead use an active timeout of 60 seconds:
709 .IP
710 .B "ovs\-vsctl set NetFlow br0 active_timeout=60"
711 .PP
712 Deconfigure the NetFlow settings from \fBbr0\fR, which also destroys
713 the NetFlow record (since it is now unreferenced):
714 .IP
715 .B "ovs\-vsctl clear Bridge br0 netflow"
716 .SS "sFlow"
717 .PP
718 Configure bridge \fBbr0\fR to send sFlow records to a collector on
719 10.0.0.1 at port 6343, using \fBeth1\fR\'s IP address as the source,
720 with specific sampling parameters:
721 .IP
722 .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"
723 .IP
724 .B "\-\- set Bridge br0 sflow=@s"
725 .PP
726 Deconfigure sFlow from \fBbr0\fR, which also destroys the sFlow record
727 (since it is now unreferenced):
728 .IP
729 .B "ovs\-vsctl \-\- clear Bridge br0 sflow"
730 .SS "IPFIX"
731 .PP
732 Configure bridge \fBbr0\fR to send one IPFIX flow record per packet
733 sample to UDP port 4739 on host 192.168.0.34, with Observation Domain
734 ID 123 and Observation Point ID 456, a flow cache active timeout of 1
735 minute (60 seconds), maximum flow cache size of 13 flows, and flows
736 sampled on output port with tunnel info(sampling on input and output
737 port is enabled by default if not disabled) :
738 .IP
739 .B "ovs\-vsctl \-\- set Bridge br0 ipfix=@i \(rs"
740 .IP
741 .B "\-\- \-\-id=@i create IPFIX targets=\(rs\(dq192.168.0.34:4739\(rs\(dq obs_domain_id=123 obs_point_id=456 cache_active_timeout=60 cache_max_flows=13 \(rs"
742 .IP
743 .B "other_config:enable-input-sampling=false other_config:enable-tunnel-sampling=true"
744 .PP
745 Deconfigure the IPFIX settings from \fBbr0\fR, which also destroys the
746 IPFIX record (since it is now unreferenced):
747 .IP
748 .B "ovs\-vsctl clear Bridge br0 ipfix"
749 .SS "802.1D Spanning Tree Protocol (STP)"
750 .PP
751 Configure bridge \fBbr0\fR to participate in an 802.1D spanning tree:
752 .IP
753 .B "ovs\-vsctl set Bridge br0 stp_enable=true"
754 .PP
755 Set the bridge priority of \fBbr0\fR to 0x7800:
756 .IP
757 .B "ovs\-vsctl set Bridge br0 other_config:stp-priority=0x7800"
758 .PP
759 Set the path cost of port \fBeth0\fR to 10:
760 .IP
761 .B "ovs\-vsctl set Port eth0 other_config:stp-path-cost=10"
762 .PP
763 Deconfigure STP from above:
764 .IP
765 .B "ovs\-vsctl set Bridge br0 stp_enable=false"
766 .PP
767 .SS "Multicast Snooping"
768 .PP
769 Configure bridge \fBbr0\fR to enable multicast snooping:
770 .IP
771 .B "ovs\-vsctl set Bridge br0 mcast_snooping_enable=true"
772 .PP
773 Set the multicast snooping aging time \fBbr0\fR to 300 seconds:
774 .IP
775 .B "ovs\-vsctl set Bridge br0 other_config:mcast-snooping-aging-time=300"
776 .PP
777 Set the multicast snooping table size \fBbr0\fR to 2048 entries:
778 .IP
779 .B "ovs\-vsctl set Bridge br0 other_config:mcast-snooping-table-size=2048"
780 .PP
781 Disable flooding of unregistered multicast packets to all ports. When
782 set to \fBtrue\fR, the switch will send unregistered multicast packets only
783 to ports connected to multicast routers. When it is set to \fBfalse\fR, the
784 switch will send them to all ports. This command disables the flood of
785 unregistered packets on bridge \fBbr0\fR.
786 .IP
787 .B "ovs\-vsctl set Bridge br0 other_config:mcast-snooping-disable-flood-unregistered=true"
788 .PP
789 Enable flooding of multicast packets (except Reports) on a specific port.
790 .IP
791 .B "ovs\-vsctl set Port eth1 other_config:mcast-snooping-flood=true"
792 .PP
793 Enable flooding of Reports on a specific port.
794 .IP
795 .B "ovs\-vsctl set Port eth1 other_config:mcast-snooping-flood-reports=true"
796 .PP
797 Deconfigure multicasting snooping from above:
798 .IP
799 .B "ovs\-vsctl set Bridge br0 mcast_snooping_enable=false"
800 .PP
801 .SS "802.1D-2004 Rapid Spanning Tree Protocol (RSTP)"
802 .PP
803 Configure bridge \fBbr0\fR to participate in an 802.1D-2004 Rapid Spanning Tree:
804 .IP
805 .B "ovs\-vsctl set Bridge br0 rstp_enable=true"
806 .PP
807 Set the bridge address of \fBbr0\fR to 00:aa:aa:aa:aa:aa :
808 .IP
809 .B "ovs\-vsctl set Bridge br0 other_config:rstp-address=00:aa:aa:aa:aa:aa"
810 .PP
811 Set the bridge priority of \fBbr0\fR to 0x7000. The value must be specified in
812 decimal notation and should be a multiple of 4096 (if not, it is rounded down to
813 the nearest multiple of 4096). The default priority value is 0x800 (32768).
814 .IP
815 .B "ovs\-vsctl set Bridge br0 other_config:rstp-priority=28672"
816 .PP
817 Set the bridge ageing time of \fBbr0\fR to 1000 s. The ageing time value should be
818 between 10 s and 1000000 s. The default value is 300 s.
819 .IP
820 .B "ovs\-vsctl set Bridge br0 other_config:rstp-ageing-time=1000"
821 .PP
822 Set the bridge force protocol version of \fBbr0\fR to 0. The force protocol version
823 has two acceptable values: 0 (STP compatibility mode) and 2 (normal operation).
824 .IP
825 .B "ovs\-vsctl set Bridge br0 other_config:rstp-force-protocol-version=0"
826 .PP
827 Set the bridge max age of \fBbr0\fR to 10 s. The max age value should be between 6 s
828 and 40 s. The default value is 20 s.
829 .IP
830 .B "ovs\-vsctl set Bridge br0 other_config:rstp-max-age=10"
831 .PP
832 Set the bridge forward delay of \fBbr0\fR to 15 s.
833 This value should be between 4 s and 30 s. The default value is 15 s.
834 .IP
835 .B "ovs\-vsctl set Bridge br0 other_config:rstp-forward-delay=15"
836 .PP
837 Set the bridge transmit hold count of \fBbr0\fR to 7 s. This value should be between
838 1 s and 10 s. The default value is 6 s.
839 .IP
840 .B "ovs\-vsctl set Bridge br0 other_config:rstp-transmit-hold-count=7"
841 .PP
842 Enable RSTP on the Port \fBeth0\fR:
843 .IP
844 .B "ovs\-vsctl set Port eth0 other_config:rstp-enable=true"
845 .PP
846 Disable RSTP on the Port \fBeth0\fR:
847 .IP
848 .B "ovs\-vsctl set Port eth0 other_config:rstp-enable=false"
849 .PP
850 Set the priority of port \fBeth0\fR to 32. The value must be specified in
851 decimal notation and should be a multiple of 16 (if not, it is rounded down to the
852 nearest multiple of 16). The default priority value is 0x80 (128).
853 .IP
854 .B "ovs\-vsctl set Port eth0 other_config:rstp-port-priority=32"
855 .PP
856 Set the port number of port \fBeth0\fR to 3:
857 .IP
858 .B "ovs\-vsctl set Port eth0 other_config:rstp-port-num=3"
859 .PP
860 Set the path cost of port \fBeth0\fR to 150:
861 .IP
862 .B "ovs\-vsctl set Port eth0 other_config:rstp-path-cost=150"
863 .PP
864 Set the admin edge value of port \fBeth0\fR:
865 .IP
866 .B "ovs\-vsctl set Port eth0 other_config:rstp-port-admin-edge=true"
867 .PP
868 Set the auto edge value of port \fBeth0\fR:
869 .IP
870 .B "ovs\-vsctl set Port eth0 other_config:rstp-port-auto-edge=true"
871 .PP
872 Set the admin point to point MAC value of port \fBeth0\fR. Acceptable
873 values are \fB0\fR (not point-to-point), \fB1\fR (point-to-point, the
874 default value) or \fB2\fR (automatic detection). The auto-detection
875 mode is not currently implemented, and the value \fB2\fR has the same
876 effect of \fB0\fR (not point-to-point).
877 .IP
878 .B "ovs\-vsctl set Port eth0 other_config:rstp-admin-p2p-mac=1"
879 .PP
880 Set the admin port state value of port \fBeth0\fR. \fBtrue\fR is the
881 default value.
882 .IP
883 .B "ovs\-vsctl set Port eth0 other_config:rstp-admin-port-state=false"
884 .PP
885 Set the mcheck value of port \fBeth0\fR:
886 .IP
887 .B "ovs\-vsctl set Port eth0 other_config:rstp-port-mcheck=true"
888 .PP
889 Deconfigure RSTP from above:
890 .IP
891 .B "ovs\-vsctl set Bridge br0 rstp_enable=false"
892 .PP
893 .SS "OpenFlow Version"
894 .PP
895 Configure bridge \fBbr0\fR to support OpenFlow versions 1.0, 1.2, and
896 1.3:
897 .IP
898 .B "ovs\-vsctl set bridge br0 protocols=OpenFlow10,OpenFlow12,OpenFlow13"
899 .
900 .SS "Flow Table Configuration"
901 Make flow table 0 on bridge br0 refuse to accept more than 100 flows:
902 .IP
903 .B "ovs\-vsctl \-\- \-\-id=@ft create Flow_Table flow_limit=100 overflow_policy=refuse \-\- set Bridge br0 flow_tables=0=@ft"
904 .
905 .PP
906 Make flow table 0 on bridge br0 evict flows, with fairness based on
907 the matched ingress port, when there are more than 100:
908 .
909 .IP
910 .B "ovs\-vsctl \-\- \-\-id=@ft create Flow_Table flow_limit=100 overflow_policy=evict groups='\(dqNXM_OF_IN_PORT[]\(dq' \-\- set Bridge br0 flow_tables:0=@ft"
911 .SH "EXIT STATUS"
912 .IP "0"
913 Successful program execution.
914 .IP "1"
915 Usage, syntax, or configuration file error.
916 .IP "2"
917 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
918 bridge that does not exist.
919 .SH "SEE ALSO"
920 .
921 .BR ovsdb\-server (1),
922 .BR ovs\-vswitchd (8),
923 .BR ovs\-vswitchd.conf.db (5).