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