28fc1e
Red Hat network scripts integration
28fc1e
-----------------------------------
28fc1e
28fc1e
The RPM packages for Open vSwitch provide some integration with Red
28fc1e
Hat's network scripts.  Using this integration is optional.
28fc1e
28fc1e
To use the integration for a Open vSwitch bridge or interface named
28fc1e
<name>, create or edit /etc/sysconfig/network-scripts/ifcfg-<name>.
28fc1e
This is a shell script that consists of a series of VARIABLE=VALUE
28fc1e
assignments.  The following OVS-specific variable names are supported:
28fc1e
28fc1e
    - DEVICETYPE: Always set to "ovs".
28fc1e
28fc1e
    - TYPE: If this is "OVSBridge", then this file represents an OVS
28fc1e
      bridge named <name>.  Otherwise, it represents a port on an OVS
28fc1e
      bridge and TYPE must have one of the following values:
28fc1e
28fc1e
        * "OVSPort", if <name> is a physical port (e.g. eth0) or
28fc1e
          virtual port (e.g. vif1.0).
28fc1e
28fc1e
        * "OVSIntPort", if <name> is an internal port (e.g. a tagged
28fc1e
          VLAN).
28fc1e
28fc1e
        * "OVSBond", if <name> is an OVS bond.
28fc1e
28fc1e
        * "OVSTunnel", if <name> is an OVS tunnel.
28fc1e
28fc1e
    - OVS_BRIDGE: If TYPE is anything other than "OVSBridge", set to
28fc1e
      the name of the OVS bridge to which the port should be attached.
28fc1e
28fc1e
    - OVS_OPTIONS: Optionally, extra options to set in the "Port"
28fc1e
      table when adding the port to the bridge, as a sequence of
28fc1e
      column[:key]=value options.  For example, "tag=100" to make the
28fc1e
      port an access port for VLAN 100.  See the documentation of
28fc1e
      "add-port" in ovs-vsctl(8) for syntax and the section on the
28fc1e
      Port table in ovs-vswitchd.conf.db(5) for available options.
28fc1e
28fc1e
    - OVS_EXTRA: Optionally, additional ovs-vsctl commands, separated
28fc1e
      by "--" (double dash).
28fc1e
28fc1e
    - BOND_IFACES: For "OVSBond" interfaces, a list of physical
28fc1e
      interfaces to bond together.
28fc1e
28fc1e
    - OVS_TUNNEL_TYPE: For "OVSTunnel" interfaces, the type of the tunnel.
28fc1e
      For example, "gre", "vxlan", etc.
28fc1e
28fc1e
    - OVS_TUNNEL_OPTIONS: For "OVSTunnel" interfaces, this field should be
28fc1e
      used to specify the tunnel options like remote_ip, key, etc.
28fc1e
28fc1e
Note
28fc1e
----
28fc1e
28fc1e
* "ifdown" on a bridge will not bring individual ports on the bridge
28fc1e
down.  "ifup" on a bridge will not add ports to the bridge.  This
28fc1e
behavior should be compatible with standard bridges (with
28fc1e
TYPE=Bridge).
28fc1e
28fc1e
* If 'ifup' on an interface is called multiple times, one can see
28fc1e
"RTNETLINK answers: File exists" printed on the console. This comes from
28fc1e
ifup-eth trying to add zeroconf route multiple times and is harmless.
28fc1e
28fc1e
Examples
28fc1e
--------
28fc1e
28fc1e
Standalone bridge:
28fc1e
28fc1e
==> ifcfg-ovsbridge0 <==
28fc1e
DEVICE=ovsbridge0
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSBridge
28fc1e
BOOTPROTO=static
28fc1e
IPADDR=A.B.C.D
28fc1e
NETMASK=X.Y.Z.0
28fc1e
HOTPLUG=no
28fc1e
28fc1e
Enable DHCP on the bridge:
28fc1e
* Needs OVSBOOTPROTO instead of BOOTPROTO.
28fc1e
* All the interfaces that can reach the DHCP server
28fc1e
as a space separated list in OVSDHCPINTERFACES.
28fc1e
28fc1e
DEVICE=ovsbridge0
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSBridge
28fc1e
OVSBOOTPROTO="dhcp"
28fc1e
OVSDHCPINTERFACES="eth0"
28fc1e
HOTPLUG=no
28fc1e
28fc1e
28fc1e
Adding Internal Port to ovsbridge0:
28fc1e
28fc1e
==> ifcfg-intbr0 <==
28fc1e
DEVICE=intbr0
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSIntPort
28fc1e
OVS_BRIDGE=ovsbridge0
28fc1e
HOTPLUG=no
28fc1e
28fc1e
28fc1e
Internal Port with fixed IP address:
28fc1e
28fc1e
DEVICE=intbr0
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSIntPort
28fc1e
OVS_BRIDGE=ovsbridge0
28fc1e
BOOTPROTO=static
28fc1e
IPADDR=A.B.C.D
28fc1e
NETMASK=X.Y.Z.0
28fc1e
HOTPLUG=no
28fc1e
28fc1e
Internal Port with DHCP:
28fc1e
* Needs OVSBOOTPROTO or BOOTPROTO.
28fc1e
* All the interfaces that can reach the DHCP server
28fc1e
as a space separated list in OVSDHCPINTERFACES.
28fc1e
28fc1e
DEVICE=intbr0
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSIntPort
28fc1e
OVS_BRIDGE=ovsbridge0
28fc1e
OVSBOOTPROTO="dhcp"
28fc1e
OVSDHCPINTERFACES="eth0"
28fc1e
HOTPLUG=no
28fc1e
28fc1e
Adding physical eth0 to ovsbridge0 described above:
28fc1e
28fc1e
==> ifcfg-eth0 <==
28fc1e
DEVICE=eth0
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSPort
28fc1e
OVS_BRIDGE=ovsbridge0
28fc1e
BOOTPROTO=none
28fc1e
HOTPLUG=no
28fc1e
28fc1e
28fc1e
Tagged VLAN interface on top of ovsbridge0:
28fc1e
28fc1e
==> ifcfg-vlan100 <==
28fc1e
DEVICE=vlan100
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSIntPort
28fc1e
BOOTPROTO=static
28fc1e
IPADDR=A.B.C.D
28fc1e
NETMASK=X.Y.Z.0
28fc1e
OVS_BRIDGE=ovsbridge0
28fc1e
OVS_OPTIONS="tag=100"
28fc1e
OVS_EXTRA="set Interface $DEVICE external-ids:iface-id=$(hostname -s)-$DEVICE-vif"
28fc1e
HOTPLUG=no
28fc1e
28fc1e
28fc1e
Bonding:
28fc1e
28fc1e
==> ifcfg-bond0 <==
28fc1e
DEVICE=bond0
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSBond
28fc1e
OVS_BRIDGE=ovsbridge0
28fc1e
BOOTPROTO=none
28fc1e
BOND_IFACES="gige-1b-0 gige-1b-1 gige-21-0 gige-21-1"
28fc1e
OVS_OPTIONS="bond_mode=balance-tcp lacp=active"
28fc1e
HOTPLUG=no
28fc1e
28fc1e
==> ifcfg-gige-* <==
28fc1e
DEVICE=gige-*
28fc1e
ONBOOT=yes
28fc1e
HOTPLUG=no
28fc1e
28fc1e
An Open vSwitch Tunnel:
28fc1e
28fc1e
==> ifcfg-gre0 <==
28fc1e
DEVICE=ovs-gre0
28fc1e
ONBOOT=yes
28fc1e
DEVICETYPE=ovs
28fc1e
TYPE=OVSTunnel
28fc1e
OVS_BRIDGE=ovsbridge0
28fc1e
OVS_TUNNEL_TYPE=gre
28fc1e
OVS_TUNNEL_OPTIONS="options:remote_ip=A.B.C.D"
28fc1e
28fc1e
Reporting Bugs
28fc1e
--------------
28fc1e
28fc1e
Please report problems to bugs@openvswitch.org.