Merge "citrix" into "master".
[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 "September 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), mainly
19 by providing a high\-level interface to editing its configuration file
20 \fBovs\-vswitchd.conf\fR(5).  This program is mainly intended for use
21 when \fBovs\-vswitchd\fR is running, but it can also be used when
22 \fBovs\-vswitchd\fR is not running.  In the latter case configuration
23 changes will only take effect when \fBovs\-vswitchd\fR is started.
24 .PP
25 By default, each time \fBovs\-vsctl\fR runs, it examines and,
26 depending on the requested command or commands, possibly applies
27 changes to an
28 \fBovs\-vswitchd.conf\fR file.  Then, if it applied any changes and if
29 \fBovs\-vswitchd\fR is running, it tells \fBovs\-vswitchd\fR to reload
30 the modified configuration file and waits for the reload to complete
31 before exiting.
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\-c \fIfile\fR"
58 .IQ "\fB\-\-config=\fIfile\fR"
59 Sets the configuration file that \fBovs\-vsctl\fR reads and possibly
60 modifies.  The default is \fB@localstatedir@/ovs\-vswitchd.conf\fR.
61 .IP
62 If \fIfile\fR is specified as \fB\-\fR, then \fBovs\-vsctl\fR reads
63 the configuration file from standard input and, for commands that
64 modify the configuration, writes the new one to standard output.  This
65 is useful for testing but it should not be used in production because
66 it bypasses the Open vSwitch configuration file locking protocol.
67 .
68 .IP "\fB\-t \fItarget\fR"
69 .IQ "\fB\-\-target=\fItarget\fR"
70 Configures how \fBovs\-vsctl\fR contacts \fBovs\-vswitchd\fR to
71 instruct it to reload its configuration file.  The \fItarget\fR takes
72 one of two forms:
73 .RS
74 .IP \(bu
75 The name of a Unix domain socket on which \fBovs\-vswitchd\fR is
76 listening for control channel connections.  By default,
77 \fBovs\-vswitchd\fR listens on a Unix domain socket named
78 \fB@RUNDIR@/ovs\-vswitchd.\fIpid\fR.ctl\fR, where \fIpid\fR is the
79 \fBovs\-vswitchd\fR process's process ID.
80 .IP \(bu
81 The name of a pidfile, that is, a file whose contents are the process
82 ID of a running process as a decimal number.  \fBovs\-vswitchd\fR
83 creates a pidfile if it is invoked with the \fB\-\-pidfile\fR option.
84 \fBovs\-vsctl\fR reads the pidfile, then looks for a Unix socket named
85 \fB@RUNDIR@/ovs\-vswitchd.\fIpid\fR.ctl\fR, where \fIpid\fR is
86 replaced by the process ID read from \fItarget\fR, and uses that file
87 as if it had been specified directly as the target.
88 .RE
89 .IP
90 If \fItarget\fR does not begin with \fB/\fR, then \fB@RUNDIR@/\fR is
91 implicitly prefixed to it.
92 .IP
93 If neither \fB\-t\fR nor \fB\-\-target\fR is specified, the default target is
94 \fB@RUNDIR@/ovs\-vswitchd.pid\fR.
95 .IP "\fB\-\-no\-reload\fR"
96 Prevents \fBovs\-vsctl\fR from telling \fBovs\-vswitchd\fR to reload
97 its configuration file.
98 .
99 .IP "\fB\-\-no\-syslog\fR"
100 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
101 changes that it makes to the system log.  This option disables this
102 logging.
103 .IP "\fB\-\-oneline\fR"
104 Modifies the output format so that the output for each command is printed
105 on a single line.  New-line characters that would otherwise separate
106 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
107 would otherwise appear in the output are doubled.
108 Prints a blank line for each command that has no output.
109 .
110 .SH COMMANDS
111 The commands implemented by \fBovs\-vsctl\fR are described in the
112 sections below.
113 .
114 .SS "Bridge Commands"
115 These commands examine and manipulate Open vSwitch bridges.
116 .
117 .IP "\fBadd\-br \fIbridge\fR"
118 Creates a new bridge named \fIbridge\fR.  Initially the bridge will
119 have no ports (other than \fIbridge\fR itself).
120 .
121 .IP "\fBadd\-br \fIbridge parent vlan\fR"
122 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
123 vSwitch bridge \fIparent\fR, which must already exist and must not
124 itself be a fake bridge.  The new fake bridge will be on 802.1Q VLAN
125 \fIvlan\fR, which must be an integer between 1 and 4095.  Initially
126 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
127 .
128 .IP "\fBdel\-br \fIbridge\fR"
129 Deletes \fIbridge\fR and all of its ports.  If \fIbridge\fR is a real
130 bridge, this command also deletes any fake bridges that were created
131 with \fIbridge\fR as parent, including all of their ports.
132 .
133 .IP "\fBlist\-br\fR"
134 Lists all existing real and fake bridges on standard output, one per
135 line.
136 .
137 .IP "\fBbr\-exists \fIbridge\fR"
138 Tests whether \fIbridge\fR exists as a real or fake bridge.  If so,
139 \fBovs\-vsctl\fR exits successfully with exit code 0.  If not,
140 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
141 .
142 .IP "\fBbr\-to\-vlan \fIbridge\fR"
143 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
144 decimal integer.  If \fIbridge\fR is a real bridge, prints 0.
145 .
146 .IP "\fBbr\-to\-parent \fIbridge\fR"
147 If \fIbridge\fR is a fake bridge, prints the name of its parent
148 bridge.  If \fIbridge\fR is a real bridge, print \fIbridge\fR.
149 .
150 .SS "Port Commands"
151 .
152 These commands examine and manipulate Open vSwitch ports.  These
153 commands treat a bonded port as a single entity.
154 .
155 .IP "\fBlist\-ports \fIbridge\fR"
156 Lists all of the ports within \fIbridge\fR on standard output, one per
157 line.  The local port \fIbridge\fR is not included in the list.
158 .
159 .IP "\fBadd\-port \fIbridge port\fR"
160 Creates on \fIbridge\fR a new port named \fIport\fR from the network
161 device of the same name.
162 .
163 .IP "\fBadd\-bond \fIbridge port iface\fR\&..."
164 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
165 together the network devices given as each \fIiface\fR.  At least two
166 interfaces must be named.
167 .
168 .IP "\fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
169 Deletes \fIport\fR.  If \fIbridge\fR is omitted, \fIport\fR is removed
170 from whatever bridge contains it; if \fIbridge\fR is specified, it
171 must be the real or fake bridge that contains \fIport\fR.
172 .
173 .IP "\fBport\-to\-br \fIport\fR"
174 Prints the name of the bridge that contains \fIport\fR on standard
175 output.
176 .
177 .SS "Interface Commands"
178 .
179 These commands examine the interfaces attached to an Open vSwitch
180 bridge.  These commands treat a bonded port as a collection of two or
181 more interfaces, rather than as a single port.
182 .
183 .IP "\fBlist\-ifaces \fIbridge\fR"
184 Lists all of the interfaces within \fIbridge\fR on standard output,
185 one per line.  The local port \fIbridge\fR is not included in the
186 list.
187 .
188 .IP "\fBiface\-to\-br \fIiface\fR"
189 Prints the name of the bridge that contains \fIiface\fR on standard
190 output.
191 .SH "EXAMPLES"
192 Create a new bridge named br0 and add port eth0 to it:
193 .IP
194 .B "ovs-vsctl add\-br br0"
195 .br
196 .B "ovs-vsctl add\-port br0 eth0"
197 .PP
198 Alternatively, perform both operations in a single atomic transaction:
199 .IP 
200 .B "ovs-vsctl add\-br br0 \-\- add\-port br0 eth0"
201 .
202 .SH "EXIT STATUS"
203 .IP "0"
204 Successful program execution.
205 .IP "1"
206 Usage, syntax, or configuration file error.
207 .IP "2"
208 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
209 bridge that does not exist.
210 .SH "SEE ALSO"
211 .
212 .BR ovs\-vswitchd.conf (5),
213 .BR ovs\-vswitchd (8).