ovs-vsctl: Support configuring SSL.
[sliver-openvswitch.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 .  PP
13 ..
14 .TH ovs\-vsctl 8 "November 2009" "Open vSwitch" "Open vSwitch Manual"
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] \fIcommand \fR[\fIargs\fR\&...]
22 [\fB\-\-\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 editing its configuration
27 database.  This program is mainly intended for use when
28 \fBovs\-vswitchd\fR is running.  If it is used when
29 \fBovs\-vswitchd\fR is not running, then \fB\-\-no\-wait\fR should be
30 specified and configuration changes will only take effect when
31 \fBovs\-vswitchd\fR is started.
32 .PP
33 By default, each time \fBovs\-vsctl\fR runs, it connects to an
34 \fBovsdb\-server\fR process that maintains an Open vSwitch
35 configuration database.  Using this connection, it queries and
36 possibly applies changes to the database, depending on the supplied
37 commands.  Then, if it applied any changes, it waits until
38 \fBovs\-vswitchd\fR has finished reconfiguring itself before it exits.
39 .PP
40 \fBovs\-vsctl\fR can perform any number of commands in a single run,
41 implemented as a single atomic transaction against the database.
42 Commands are separated on the command line by \fB\-\-\fR arguments.
43 .
44 .SS "Linux VLAN Bridging Compatibility"
45 The \fBovs\-vsctl\fR program supports the model of a bridge
46 implemented by Open vSwitch, in which a single bridge supports ports
47 on multiple VLANs.  In this model, each port on a bridge is either a
48 trunk port that potentially passes packets tagged with 802.1Q headers
49 that designate VLANs or it is assigned a single implicit VLAN that is
50 never tagged with an 802.1Q header.
51 .PP
52 For compatibility with software designed for the Linux bridge,
53 \fBovs\-vsctl\fR also supports a model in which traffic associated
54 with a given 802.1Q VLAN is segregated into a separate bridge.  A
55 special form of the \fBadd\-br\fR command (see below) creates a ``fake
56 bridge'' within an Open vSwitch bridge to simulate this behavior.
57 When such a ``fake bridge'' is active, \fBovs\-vsctl\fR will treat it
58 much like a bridge separate from its ``parent bridge,'' but the actual
59 implementation in Open vSwitch uses only a single bridge, with ports on
60 the fake bridge assigned the implicit VLAN of the fake bridge of which
61 they are members.
62 .
63 .SH OPTIONS
64 .
65 The following options affect the behavior \fBovs\-vsctl\fR as a whole.
66 Some individual commands also accept their own options, which are
67 given just before the command name.  If the first command on the
68 command line has options, then those options must be separated from
69 the global options by \fB\-\-\fR.
70 .
71 .IP "\fB\-\-db=\fIserver\fR"
72 Sets \fIserver\fR as the database server that \fBovs\-vsctl\fR
73 contacts to query or modify configuration.  The default is
74 \fBunix:@RUNDIR@/ovsdb\-server\fR.  \fIserver\fR must take one of the
75 following forms:
76 .RS
77 .IP "\fBtcp:\fIip\fB:\fIport\fR"
78 Connect to the given TCP \fIport\fR on \fIip\fR.
79 .IP "\fBunix:\fIfile\fR"
80 Connect to the Unix domain server socket named \fIfile\fR.
81 .RE
82 .IP "\fB\-\-no\-wait\fR"
83 Prevents \fBovs\-vsctl\fR from waiting for \fBovs\-vswitchd\fR to
84 reconfigure itself according to the the modified database.  This
85 option should be used if \fBovs\-vswitchd\fR is not running;
86 otherwise, \fBovs-vsctl\fR will not exit until \fBovs-vswitchd\fR
87 starts.
88 .IP
89 This option has no effect if the commands specified do not change the
90 database.
91 .
92 .IP "\fB\-\-no\-syslog\fR"
93 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
94 changes that it makes to the system log.  This option disables this
95 logging.
96 .IP
97 This option is equivalent to \fB\-\-verbose=vvsctl:syslog:warn\fR.
98 .
99 .IP "\fB\-\-oneline\fR"
100 Modifies the output format so that the output for each command is printed
101 on a single line.  New-line characters that would otherwise separate
102 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
103 would otherwise appear in the output are doubled.
104 Prints a blank line for each command that has no output.
105 .
106 .IP "\fB\-\-dry\-run\fR"
107 Prevents \fBovs\-vsctl\fR from actually modifying the database.
108 .
109 .IP "\fB-t \fIsecs\fR"
110 .IQ "\fB--timeout=\fIsecs\fR"
111 Limits runtime to approximately \fIsecs\fR seconds.  A value of 
112 zero will cause \fBovs\-vsctl\fR to wait forever.  If the timeout expires, 
113 \fBovs\-vsctl\fR will exit with a \fBSIGALRM\fR signal.  If this option is
114 not used, \fBovs\-vsctl\fR uses a timeout of five seconds.
115 (A timeout would normally happen only if the database cannot be contacted.)
116 .
117 .so lib/vlog.man
118 .
119 .SH COMMANDS
120 The commands implemented by \fBovs\-vsctl\fR are described in the
121 sections below.
122 .SS "Open vSwitch Commands"
123 These commands work with an Open vSwitch as a whole.
124 .
125 .IP "\fBinit\fR"
126 Initializes the Open vSwitch database, if it is empty.  If the
127 database has already been initialized, this command has no effect.
128 .IP
129 Any successful \fBovs\-vsctl\fR command automatically initializes the
130 Open vSwitch database if it is empty.  This command is provided to
131 initialize the database without executing any other command.
132 .
133 .SS "Bridge Commands"
134 These commands examine and manipulate Open vSwitch bridges.
135 .
136 .IP "\fBadd\-br \fIbridge\fR"
137 Creates a new bridge named \fIbridge\fR.  Initially the bridge will
138 have no ports (other than \fIbridge\fR itself).
139 .
140 .IP "\fBadd\-br \fIbridge parent vlan\fR"
141 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
142 vSwitch bridge \fIparent\fR, which must already exist and must not
143 itself be a fake bridge.  The new fake bridge will be on 802.1Q VLAN
144 \fIvlan\fR, which must be an integer between 1 and 4095.  Initially
145 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
146 .
147 .IP "[\fB\-\-if\-exists\fR] \fBdel\-br \fIbridge\fR"
148 Deletes \fIbridge\fR and all of its ports.  If \fIbridge\fR is a real
149 bridge, this command also deletes any fake bridges that were created
150 with \fIbridge\fR as parent, including all of their ports.
151 .IP
152 Without \fB\-\-if\-exists\fR, attempting to delete a bridge that does
153 not exist is an error.  With \fB\-\-if\-exists\fR, attempting to
154 delete a bridge that does not exist has no effect.
155 .
156 .IP "\fBlist\-br\fR"
157 Lists all existing real and fake bridges on standard output, one per
158 line.
159 .
160 .IP "\fBbr\-exists \fIbridge\fR"
161 Tests whether \fIbridge\fR exists as a real or fake bridge.  If so,
162 \fBovs\-vsctl\fR exits successfully with exit code 0.  If not,
163 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
164 .
165 .IP "\fBbr\-to\-vlan \fIbridge\fR"
166 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
167 decimal integer.  If \fIbridge\fR is a real bridge, prints 0.
168 .
169 .IP "\fBbr\-to\-parent \fIbridge\fR"
170 If \fIbridge\fR is a fake bridge, prints the name of its parent
171 bridge.  If \fIbridge\fR is a real bridge, print \fIbridge\fR.
172 .
173 .IP "\fBbr\-set\-external\-id \fIbridge key\fR [\fIvalue\fR]"
174 Sets or clears an ``external ID'' value on \fIbridge\fR.  These values
175 are intended to identify entities external to Open vSwitch with which
176 \fIbridge\fR is associated, e.g. the bridge's identifier in a
177 virtualization management platform.  The Open vSwitch database schema
178 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
179 are otherwise arbitrary strings.
180 .IP
181 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
182 \fIbridge\fR, overwriting any previous value.  If \fIvalue\fR is
183 omitted, then \fIkey\fR is removed from \fIbridge\fR's set of external
184 IDs (if it was present).
185 .
186 .IP "\fBbr\-get\-external\-id \fIbridge\fR [\fIkey\fR]"
187 Queries the external IDs on \fIbridge\fR.  If \fIkey\fR is specified,
188 the output is the value for that \fIkey\fR or the empty string if
189 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
190 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
191 .
192 .SS "Port Commands"
193 .
194 These commands examine and manipulate Open vSwitch ports.  These
195 commands treat a bonded port as a single entity.
196 .
197 .IP "\fBlist\-ports \fIbridge\fR"
198 Lists all of the ports within \fIbridge\fR on standard output, one per
199 line.  The local port \fIbridge\fR is not included in the list.
200 .
201 .IP "\fBadd\-port \fIbridge port\fR"
202 Creates on \fIbridge\fR a new port named \fIport\fR from the network
203 device of the same name.
204 .
205 .IP "\fBadd\-bond \fIbridge port iface\fR\&..."
206 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
207 together the network devices given as each \fIiface\fR.  At least two
208 interfaces must be named.
209 .
210 .IP "[\fB\-\-if\-exists\fR] \fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
211 Deletes \fIport\fR.  If \fIbridge\fR is omitted, \fIport\fR is removed
212 from whatever bridge contains it; if \fIbridge\fR is specified, it
213 must be the real or fake bridge that contains \fIport\fR.
214 .IP
215 Without \fB\-\-if\-exists\fR, attempting to delete a port that does
216 not exist is an error.  With \fB\-\-if\-exists\fR, attempting to
217 delete a port that does not exist has no effect.
218 .
219 .IP "\fBport\-to\-br \fIport\fR"
220 Prints the name of the bridge that contains \fIport\fR on standard
221 output.
222 .
223 .IP "\fBport\-set\-external\-id \fIport key\fR [\fIvalue\fR]"
224 Sets or clears an ``external ID'' value on \fIport\fR.  These value
225 are intended to identify entities external to Open vSwitch with which
226 \fIport\fR is associated, e.g. the port's identifier in a
227 virtualization management platform.  The Open vSwitch database schema
228 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
229 are otherwise arbitrary strings.
230 .IP
231 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
232 \fIport\fR, overwriting any previous value.  If \fIvalue\fR is
233 omitted, then \fIkey\fR is removed from \fIport\fR's set of external
234 IDs (if it was present).
235 .
236 .IP "\fBbr\-get\-external\-id \fIport\fR [\fIkey\fR]"
237 Queries the external IDs on \fIport\fR.  If \fIkey\fR is specified,
238 the output is the value for that \fIkey\fR or the empty string if
239 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
240 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
241 .
242 .SS "Interface Commands"
243 .
244 These commands examine the interfaces attached to an Open vSwitch
245 bridge.  These commands treat a bonded port as a collection of two or
246 more interfaces, rather than as a single port.
247 .
248 .IP "\fBlist\-ifaces \fIbridge\fR"
249 Lists all of the interfaces within \fIbridge\fR on standard output,
250 one per line.  The local port \fIbridge\fR is not included in the
251 list.
252 .
253 .IP "\fBiface\-to\-br \fIiface\fR"
254 Prints the name of the bridge that contains \fIiface\fR on standard
255 output.
256 .
257 .IP "\fBiface\-set\-external\-id \fIiface key\fR [\fIvalue\fR]"
258 Sets or clears an ``external ID'' value on \fIiface\fR.  These value
259 are intended to identify entities external to Open vSwitch with which
260 \fIiface\fR is associated, e.g. the interface's identifier in a
261 virtualization management platform.  The Open vSwitch database schema
262 specifies well-known \fIkey\fR values, but \fIkey\fR and \fIvalue\fR
263 are otherwise arbitrary strings.
264 .IP
265 If \fIvalue\fR is specified, then \fIkey\fR is set to \fIvalue\fR for
266 \fIiface\fR, overwriting any previous value.  If \fIvalue\fR is
267 omitted, then \fIkey\fR is removed from \fIiface\fR's set of external
268 IDs (if it was present).
269 .
270 .IP "\fBbr\-get\-external\-id \fIiface\fR [\fIkey\fR]"
271 Queries the external IDs on \fIiface\fR.  If \fIkey\fR is specified,
272 the output is the value for that \fIkey\fR or the empty string if
273 \fIkey\fR is unset.  If \fIkey\fR is omitted, the output is
274 \fIkey\fB=\fIvalue\fR, one per line, for each key-value pair.
275 .
276 .SS "OpenFlow Controller Connectivity"
277 .
278 \fBovs\-vswitchd\fR can perform all configured bridging and switching
279 locally, or it can be configured to connect a given bridge to an
280 external OpenFlow controller, such as NOX.  
281 .
282 If a \fIbridge\fR argument is given, the settings apply only to the
283 specified bridge.  Otherwise, they apply to the Open vSwitch instance,
284 and its configuration applies to any bridge that has not been explicitly
285 configured through a \fIbridge\fR argument.
286 .
287 .IP "\fBget\-controller\fR [\fIbridge\fR]"
288 Prints the configured controller target.
289 .
290 .IP "\fBdel\-controller\fR [\fIbridge\fR]"
291 Deletes the configured controller target.
292 .
293 .IP "\fBset\-controller\fR [\fIbridge\fR] \fItarget\fR"
294 Sets the configured controller target.  The \fItarget\fR may use any of
295 the following forms:
296 .
297 .RS
298 .TP
299 \fBssl:\fIip\fR[\fB:\fIport\fR]
300 The specified SSL \fIport\fR (default: 6633) on the host at the given
301 \fIip\fR, which must be expressed as an IP address (not a DNS name).
302 SSL must be configured when this form is used (see \fBSSL
303 Configuration\fR, below).
304 .
305 .TP
306 \fBtcp:\fIip\fR[\fB:\fIport\fR]
307 The specified TCP \fIport\fR (default: 6633) on the host at the given
308 \fIip\fR, which must be expressed as an IP address (not a DNS name).
309 .TP
310 \fBunix:\fIfile\fR
311 The Unix domain server socket named \fIfile\fR.
312 .RE
313 .ST "Controller Failure Settings"
314 .
315 When a controller is configured, it is, ordinarily, responsible for
316 setting up all flows on the switch.  Thus, if the connection to
317 the controller fails, no new network connections can be set up.  If
318 the connection to the controller stays down long enough, no packets
319 can pass through the switch at all.
320 .ST
321 If the value is \fBstandalone\fR, or if neither of these settings
322 is set, \fBovs\-vswitchd\fR will take over
323 responsibility for setting up
324 flows when no message has been received from the controller for three
325 times the inactivity probe interval (xxx needs to be exposed).  In this mode,
326 \fBovs\-vswitchd\fR causes the datapath to act like an ordinary
327 MAC-learning switch.  \fBovs\-vswitchd\fR will continue to retry connecting
328 to the controller in the background and, when the connection succeeds,
329 it discontinues its standalone behavior.
330 .ST
331 If this option is set to \fBsecure\fR, \fBovs\-vswitchd\fR will not
332 set up flows on its own when the controller connection fails.
333 .
334 .IP "\fBget\-fail\-mode\fR [\fIbridge\fR]"
335 Prints the configured failure mode.
336 .
337 .IP "\fBdel\-fail\-mode\fR [\fIbridge\fR]"
338 Deletes the configured failure mode.
339 .
340 .IP "\fBset\-fail\-mode\fR [\fIbridge\fR] \fBstandalone\fR|\fBsecure\fR"
341 Sets the configured failure mode.
342 .
343 .SS "SSL Configuration"
344 When \fBovs\-vswitchd\fR is configured to connect over SSL for management or
345 controller connectivity, the following parameters are required:
346 .TP
347 \fBprivate-key\fR
348 Specifies a PEM file containing the private key used as the virtual
349 switch's identity for SSL connections to the controller.
350 .TP
351 \fBcertificate\fR
352 Specifies a PEM file containing a certificate, signed by the
353 certificate authority (CA) used by the controller and manager, that
354 certifies the virtual switch's private key, identifying a trustworthy
355 switch.
356 .TP
357 \fBca-cert\fR
358 Specifies a PEM file containing the CA certificate used to verify that
359 the virtual switch is connected to a trustworthy controller.
360 .PP
361 These files are read only once, at \fBovs\-vswitchd\fR startup time.  If
362 their contents change, \fBovs\-vswitchd\fR must be killed and restarted.
363 .PP
364 These SSL settings apply to all SSL connections made by the virtual
365 switch.
366 .
367 .IP "\fBget\-ssl\fR"
368 Prints the SSL configuration.
369 .
370 .IP "\fBdel\-ssl\fR"
371 Deletes the current SSL configuration.
372 .
373 .IP "[\fB\-\-bootstrap\fR] \fBset\-ssl\fR \fIprivate-key\fR \fIcertificate\fR \fIca-cert\fR"
374 Sets the SSL configuration.  The \fB\-\-bootstrap\fR option is described 
375 below.
376 .
377 .ST "CA Certificate Bootstrap"
378 Ordinarily, all of the files named in the SSL configuration must exist
379 when \fBovs\-vswitchd\fR starts.  However, if the \fB\-\-bootstrap\fR 
380 option is given, then \fBovs\-vswitchd\fR will attempt to obtain the
381 CA certificate from the controller on its first SSL connection and
382 save it to the named PEM file.  If it is successful, it will
383 immediately drop the connection and reconnect, and from then on all
384 SSL connections must be authenticated by a certificate signed by the
385 CA certificate thus obtained.
386 .PP
387 \fBThis option exposes the SSL connection to a man-in-the-middle
388 attack obtaining the initial CA certificate\fR, but it may be useful
389 for bootstrapping.
390 .PP
391 This option is only useful if the controller sends its CA certificate
392 as part of the SSL certificate chain.  The SSL protocol does not
393 require the controller to send the CA certificate, but
394 \fBcontroller\fR(8) can be configured to do so with the
395 \fB--peer-ca-cert\fR option.
396 .
397 .SH "EXAMPLES"
398 Create a new bridge named br0 and add port eth0 to it:
399 .IP
400 .B "ovs-vsctl add\-br br0"
401 .br
402 .B "ovs-vsctl add\-port br0 eth0"
403 .PP
404 Alternatively, perform both operations in a single atomic transaction:
405 .IP 
406 .B "ovs-vsctl add\-br br0 \-\- add\-port br0 eth0"
407 .PP
408 Delete bridge \fBbr0\fR, reporting an error if it does not exist:
409 .IP
410 .B "ovs\-vsctl del\-br br0"
411 .PP
412 Delete bridge \fBbr0\fR if it exists (the \fB\-\-\fR is required to
413 separate \fBdel\-br\fR's options from the global options):
414 .IP
415 .B "ovs\-vsctl \-\- \-\-if\-exists del\-br br0"
416 .
417 .SH "EXIT STATUS"
418 .IP "0"
419 Successful program execution.
420 .IP "1"
421 Usage, syntax, or configuration file error.
422 .IP "2"
423 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
424 bridge that does not exist.
425 .SH "SEE ALSO"
426 .
427 .BR ovsdb\-server (1),
428 .BR ovs\-vswitchd (8).