summaryrefslogtreecommitdiff
path: root/rhel/README.RHEL.rst
blob: 98175dfd38af17a5e7ffb7bcfc6168bd22732ee3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
===================================
Red Hat network scripts integration
===================================

The RPM packages for Open vSwitch provide some integration with Red Hat's
network scripts.  Using this integration is optional.

To use the integration for a Open vSwitch bridge or interface named ``<name>``,
create or edit ``/etc/sysconfig/network-scripts/ifcfg-<name>``.  This is a
shell script that consists of a series of ``VARIABLE=VALUE`` assignments.  The
following OVS-specific variable names are supported:

DEVICETYPE
  Always set to "ovs".

TYPE
  If this is "OVSBridge", then this file represents an OVS bridge named <name>.
  Otherwise, it represents a port on an OVS bridge and TYPE must have one of
  the following values:

  * ``OVSPort``, if ``<name>`` is a physical port (e.g. eth0) or
    virtual port (e.g. vif1.0).

  * ``OVSIntPort``, if ``<name>`` is an internal port (e.g. a tagged
    VLAN).

  * ``OVSBond``, if ``<name>`` is an OVS bond.

  * ``OVSTunnel``, if ``<name>`` is an OVS tunnel.

  * ``OVSPatchPort``, if ``<name>`` is a patch port

  Additionally the following DPDK port types may be available, depends on OVS
  build- and runtime configuration:

  * ``OVSDPDKPort``, if ``<name>`` is a physical DPDK NIC port (name must start
    with ``dpdk`` and end with portid, eg ``dpdk0``)

  * ``OVSDPDKVhostUserPort`` if ``<name>`` is a DPDK vhost-user port

  * ``OVSDPDKBond`` if ``<name>`` is an OVS DPDK bond.

OVS_BRIDGE
  If TYPE is anything other than "OVSBridge", set to the name of the OVS bridge
  to which the port should be attached.

OVS_OPTIONS
  Optionally, extra options to set in the "Port" table when adding the port to
  the bridge, as a sequence of column[:key]=value options.  For example,
  "tag=100" to make the port an access port for VLAN 100.  See the
  documentation of "add-port" in ovs-vsctl(8) for syntax and the section on the
  Port table in ovs-vswitchd.conf.db(5) for available options.

OVS_EXTRA
  Optionally, additional ovs-vsctl commands, separated by ``--`` (double dash).

BOND_IFACES
  For "OVSBond" and "OVSDPDKBond" interfaces, a list of physical interfaces to
  bond together.

OVS_TUNNEL_TYPE
  For "OVSTunnel" interfaces, the type of the tunnel.  For example, "gre",
  "vxlan", etc.

OVS_TUNNEL_OPTIONS
  For "OVSTunnel" interfaces, this field should be used to specify the tunnel
  options like remote_ip, key, etc.

OVS_PATCH_PEER
  For "OVSPatchPort" devices, this field specifies the patch's peer on the
  other bridge.

OVS_PORT_MODE
  For "OVSDPDKVhostUserPort" devices, this field can be set to "client" which
  indicates that the port will be used in client mode.

OVS_PORT_PATH
  For "OVSDPDKVhostUserPort" devices, this field specifies the path to the
  vhost-user server socket.  It will only be used if OVS_PORT_MODE is set to
  "client".

Note
----

* ``ifdown`` on a bridge will not bring individual ports on the bridge down.
  "ifup" on a bridge will not add ports to the bridge.  This behavior should be
  compatible with standard bridges (with ``TYPE=Bridge``).

* If ``ifup`` on an interface is called multiple times, one can see ``RTNETLINK
  answers: File exists`` printed on the console. This comes from ifup-eth
  trying to add zeroconf route multiple times and is harmless.

* ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address.
  Since OVS changes the device state to DOWN before changing its mac address this
  result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up
  operation on the bridge again to restore configuration.

Examples
--------

Standalone bridge:

::

    ==> ifcfg-ovsbridge0 <==
    DEVICE=ovsbridge0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSBridge
    BOOTPROTO=static
    IPADDR=A.B.C.D
    NETMASK=X.Y.Z.0
    HOTPLUG=no

Enable DHCP on the bridge:

* Needs ``OVSBOOTPROTO`` instead of ``BOOTPROTO``.
* All the interfaces that can reach the DHCP server as a space separated list
  in ``OVSDHCPINTERFACES``.

::

    DEVICE=ovsbridge0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSBridge
    OVSBOOTPROTO="dhcp"
    OVSDHCPINTERFACES="eth0"
    HOTPLUG=no


Adding Internal Port to ovsbridge0:

::

    ==> ifcfg-intbr0 <==
    DEVICE=intbr0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSIntPort
    OVS_BRIDGE=ovsbridge0
    HOTPLUG=no

Internal Port with fixed IP address:

::

    DEVICE=intbr0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSIntPort
    OVS_BRIDGE=ovsbridge0
    BOOTPROTO=static
    IPADDR=A.B.C.D
    NETMASK=X.Y.Z.0
    HOTPLUG=no

Internal Port with DHCP:

* Needs ``OVSBOOTPROTO`` or ``BOOTPROTO``.
* All the interfaces that can reach the DHCP server as a space separated list
  in ``OVSDHCPINTERFACES``.

::

    DEVICE=intbr0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSIntPort
    OVS_BRIDGE=ovsbridge0
    OVSBOOTPROTO="dhcp"
    OVSDHCPINTERFACES="eth0"
    HOTPLUG=no

Adding physical ``eth0`` to ``ovsbridge0`` described above:

::

     ==> ifcfg-eth0 <==
     DEVICE=eth0
     ONBOOT=yes
     DEVICETYPE=ovs
     TYPE=OVSPort
     OVS_BRIDGE=ovsbridge0
     BOOTPROTO=none
     HOTPLUG=no

Tagged VLAN interface on top of ``ovsbridge0``:

::

    ==> ifcfg-vlan100 <==
    DEVICE=vlan100
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSIntPort
    BOOTPROTO=static
    IPADDR=A.B.C.D
    NETMASK=X.Y.Z.0
    OVS_BRIDGE=ovsbridge0
    OVS_OPTIONS="tag=100"
    OVS_EXTRA="set Interface $DEVICE external-ids:iface-id=$(hostname -s)-$DEVICE-vif"
    HOTPLUG=no

Bonding:

::

    ==> ifcfg-bond0 <==
    DEVICE=bond0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSBond
    OVS_BRIDGE=ovsbridge0
    BOOTPROTO=none
    BOND_IFACES="gige-1b-0 gige-1b-1 gige-21-0 gige-21-1"
    OVS_OPTIONS="bond_mode=balance-tcp lacp=active"
    HOTPLUG=no

::

    ==> ifcfg-gige-* <==
    DEVICE=gige-*
    ONBOOT=yes
    HOTPLUG=no

An Open vSwitch Tunnel:

::

    ==> ifcfg-gre0 <==
    DEVICE=ovs-gre0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSTunnel
    OVS_BRIDGE=ovsbridge0
    OVS_TUNNEL_TYPE=gre
    OVS_TUNNEL_OPTIONS="options:remote_ip=A.B.C.D"

Patch Ports:

::

    ==> ifcfg-patch-ovs-0 <==
    DEVICE=patch-ovs-0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSPatchPort
    OVS_BRIDGE=ovsbridge0
    OVS_PATCH_PEER=patch-ovs-1

::

    ==> ifcfg-patch-ovs-1 <==
    DEVICE=patch-ovs-1
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSPatchPort
    OVS_BRIDGE=ovsbridge1
    OVS_PATCH_PEER=patch-ovs-0

User bridge:

::

    ==> ifcfg-obr0 <==
    DEVICE=obr0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSUserBridge
    BOOTPROTO=static
    IPADDR=A.B.C.D
    NETMASK=X.Y.Z.0
    HOTPLUG=no

DPDK NIC port:

::

    ==> ifcfg-dpdk0 <==
    DPDK vhost-user port:
    DEVICE=dpdk0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSDPDKPort
    OVS_BRIDGE=obr0

::

    ==> ifcfg-vhu0 <==
    DEVICE=vhu0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSDPDKVhostUserPort
    OVS_BRIDGE=obr0

::

    ==> ifcfg-bond0 <==
    DEVICE=bond0
    ONBOOT=yes
    DEVICETYPE=ovs
    TYPE=OVSDPDKBond
    OVS_BRIDGE=ovsbridge0
    BOOTPROTO=none
    BOND_IFACES="dpdk0 dpdk1"
    OVS_OPTIONS="bond_mode=active-backup"
    HOTPLUG=no


Red Hat systemd integration
---------------------------

The RPM packages for Open vSwitch provide support for systemd integration. It's
recommended to use the openvswitch.service to start and stop the Open vSwitch
daemons. The below table shows systemd's behavior:

=============================== ============== ============== ============== =============== ===============
              -                 Process Status                systemctl <> status
------------------------------- ----------------------------- ----------------------------------------------
Action                          ovs-vswitch     ovsdb-server  openvswitch    ovs-vswitchd    ovsdb-server
=============================== ============== ============== ============== =============== ===============
systemctl start openvswitch*    started        started        active, exited active, running active, running
crash of vswitchd               crash, started re-started     active, exited active, running active, running
crash of ovsdb                  re-started     crash, started active, exited active, running active, running
systemctl restart openvswitch   re-started     re-started     active, exited active, running active, running
systemctl restart ovs-vswitchd  re-started     re-started     active, exited active, running active, running
systemctl restart ovsdb-server  re-started     re-started     active, exited active, running active, running
systemctl stop openvswitch      stopped        stopped        inactive, dead inactive, dead  inactive, dead
systemctl stop ovs-vswitchd     stopped        stopped        inactive, dead inactive, dead  inactive, dead
systemctl stop ovsdb-server     stopped        stopped        inactive, dead inactive, dead  inactive, dead
systemctl start ovs-vswitchd*   started        started        inactive, dead active, running active, running
systemctl start ovsdb-server*   not started    started        inactive, dead inactive, dead  active, running
=============================== ============== ============== ============== =============== ===============


\* These commands where executed when no Open vSwitch related processes where
running. All other commands where executed when Open vSwitch was successfully
running.


Non-root User Support
-----------------------
Fedora and RHEL support running the Open vSwitch daemons as a non-root user.
By default, a fresh installation will create an *openvswitch* user, along
with any additional support groups needed (such as *hugetlbfs* for DPDK
support).

This is controlled by modifying the ``OVS_USER_ID`` option.  Setting this
to 'root:root', or commenting the variable out will revert this behavior.


Reporting Bugs
--------------

Please report problems to bugs@openvswitch.org.