ovs-vsctl: Fix bugs.
[sliver-openvswitch.git] / utilities / ovs-vsctl.8.in
1 .\" -*- nroff -*-
2 .de IQ
3 .  br
4 .  ns
5 .  IP "\\$1"
6 ..
7 .TH ovs\-vsctl 8 "November 2009" "Open vSwitch" "Open vSwitch Manual"
8 .ds PN ovs\-vsctl
9 .
10 .SH NAME
11 ovs\-vsctl \- utility for querying and configuring \fBovs\-vswitchd\fR
12 .
13 .SH SYNOPSIS
14 \fBovs\-vsctl\fR [\fIoptions\fR] \fIcommand \fR[\fIargs\fR\&...]
15 [\fB\-\-\fR \fIcommand \fR[\fIargs\fR\&...]]
16 .
17 .SH DESCRIPTION
18 The \fBovs\-vsctl\fR program configures \fBovs\-vswitchd\fR(8) by
19 providing a high\-level interface to editing its configuration
20 database.  This program is mainly intended for use when
21 \fBovs\-vswitchd\fR is running.  If it is used when
22 \fBovs\-vswitchd\fR is not running, then \fB\-\-no\-wait\fR should be
23 specified and configuration changes will only take effect when
24 \fBovs\-vswitchd\fR is started.
25 .PP
26 By default, each time \fBovs\-vsctl\fR runs, it connects to an
27 \fBovsdb\-server\fR process that maintains an Open vSwitch
28 configuration database.  Using this connection, it queries and
29 possibly applies changes to the database, depending on the supplied
30 commands.  Then, if it applied any changes, it waits until
31 \fBovs\-vswitchd\fR has finished reconfiguring itself before it exits.
32 .
33 .SS "Linux VLAN Bridging Compatibility"
34 The \fBovs\-vsctl\fR program supports the model of a bridge
35 implemented by Open vSwitch, in which a single bridge supports ports
36 on multiple VLANs.  In this model, each port on a bridge is either a
37 trunk port that potentially passes packets tagged with 802.1Q headers
38 that designate VLANs or it is assigned a single implicit VLAN that is
39 never tagged with an 802.1Q header.
40 .PP
41 For compatibility with software designed for the Linux bridge,
42 \fBovs\-vsctl\fR also supports a model in which traffic associated
43 with a given 802.1Q VLAN is segregated into a separate bridge.  A
44 special form of the \fBadd\-br\fR command (see below) creates a ``fake
45 bridge'' within an Open vSwitch bridge to simulate this behavior.
46 When such a ``fake bridge'' is active, \fBovs\-vsctl\fR will treat it
47 much like a bridge separate from its ``parent bridge,'' but the actual
48 implementation in Open vSwitch uses only a single bridge, with ports on
49 the fake bridge assigned the implicit VLAN of the fake bridge of which
50 they are members.
51 .
52 .SH OPTIONS
53 .
54 The following options affect the general outline of \fBovs\-vsctl\fR's
55 activities:
56 .
57 .IP "\fB\-\-db=\fIserver\fR"
58 Sets \fIserver\fR as the database server that \fBovs\-vsctl\fR
59 contacts to query or modify configuration.  The default is
60 \fBunix:@RUNDIR@/ovsdb\-server\fR.  \fIserver\fR must take one of the
61 following forms:
62 .RS
63 .IP "\fBtcp:\fIip\fB:\fIport\fR"
64 Connect to the given TCP \fIport\fR on \fIip\fR.
65 .IP "\fBunix:\fIfile\fR"
66 Connect to the Unix domain server socket named \fIfile\fR.
67 .RE
68 .IP "\fB\-\-no\-wait\fR"
69 Prevents \fBovs\-vsctl\fR from waiting for \fBovs\-vswitchd\fR to
70 reconfigure itself according to the the modified database.  This
71 option should be used if \fBovs\-vswitchd\fR is not running;
72 otherwise, \fBovs-vsctl\fR will not exit until \fBovs-vswitchd\fR
73 starts.
74 .IP
75 This option has no effect if the commands specified do not change the
76 database.
77 .
78 .IP "\fB\-\-no\-syslog\fR"
79 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
80 changes that it makes to the system log.  This option disables this
81 logging.
82 .IP
83 This option is equivalent to \fB\-\-verbose=vvsctl:syslog:warn\fR.
84 .
85 .IP "\fB\-\-oneline\fR"
86 Modifies the output format so that the output for each command is printed
87 on a single line.  New-line characters that would otherwise separate
88 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
89 would otherwise appear in the output are doubled.
90 Prints a blank line for each command that has no output.
91 .
92 .so lib/vlog.man
93 .
94 .SH COMMANDS
95 The commands implemented by \fBovs\-vsctl\fR are described in the
96 sections below.
97 .
98 .SS "Bridge Commands"
99 These commands examine and manipulate Open vSwitch bridges.
100 .
101 .IP "\fBadd\-br \fIbridge\fR"
102 Creates a new bridge named \fIbridge\fR.  Initially the bridge will
103 have no ports (other than \fIbridge\fR itself).
104 .
105 .IP "\fBadd\-br \fIbridge parent vlan\fR"
106 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
107 vSwitch bridge \fIparent\fR, which must already exist and must not
108 itself be a fake bridge.  The new fake bridge will be on 802.1Q VLAN
109 \fIvlan\fR, which must be an integer between 1 and 4095.  Initially
110 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
111 .
112 .IP "\fBdel\-br \fIbridge\fR"
113 Deletes \fIbridge\fR and all of its ports.  If \fIbridge\fR is a real
114 bridge, this command also deletes any fake bridges that were created
115 with \fIbridge\fR as parent, including all of their ports.
116 .
117 .IP "\fBlist\-br\fR"
118 Lists all existing real and fake bridges on standard output, one per
119 line.
120 .
121 .IP "\fBbr\-exists \fIbridge\fR"
122 Tests whether \fIbridge\fR exists as a real or fake bridge.  If so,
123 \fBovs\-vsctl\fR exits successfully with exit code 0.  If not,
124 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
125 .
126 .IP "\fBbr\-to\-vlan \fIbridge\fR"
127 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
128 decimal integer.  If \fIbridge\fR is a real bridge, prints 0.
129 .
130 .IP "\fBbr\-to\-parent \fIbridge\fR"
131 If \fIbridge\fR is a fake bridge, prints the name of its parent
132 bridge.  If \fIbridge\fR is a real bridge, print \fIbridge\fR.
133 .
134 .SS "Port Commands"
135 .
136 These commands examine and manipulate Open vSwitch ports.  These
137 commands treat a bonded port as a single entity.
138 .
139 .IP "\fBlist\-ports \fIbridge\fR"
140 Lists all of the ports within \fIbridge\fR on standard output, one per
141 line.  The local port \fIbridge\fR is not included in the list.
142 .
143 .IP "\fBadd\-port \fIbridge port\fR"
144 Creates on \fIbridge\fR a new port named \fIport\fR from the network
145 device of the same name.
146 .
147 .IP "\fBadd\-bond \fIbridge port iface\fR\&..."
148 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
149 together the network devices given as each \fIiface\fR.  At least two
150 interfaces must be named.
151 .
152 .IP "\fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
153 Deletes \fIport\fR.  If \fIbridge\fR is omitted, \fIport\fR is removed
154 from whatever bridge contains it; if \fIbridge\fR is specified, it
155 must be the real or fake bridge that contains \fIport\fR.
156 .
157 .IP "\fBport\-to\-br \fIport\fR"
158 Prints the name of the bridge that contains \fIport\fR on standard
159 output.
160 .
161 .SS "Interface Commands"
162 .
163 These commands examine the interfaces attached to an Open vSwitch
164 bridge.  These commands treat a bonded port as a collection of two or
165 more interfaces, rather than as a single port.
166 .
167 .IP "\fBlist\-ifaces \fIbridge\fR"
168 Lists all of the interfaces within \fIbridge\fR on standard output,
169 one per line.  The local port \fIbridge\fR is not included in the
170 list.
171 .
172 .IP "\fBiface\-to\-br \fIiface\fR"
173 Prints the name of the bridge that contains \fIiface\fR on standard
174 output.
175 .SH "EXAMPLES"
176 Create a new bridge named br0 and add port eth0 to it:
177 .IP
178 .B "ovs-vsctl add\-br br0"
179 .br
180 .B "ovs-vsctl add\-port br0 eth0"
181 .PP
182 Alternatively, perform both operations in a single atomic transaction:
183 .IP 
184 .B "ovs-vsctl add\-br br0 \-\- add\-port br0 eth0"
185 .
186 .SH "EXIT STATUS"
187 .IP "0"
188 Successful program execution.
189 .IP "1"
190 Usage, syntax, or configuration file error.
191 .IP "2"
192 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
193 bridge that does not exist.
194 .SH "SEE ALSO"
195 .
196 .BR ovsdb\-server (1),
197 .BR ovs\-vswitchd (8).