Merge citrix branch 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 "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), 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.
72 .IP
73 If \fItarget\fR begins with \fB/\fR it must name a Unix domain socket
74 on which \fBovs\-vswitchd\fR is listening for control channel
75 connections.  By default, \fBovs\-vswitchd\fR listens on a Unix domain
76 socket named \fB@RUNDIR@/ovs\-vswitchd.\fIpid\fB.ctl\fR, where
77 \fIpid\fR is \fBovs\-vswitchd\fR's process ID.
78 .IP
79 Otherwise, \fBovs\-appctl\fR looks for a pidfile, that is, a file
80 whose contents are the process ID of a running process as a decimal
81 number, named \fB@RUNDIR@/\fItarget\fB.pid\fR.  (The \fB\-\-pidfile\fR
82 option makes an Open vSwitch daemon create a pidfile.)
83 \fBovs\-appctl\fR reads the pidfile, then looks for a Unix socket
84 named \fB@RUNDIR@/\fItarget\fB.\fIpid\fB.ctl\fR, where \fIpid\fR is
85 replaced by the process ID read from \fItarget\fR, and uses that file
86 as if it had been specified directly as the target.
87 .IP
88 The default target is \fBovs\-vswitchd\fR.
89 .IP "\fB\-\-no\-reload\fR"
90 Prevents \fBovs\-vsctl\fR from telling \fBovs\-vswitchd\fR to reload
91 its configuration file.
92 .
93 .IP "\fB\-\-no\-syslog\fR"
94 By default, \fBovs\-vsctl\fR logs its arguments and the details of any
95 changes that it makes to the system log.  This option disables this
96 logging.
97 .IP "\fB\-\-oneline\fR"
98 Modifies the output format so that the output for each command is printed
99 on a single line.  New-line characters that would otherwise separate
100 lines are printed as \fB\\n\fR, and any instances of \fB\\\fR that
101 would otherwise appear in the output are doubled.
102 Prints a blank line for each command that has no output.
103 .
104 .SH COMMANDS
105 The commands implemented by \fBovs\-vsctl\fR are described in the
106 sections below.
107 .
108 .SS "Bridge Commands"
109 These commands examine and manipulate Open vSwitch bridges.
110 .
111 .IP "\fBadd\-br \fIbridge\fR"
112 Creates a new bridge named \fIbridge\fR.  Initially the bridge will
113 have no ports (other than \fIbridge\fR itself).
114 .
115 .IP "\fBadd\-br \fIbridge parent vlan\fR"
116 Creates a ``fake bridge'' named \fIbridge\fR within the existing Open
117 vSwitch bridge \fIparent\fR, which must already exist and must not
118 itself be a fake bridge.  The new fake bridge will be on 802.1Q VLAN
119 \fIvlan\fR, which must be an integer between 1 and 4095.  Initially
120 \fIbridge\fR will have no ports (other than \fIbridge\fR itself).
121 .
122 .IP "\fBdel\-br \fIbridge\fR"
123 Deletes \fIbridge\fR and all of its ports.  If \fIbridge\fR is a real
124 bridge, this command also deletes any fake bridges that were created
125 with \fIbridge\fR as parent, including all of their ports.
126 .
127 .IP "\fBlist\-br\fR"
128 Lists all existing real and fake bridges on standard output, one per
129 line.
130 .
131 .IP "\fBbr\-exists \fIbridge\fR"
132 Tests whether \fIbridge\fR exists as a real or fake bridge.  If so,
133 \fBovs\-vsctl\fR exits successfully with exit code 0.  If not,
134 \fBovs\-vsctl\fR exits unsuccessfully with exit code 2.
135 .
136 .IP "\fBbr\-to\-vlan \fIbridge\fR"
137 If \fIbridge\fR is a fake bridge, prints the bridge's 802.1Q VLAN as a
138 decimal integer.  If \fIbridge\fR is a real bridge, prints 0.
139 .
140 .IP "\fBbr\-to\-parent \fIbridge\fR"
141 If \fIbridge\fR is a fake bridge, prints the name of its parent
142 bridge.  If \fIbridge\fR is a real bridge, print \fIbridge\fR.
143 .
144 .SS "Port Commands"
145 .
146 These commands examine and manipulate Open vSwitch ports.  These
147 commands treat a bonded port as a single entity.
148 .
149 .IP "\fBlist\-ports \fIbridge\fR"
150 Lists all of the ports within \fIbridge\fR on standard output, one per
151 line.  The local port \fIbridge\fR is not included in the list.
152 .
153 .IP "\fBadd\-port \fIbridge port\fR"
154 Creates on \fIbridge\fR a new port named \fIport\fR from the network
155 device of the same name.
156 .
157 .IP "\fBadd\-bond \fIbridge port iface\fR\&..."
158 Creates on \fIbridge\fR a new port named \fIport\fR that bonds
159 together the network devices given as each \fIiface\fR.  At least two
160 interfaces must be named.
161 .
162 .IP "\fBdel\-port \fR[\fIbridge\fR] \fIport\fR"
163 Deletes \fIport\fR.  If \fIbridge\fR is omitted, \fIport\fR is removed
164 from whatever bridge contains it; if \fIbridge\fR is specified, it
165 must be the real or fake bridge that contains \fIport\fR.
166 .
167 .IP "\fBport\-to\-br \fIport\fR"
168 Prints the name of the bridge that contains \fIport\fR on standard
169 output.
170 .
171 .SS "Interface Commands"
172 .
173 These commands examine the interfaces attached to an Open vSwitch
174 bridge.  These commands treat a bonded port as a collection of two or
175 more interfaces, rather than as a single port.
176 .
177 .IP "\fBlist\-ifaces \fIbridge\fR"
178 Lists all of the interfaces within \fIbridge\fR on standard output,
179 one per line.  The local port \fIbridge\fR is not included in the
180 list.
181 .
182 .IP "\fBiface\-to\-br \fIiface\fR"
183 Prints the name of the bridge that contains \fIiface\fR on standard
184 output.
185 .SH "EXAMPLES"
186 Create a new bridge named br0 and add port eth0 to it:
187 .IP
188 .B "ovs-vsctl add\-br br0"
189 .br
190 .B "ovs-vsctl add\-port br0 eth0"
191 .PP
192 Alternatively, perform both operations in a single atomic transaction:
193 .IP 
194 .B "ovs-vsctl add\-br br0 \-\- add\-port br0 eth0"
195 .
196 .SH "EXIT STATUS"
197 .IP "0"
198 Successful program execution.
199 .IP "1"
200 Usage, syntax, or configuration file error.
201 .IP "2"
202 The \fIbridge\fR argument to \fBbr\-exists\fR specified the name of a
203 bridge that does not exist.
204 .SH "SEE ALSO"
205 .
206 .BR ovs\-vswitchd.conf (5),
207 .BR ovs\-vswitchd (8).