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 * ``OVSDPDKRPort``, if ``<name>`` is a DPDK ring port (name must start with
40 ``dpdkr`` and end with portid, e.g. ``dpdkr0``)
42 * ``OVSDPDKVhostUserPort`` if ``<name>`` is a DPDK vhost-user port
44 * ``OVSDPDKBond`` if ``<name>`` is an OVS DPDK bond.
47 If TYPE is anything other than "OVSBridge", set to the name of the OVS bridge
48 to which the port should be attached.
51 Optionally, extra options to set in the "Port" table when adding the port to
52 the bridge, as a sequence of column[:key]=value options. For example,
53 "tag=100" to make the port an access port for VLAN 100. See the
54 documentation of "add-port" in ovs-vsctl(8) for syntax and the section on the
55 Port table in ovs-vswitchd.conf.db(5) for available options.
58 Optionally, additional ovs-vsctl commands, separated by ``--`` (double dash).
61 For "OVSBond" and "OVSDPDKBond" interfaces, a list of physical interfaces to
65 For "OVSTunnel" interfaces, the type of the tunnel. For example, "gre",
69 For "OVSTunnel" interfaces, this field should be used to specify the tunnel
70 options like remote_ip, key, etc.
73 For "OVSPatchPort" devices, this field specifies the patch's peer on the
77 For "OVSDPDKVhostUserPort" devices, this field can be set to "client" which
78 indicates that the port will be used in client mode.
81 For "OVSDPDKVhostUserPort" devices, this field specifies the path to the
82 vhost-user server socket. It will only be used if OVS_PORT_MODE is set to
88 * ``ifdown`` on a bridge will not bring individual ports on the bridge down.
89 "ifup" on a bridge will not add ports to the bridge. This behavior should be
90 compatible with standard bridges (with ``TYPE=Bridge``).
92 * If ``ifup`` on an interface is called multiple times, one can see ``RTNETLINK
93 answers: File exists`` printed on the console. This comes from ifup-eth
94 trying to add zeroconf route multiple times and is harmless.
96 * ``ifup`` on OVSDPDKPort or OVSDPDKBond may result in change of bridge mac address.
97 Since OVS changes the device state to DOWN before changing its mac address this
98 result in loss of bridge configuration (e.g. routes). ``ifup-ovs`` perform post-up
99 operation on the bridge again to restore configuration.
108 ==> ifcfg-ovsbridge0 <==
118 Enable DHCP on the bridge:
120 * Needs ``OVSBOOTPROTO`` instead of ``BOOTPROTO``.
121 * All the interfaces that can reach the DHCP server as a space separated list
122 in ``OVSDHCPINTERFACES``.
131 OVSDHCPINTERFACES="eth0"
135 Adding Internal Port to ovsbridge0:
144 OVS_BRIDGE=ovsbridge0
147 Internal Port with fixed IP address:
155 OVS_BRIDGE=ovsbridge0
161 Internal Port with DHCP:
163 * Needs ``OVSBOOTPROTO`` or ``BOOTPROTO``.
164 * All the interfaces that can reach the DHCP server as a space separated list
165 in ``OVSDHCPINTERFACES``.
173 OVS_BRIDGE=ovsbridge0
175 OVSDHCPINTERFACES="eth0"
178 Adding physical ``eth0`` to ``ovsbridge0`` described above:
187 OVS_BRIDGE=ovsbridge0
191 Tagged VLAN interface on top of ``ovsbridge0``:
195 ==> ifcfg-vlan100 <==
203 OVS_BRIDGE=ovsbridge0
204 OVS_OPTIONS="tag=100"
205 OVS_EXTRA="set Interface $DEVICE external-ids:iface-id=$(hostname -s)-$DEVICE-vif"
217 OVS_BRIDGE=ovsbridge0
219 BOND_IFACES="gige-1b-0 gige-1b-1 gige-21-0 gige-21-1"
220 OVS_OPTIONS="bond_mode=balance-tcp lacp=active"
230 An Open vSwitch Tunnel:
239 OVS_BRIDGE=ovsbridge0
241 OVS_TUNNEL_OPTIONS="options:remote_ip=A.B.C.D"
247 ==> ifcfg-patch-ovs-0 <==
252 OVS_BRIDGE=ovsbridge0
253 OVS_PATCH_PEER=patch-ovs-1
257 ==> ifcfg-patch-ovs-1 <==
262 OVS_BRIDGE=ovsbridge1
263 OVS_PATCH_PEER=patch-ovs-0
284 DPDK vhost-user port:
297 TYPE=OVSDPDKVhostUserPort
307 OVS_BRIDGE=ovsbridge0
309 BOND_IFACES="dpdk0 dpdk1"
310 OVS_OPTIONS="bond_mode=active-backup"
314 Red Hat systemd integration
315 ---------------------------
317 The RPM packages for Open vSwitch provide support for systemd integration. It's
318 recommended to use the openvswitch.service to start and stop the Open vSwitch
319 daemons. The below table shows systemd's behavior:
321 =============================== ============== ============== ============== =============== ===============
322 - Process Status systemctl <> status
323 ------------------------------- ----------------------------- ----------------------------------------------
324 Action ovs-vswitch ovsdb-server openvswitch ovs-vswitchd ovsdb-server
325 =============================== ============== ============== ============== =============== ===============
326 systemctl start openvswitch* started started active, exited active, running active, running
327 crash of vswitchd crash, started re-started active, exited active, running active, running
328 crash of ovsdb re-started crash, started active, exited active, running active, running
329 systemctl restart openvswitch re-started re-started active, exited active, running active, running
330 systemctl restart ovs-vswitchd re-started re-started active, exited active, running active, running
331 systemctl restart ovsdb-server re-started re-started active, exited active, running active, running
332 systemctl stop openvswitch stopped stopped inactive, dead inactive, dead inactive, dead
333 systemctl stop ovs-vswitchd stopped stopped inactive, dead inactive, dead inactive, dead
334 systemctl stop ovsdb-server stopped stopped inactive, dead inactive, dead inactive, dead
335 systemctl start ovs-vswitchd* started started inactive, dead active, running active, running
336 systemctl start ovsdb-server* not started started inactive, dead inactive, dead active, running
337 =============================== ============== ============== ============== =============== ===============
340 \* These commands where executed when no Open vSwitch related processes where
341 running. All other commands where executed when Open vSwitch was successfully
345 Non-root User Support
346 -----------------------
347 Fedora and RHEL support running the Open vSwitch daemons as a non-root user.
348 By default, a fresh installation will create an *openvswitch* user, along
349 with any additional support groups needed (such as *hugetlbfs* for DPDK
352 This is controlled by modifying the ``OVS_USER_ID`` option. Setting this
353 to 'root:root', or commenting the variable out will revert this behavior.
359 Please report problems to bugs@openvswitch.org.