datapath: Make adding and attaching a vport a single step.
[cascardo/ovs.git] / utilities / ovs-dpctl.8.in
1 .TH ovs\-dpctl 8 "August 2009" "Open vSwitch" "Open vSwitch Manual"
2 .ds PN ovs\-dpctl
3 .
4 .SH NAME
5 ovs\-dpctl \- administer Open vSwitch datapaths
6 .
7 .SH SYNOPSIS
8 .B ovs\-dpctl
9 [\fIoptions\fR] \fIcommand \fR[\fIswitch\fR] [\fIargs\fR\&...]
10 .
11 .SH DESCRIPTION
12 .PP
13 The \fBovs\-dpctl\fR program can create, modify, and delete Open vSwitch
14 datapaths.  A single machine may host up to 256 datapaths (numbered 0
15 to 255).
16 .PP
17 A newly created datapath is associated with only one network device, a
18 virtual network device sometimes called the datapath's ``local port''.
19 A newly created datapath is not, however, associated with any of the
20 host's other network devices.  To intercept and process traffic on a
21 given network device, use the \fBadd\-if\fR command to explicitly add
22 that network device to the datapath.
23 .PP
24 If \fBovs\-vswitchd\fR(8) is in use, use \fBovs\-vsctl\fR(8) instead
25 of \fBovs\-dpctl\fR.
26 .PP
27 Most \fBovs\-dpctl\fR commands that work with datapaths take an argument
28 that specifies the name of the datapath, in one of the following
29 forms:
30 .so lib/dpif.man
31 .PP
32 The following commands manage datapaths.
33 .
34 .TP
35 \fBadd\-dp \fIdp\fR [\fInetdev\fR...]
36 Creates datapath \fIdp\fR.  The name of the new datapath's local port
37 depends on how \fIdp\fR is specified: if it takes the form
38 \fBdp\fIN\fR, the local port will be named \fBdp\fIN\fR; otherwise,
39 the local port's name will be \fIdp\fR.
40 .IP
41 This will fail if the host already has 256 datapaths, if a network
42 device with the same name as the new datapath's local port already
43 exists, or if \fIdp\fR is given in the form \fBdp\fIN\fR
44 and a datapath numbered \fIN\fR already exists.
45 .IP
46 If \fInetdev\fRs are specified, \fBovs\-dpctl\fR adds them to the datapath.
47 .
48 .TP
49 \fBdel\-dp \fIdp\fR
50 Deletes datapath \fIdp\fR.  If \fIdp\fR is associated with any network
51 devices, they are automatically removed.
52 .
53 .TP
54 \fBadd\-if \fIdp netdev\fR[\fIoption\fR...]...
55 Adds each \fInetdev\fR to the set of network devices datapath
56 \fIdp\fR monitors, where \fIdp\fR is the name of an existing
57 datapath, and \fInetdev\fR is the name of one of the host's
58 network devices, e.g. \fBeth0\fR.  Once a network device has been added
59 to a datapath, the datapath has complete ownership of the network device's
60 traffic and the network device appears silent to the rest of the
61 system.
62 .IP
63 A \fInetdev\fR may be followed by a comma-separated list of options.
64 The following options are currently supported:
65 .
66 .RS
67 .IP "\fBtype=\fItype\fR"
68 Specifies the type of port to add.  The default type is \fBsystem\fR.
69 .IP "\fIkey\fB=\fIvalue\fR"
70 Adds an arbitrary key-value option to the port's configuration.
71 .RE
72 .IP
73 \fBovs\-vswitchd.conf.db\fR(5) documents the available port types and
74 options.
75 .
76 .TP
77 \fBdel\-if \fIdp netdev\fR...
78 Removes each \fInetdev\fR from the list of network devices datapath
79 \fIdp\fR monitors.
80 .
81 .TP
82 \fBdump\-dps\fR
83 Prints the name of each configured datapath on a separate line.
84 .
85 .TP
86 \fBshow \fR[\fIdp\fR...]
87 Prints a summary of configured datapaths, including their datapath
88 numbers and a list of ports connected to each datapath.  (The local
89 port is identified as port 0.)
90 .IP
91 If one or more datapaths are specified, information on only those
92 datapaths are displayed.  Otherwise, \fBovs\-dpctl\fR displays information
93 about all configured datapaths.
94 .
95 .IP "\fBdump\-flows \fIdp\fR"
96 Prints to the console all flow entries in datapath \fIdp\fR's
97 flow table.
98 .IP
99 This command is primarily useful for debugging Open vSwitch.  The flow
100 table entries that it displays are not
101 OpenFlow flow entries.  Instead, they are different and considerably
102 simpler flows maintained by the Open vSwitch kernel module.
103 .IP "\fBdel\-flows \fIdp\fR"
104 Deletes all flow entries from datapath \fIdp\fR's flow table.
105 .IP
106 This command is primarily useful for debugging Open vSwitch.  As
107 discussed in \fBdump\-flows\fR, these entries are
108 not OpenFlow flow entries.  By deleting them, the process that set them
109 up may be confused about their disappearance.
110 .
111 .SH OPTIONS
112 .TP
113 \fB\-t\fR, \fB\-\-timeout=\fIsecs\fR
114 Limits \fBovs\-dpctl\fR runtime to approximately \fIsecs\fR seconds.  If
115 the timeout expires, \fBovs\-dpctl\fR will exit with a \fBSIGALRM\fR
116 signal.
117 .
118 .so lib/vlog.man
119 .so lib/common.man
120 .
121 .SH EXAMPLES
122 .
123 A typical \fBovs\-dpctl\fR command sequence for controlling an
124 Open vSwitch kernel module:
125 .
126 .TP
127 \fBovs\-dpctl add\-dp dp0\fR
128 Creates datapath number 0.
129 .
130 .TP
131 \fBovs\-dpctl add\-if dp0 eth0 eth1\fR
132 Adds two network devices to the new datapath.
133 .
134 .PP
135 At this point one would ordinarily start \fBovs\-openflowd\fR(8) on
136 \fBdp0\fR, transforming \fBdp0\fR into an OpenFlow switch.  Then, when
137 the switch and the datapath is no longer needed:
138 .
139 .TP
140 \fBovs\-dpctl del\-if dp0 eth0 eth1\fR
141 Removes network devices from the datapath.
142 .
143 .TP
144 \fBovs\-dpctl del\-dp dp0\fR
145 Deletes the datapath.
146 .
147 .SH "SEE ALSO"
148 .
149 .BR ovs\-appctl (8),
150 .BR ovs\-openflowd (8),
151 .BR ovs\-vswitchd (8)