1 ===================================
2 Red Hat network scripts integration
3 ===================================
5 The RPM packages for Open vSwitch provide some integration with Red Hat's
6 network scripts. Using this integration is optional.
8 To use the integration for a Open vSwitch bridge or interface named ``<name>``,
9 create or edit ``/etc/sysconfig/network-scripts/ifcfg-<name>``. This is a
10 shell script that consists of a series of ``VARIABLE=VALUE`` assignments. The
11 following OVS-specific variable names are supported:
17 If this is "OVSBridge", then this file represents an OVS bridge named <name>.
18 Otherwise, it represents a port on an OVS bridge and TYPE must have one of
21 * ``OVSPort``, if ``<name>`` is a physical port (e.g. eth0) or
22 virtual port (e.g. vif1.0).
24 * ``OVSIntPort``, if ``<name>`` is an internal port (e.g. a tagged
27 * ``OVSBond``, if ``<name>`` is an OVS bond.
29 * ``OVSTunnel``, if ``<name>`` is an OVS tunnel.
31 * ``OVSPatchPort``, if ``<name>`` is a patch port
33 Additionally the following DPDK port types may be available, depends on OVS
34 build- and runtime configuration:
36 * ``OVSDPDKPort``, if ``<name>`` is a physical DPDK NIC port (name must start
37 with ``dpdk`` and end with portid, eg ``dpdk0``)
39 * ``OVSDPDKVhostUserPort`` if ``<name>`` is a DPDK vhost-user port
41 * ``OVSDPDKBond`` if ``<name>`` is an OVS DPDK bond.
44 If TYPE is anything other than "OVSBridge", set to the name of the OVS bridge
45 to which the port should be attached.
48 Optionally, extra options to set in the "Port" table when adding the port to
49 the bridge, as a sequence of column[:key]=value options. For example,
50 "tag=100" to make the port an access port for VLAN 100. See the
51 documentation of "add-port" in ovs-vsctl(8) for syntax and the section on the
52 Port table in ovs-vswitchd.conf.db(5) for available options.
55 Optionally, additional ovs-vsctl commands, separated by ``--`` (double dash).
58 For "OVSBond" and "OVSDPDKBond" interfaces, a list of physical interfaces to
62 For "OVSTunnel" interfaces, the type of the tunnel. For example, "gre",
66 For "OVSTunnel" interfaces, this field should be used to specify the tunnel
67 options like remote_ip, key, etc.
70 For "OVSPatchPort" devices, this field specifies the patch's peer on the
74 For "OVSDPDKVhostUserPort" devices, this field can be set to "client" which
75 indicates that the port will be used in client mode.
78 For "OVSDPDKVhostUserPort" devices, this field specifies the path to the
79 vhost-user server socket. It will only be used if OVS_PORT_MODE is set to
85 * ``ifdown`` on a bridge will not bring individual ports on the bridge down.
86 "ifup" on a bridge will not add ports to the bridge. This behavior should be
87 compatible with standard bridges (with ``TYPE=Bridge``).
89 * If ``ifup`` on an interface is called multiple times, one can see ``RTNETLINK
90 answers: File exists`` printed on the console. This comes from ifup-eth
91 trying to add zeroconf route multiple times and is harmless.
93 * ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address.
94 Since OVS changes the device state to DOWN before changing its mac address this
95 result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up
96 operation on the bridge again to restore configuration.
105 ==> ifcfg-ovsbridge0 <==
115 Enable DHCP on the bridge:
117 * Needs ``OVSBOOTPROTO`` instead of ``BOOTPROTO``.
118 * All the interfaces that can reach the DHCP server as a space separated list
119 in ``OVSDHCPINTERFACES``.
128 OVSDHCPINTERFACES="eth0"
132 Adding Internal Port to ovsbridge0:
141 OVS_BRIDGE=ovsbridge0
144 Internal Port with fixed IP address:
152 OVS_BRIDGE=ovsbridge0
158 Internal Port with DHCP:
160 * Needs ``OVSBOOTPROTO`` or ``BOOTPROTO``.
161 * All the interfaces that can reach the DHCP server as a space separated list
162 in ``OVSDHCPINTERFACES``.
170 OVS_BRIDGE=ovsbridge0
172 OVSDHCPINTERFACES="eth0"
175 Adding physical ``eth0`` to ``ovsbridge0`` described above:
184 OVS_BRIDGE=ovsbridge0
188 Tagged VLAN interface on top of ``ovsbridge0``:
192 ==> ifcfg-vlan100 <==
200 OVS_BRIDGE=ovsbridge0
201 OVS_OPTIONS="tag=100"
202 OVS_EXTRA="set Interface $DEVICE external-ids:iface-id=$(hostname -s)-$DEVICE-vif"
214 OVS_BRIDGE=ovsbridge0
216 BOND_IFACES="gige-1b-0 gige-1b-1 gige-21-0 gige-21-1"
217 OVS_OPTIONS="bond_mode=balance-tcp lacp=active"
227 An Open vSwitch Tunnel:
236 OVS_BRIDGE=ovsbridge0
238 OVS_TUNNEL_OPTIONS="options:remote_ip=A.B.C.D"
244 ==> ifcfg-patch-ovs-0 <==
249 OVS_BRIDGE=ovsbridge0
250 OVS_PATCH_PEER=patch-ovs-1
254 ==> ifcfg-patch-ovs-1 <==
259 OVS_BRIDGE=ovsbridge1
260 OVS_PATCH_PEER=patch-ovs-0
281 DPDK vhost-user port:
294 TYPE=OVSDPDKVhostUserPort
304 OVS_BRIDGE=ovsbridge0
306 BOND_IFACES="dpdk0 dpdk1"
307 OVS_OPTIONS="bond_mode=active-backup"
311 Red Hat systemd integration
312 ---------------------------
314 The RPM packages for Open vSwitch provide support for systemd integration. It's
315 recommended to use the openvswitch.service to start and stop the Open vSwitch
316 daemons. The below table shows systemd's behavior:
318 =============================== ============== ============== ============== =============== ===============
319 - Process Status systemctl <> status
320 ------------------------------- ----------------------------- ----------------------------------------------
321 Action ovs-vswitch ovsdb-server openvswitch ovs-vswitchd ovsdb-server
322 =============================== ============== ============== ============== =============== ===============
323 systemctl start openvswitch* started started active, exited active, running active, running
324 crash of vswitchd crash, started re-started active, exited active, running active, running
325 crash of ovsdb re-started crash, started active, exited active, running active, running
326 systemctl restart openvswitch re-started re-started active, exited active, running active, running
327 systemctl restart ovs-vswitchd re-started re-started active, exited active, running active, running
328 systemctl restart ovsdb-server re-started re-started active, exited active, running active, running
329 systemctl stop openvswitch stopped stopped inactive, dead inactive, dead inactive, dead
330 systemctl stop ovs-vswitchd stopped stopped inactive, dead inactive, dead inactive, dead
331 systemctl stop ovsdb-server stopped stopped inactive, dead inactive, dead inactive, dead
332 systemctl start ovs-vswitchd* started started inactive, dead active, running active, running
333 systemctl start ovsdb-server* not started started inactive, dead inactive, dead active, running
334 =============================== ============== ============== ============== =============== ===============
337 \* These commands where executed when no Open vSwitch related processes where
338 running. All other commands where executed when Open vSwitch was successfully
342 Non-root User Support
343 -----------------------
344 Fedora and RHEL support running the Open vSwitch daemons as a non-root user.
345 By default, a fresh installation will create an *openvswitch* user, along
346 with any additional support groups needed (such as *hugetlbfs* for DPDK
349 This is controlled by modifying the ``OVS_USER_ID`` option. Setting this
350 to 'root:root', or commenting the variable out will revert this behavior.
356 Please report problems to bugs@openvswitch.org.