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 comma separated list in OVSDHCPINTERFACES.
+
+DEVICE=ovsbridge0
+ONBOOT=yes
+DEVICETYPE=ovs
+TYPE=OVSBridge
+OVSBOOTPROTO="dhcp"
+OVSDHCPINTERFACES="eth0"
+HOTPLUG=no
Adding physical eth0 to ovsbridge0 described above:
case "$TYPE" in
OVSBridge)
ovs-vsctl -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
- ${OTHERSCRIPT} ${CONFIG} ${2}
+ if [ "${OVSBOOTPROTO}" = "dhcp" ] && [ -n "${OVSINTF}" ]; then
+ case ${OVSDHCPINTERFACES} in
+ ${OVSINTF#ifcfg-} | \
+ "${OVSINTF#ifcfg-},"* | \
+ *",${OVSINTF#ifcfg-}" | \
+ *",${OVSINTF#ifcfg-},"*)
+ BOOTPROTO=dhcp ${OTHERSCRIPT} ${CONFIG}
+ ;;
+ esac
+ fi
+ if [ "${OVSBOOTPROTO}" != "dhcp" ] && [ -z "${OVSINTF}" ]; then
+ ${OTHERSCRIPT} ${CONFIG}
+ fi
;;
OVSPort)
/sbin/ifup "$OVS_BRIDGE"
${OTHERSCRIPT} ${CONFIG} ${2}
ovs-vsctl -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
+ OVSINTF=${CONFIG} /sbin/ifup "$OVS_BRIDGE"
;;
OVSIntPort)
/sbin/ifup "$OVS_BRIDGE"
done
ovs-vsctl -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA}
${OTHERSCRIPT} ${CONFIG} ${2}
+ OVSINTF=${CONFIG} /sbin/ifup "$OVS_BRIDGE"
;;
*)
echo $"Invalid OVS interface type $TYPE"